Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image Bin

Is there a way to do an Image Bin  operation for an image without doing a full convolution and then resample?
 
For example, I have an image of size 640*480, and then I want a image size of 160*120 with each pixel equal to the average of each 4*4 area in the original image. I know I can do a concolution and then resample but that could be a waste of processing time because I do not need a average on the original 640*480 image size.
 
Thanks
 
Cindy
0 Kudos
Message 1 of 4
(3,623 Views)

Cindy,

I am assuming that you are using LabVIEW with the Vision Development Module, but please let me know if this is not the case.  If you are using the IMAQ Convolute VI, then you would need to perform the convolution and resampling in two separate steps.  One alternative would be to convert your image to an array using the IMAQ ImageToArray VI, then resample a new smaller array as you perform averaging on the original array.  However, this would most likely be a much slower process than the original method.  Please let me know if you are using the functions I described, then I will see what other options might work better.

Chris M.
Applications Engineer
National Instruments

Message 2 of 4
(3,599 Views)
Chris M.:

I am using Labview and I am using IMAQ convolute and resample, 
but convolute is also a slow operation and is indeed unnecessary in this 'bin' application. Converting to an array is again a  slow operation,  That is why I am asking here, is there another way? It would be nice that there is a way to define a mask with regular sample points and I only do the convulation on these points.

thanks

akang

0 Kudos
Message 3 of 4
(3,593 Views)

Cindy,

I have looked into the matter further, and there are no other methods for binning an image other than what we have already mentioned.  I think that the way you are doing it now with Convolute then Resample is the most efficient.  There is currently no single-step method for this process with Vision, but I will suggest that this be added to future versions.

Chris

0 Kudos
Message 4 of 4
(3,574 Views)