Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

neighbouring pixel value

Hello
i am new labview user. Can you please tell me is it possible to do the following in labview ....

 

Firstly, we need to read the image and obtain the pixel values of each and every pixel.
Mainly, this program should check whether there is uniformity in the image. That is, there shouldn't be an abrupt change in pixel value at any region of the image.
So, we need the program to select one pixel, and compare its value with few neighboring pixels, say, around 4or 6 pixels. We should check that the difference in pixel value should be less than 10% of the center pixel intensity.
Repeat the same procedure selecting successive pixels, one at a time.

0 Kudos
Message 1 of 5
(4,103 Views)

Yes, you can do something like that easily using a 3x3 filter.  One possibility would be using edge detection filters that will highlight pixels that are significantly different from their surroundings.  Another possibility would be to use a max filter and a min filter, then subtract the difference.  You can use a standard 3x3 filter that compares all 9 pixels in a 3x3 grid, or select a subset of those pixels such as horizontal and vertical only (ignoring corners).  All sorts of possibilities.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 5
(4,101 Views)

thanks

 

edge detection i used already but not of much help in my case...
can you please elaborate on using standard filter which you mentioned and how to go about it in labview

0 Kudos
Message 3 of 5
(4,094 Views)

I'm not exactly sure what you are trying to get.  Are you only looking for spots that are significantly brighter than the surrounding ones?  How about darker than surrounding?

 

Try this:  Create a couple of blank images, titled Min and Max.  Use Grayscale Morphology with Erode, and wire Min as the destination image.  Use Grayscale Morphology with Dilate, and wire Max as the destination image.  Use IMAQ Subtract to subtract Min from Max.  This will give you the absolute range of each pixel and its surrounding pixels.  For pixels with large differences, you will get a 3x3 bright spot.  You should use the Gradient palette to display the image, or else you won't be able to see the spots.

 

If you can post an image with an example of the spots you are trying to find, that would be helpful.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 5
(4,090 Views)

As a matter of fact edge detection provides exactly details about uniformity of the image. In the regions where you have all pixels of the same value you'll get zero after edge detection. In the regions where you have big variation you'll get big value after edge detection.

 

But if you want want to measure variation in some mathematical sense than you can simply calculate standard deviation:

1) for each pixel of the region select a subset (say 3x3 or 5x5) around it

2) calculate the difference between the value of that pixel and other pixels in the subset

3) multiply the result of step 2 by itself

4) Sum all the results of step 3 (and normalize if you wish)

 

This way you have a mathematical estimation which tells you how much current pixel deviates from it's neighbors

 

 

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 5 of 5
(4,070 Views)