Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Does picture change grayscale levels after I resample it?

I have a picture which has 1000X1000 pixels and 10bits grayscale levels. I want to resample it to 64X64 pixels. What is the grayscale levels finally? still 10bits or change to 32bits? I want to it changes to 32bits grayscale levels. Any help is appreciated.
0 Kudos
Message 1 of 3
(3,234 Views)
Why do you want a bit depth of 32? It seems a bit extreme.

I believe the NI resampling routines will maintain the existing 10 bits of grayscale levels.

The highest bit depth NI images can handle is 16 bits, unless you go to floating point. I'm not even sure if you could get higher bit depths that way.

The simplest way to increase your bit depth is to use a custom summing filter. Convert your image to floating point, then create a 15x15 filter with all 1's. Use convolution and set the divisor to 1 also. This will add all the values in the 15x15 block and increase your bit depth to about 18. When you resample to 64x64, you will keep the increased bit depth.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,234 Views)
If you cast your 10 bit image to 32 bits (float) and resample using Bi-Linear, Quadratic, or Cubic Spline, then the resample algorithm will actually give you fractional pixel values. I have attached below a 10 bit image and the resulting 32 bit image after resampling. This option is very simple if it gives you the results you need. You can do better than 10 bits, but there is probably no way you can get (or need) 32 effective bits of resolution.

Regards,

Brent R.
Applications Engineer
National Instruments
Download All
0 Kudos
Message 3 of 3
(3,234 Views)