Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

pass through image swiftly

Hello,

does anyone have an idea how to pass swiftly through the entire image?
I need to prove the pixel values inside a small region at every position of the image.
Using two for loops is slowing down the process.

Thanks in advance,
Alexandra
0 Kudos
Message 1 of 6
(3,615 Views)
Dear Alexandra,

Other processes to consider might be to manipulate a row or column of pixels at a time. There are IMAQ Vision functions that will allow you to extract selected rows and columns (just in the same way as you can with regular data arrays). The extracted column or row (line profile) is effectively a 1D array of pixels (ranging from 0 to 255 if you image is 8-bit). By taking this approach you may be able to make use of the polymorphic nature of many of LabVIEW's core VIs (numeric operators, comparison VIs and so on).

This approach should avoid the need to examine each individual pixel within your image. If you find that this approach is not suitable or I have misunderstood your question, could you supply some more detailed information as to how
you need to "prove the pixel values"?

Jeremy
0 Kudos
Message 2 of 6
(3,615 Views)
Thank you JeremyB!

I meant to sample the pixel values.
The thing I'm looking for is more like a filter.
For example I can use the convolution filter to pass an structuring element consisting of ones through the image and get in the new image the information about the average of pixel values inside my structuring element for every pixel. But what about other calculations I want to do? If I need the standart deviation of the pixel values inside the region for example?
0 Kudos
Message 3 of 6
(3,615 Views)
The thing I want to do right now is to detect the position of a big dark object on a ground of varying intensity.
I need a pixel that belongs to the object for sure because I want to use the magic wand tool for thresholding. So I thought to pass through the image with a region, to calculate mean and standart deviation and to look for the minimum.
Maybe you have a better idea to do that?!
But the other question is intersting for me as well.

Alexandra
0 Kudos
Message 4 of 6
(3,615 Views)
I'm pretty sure that IMAQ Vision allows to create a custom 3x3 or 5x5... kernel for use with the convolution filters (see IMAQ Build Kernel). You can also use IMAQ Get Kernel to retrieve standard image processing kernels used in spatial filters. You mention standard deviation - does this mean that you are looking to use a Gaussian filter (see http://www.dai.ed.ac.uk/HIPR2/gsmooth.htm). If so then IMAQ Get Kernel can be used to return a Gaussian kernel and this can then be used as an input to IMAQ Convolute
0 Kudos
Message 5 of 6
(3,615 Views)
Hi Jeremy,

yes it is possible to create custom kernels.
But can I somehow define even the filter function a nonlinear filter uses?
Than I could make all calculations I want to inside the kernel that slides through the entire image.
(Or even with every single pixel.)
The result would be the new image with the value at every correponding pixel.
Quiete faster than using loops in labview.
I don't know how progamming the loops as dll's would increase the speed...

Alexandra
0 Kudos
Message 6 of 6
(3,615 Views)