Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Pixel Contrast Value?

Got another one!!
In my application where I want to Measure objects in my image, it just so happens that I don't really know what will be appearing in my picture and where it will be.
What I do currently for a still photo sample is created 5 CWIMAQLines to do a Pixel Check on. This can be seen in my suppied .tif with the 5 vertical run lines where measurements take place.

What is being looked at in the image is ICE. And what is being measure would be ICE turned sideways as an Icebreaker runs over it. IE Almost Parallel lines.
So you can see how I have output the measurement layer for each measurement that was picked up down each of the 5 CWIMAQLines. With the first line to the Left most of the image you can see that the lower 2 measurements are measuring an Ice thickness piece. But the upmost measurement was the dark region above the Ice. (I also manually tuned this image to get a better contrast difference to help the measurements)
But looking at each subsequent measurement line it can be seen how the measurements are getting the Right Stuff and then also getting the dark stuff up each line.
So what I want to do is sort of check if the points in each measurement are across a Light region or Dark region, as the only thing that I will know about my image is that what I want to measure will be Light.

So the Measurements are all done by using the CWIMAQVision.GetPointsOnLine passing in my line and returning a CWIMAQPoints array.
Then I use: CWIAMQVision.FindEdges2 To find Each edge along the line.
Will the Optional Parameter EdgeReport perhaps tell me whether the edge is coming from a dark region to light region or vice versa. Because my idea is to use such information to only really output measurements for regions that start at a DARK to LIGHT and end on a LIGHT to DARK. As that would mean that it most likely measured a LIGHT area and that would most likely be my ice.


Thanks....
0 Kudos
Message 1 of 3
(6,298 Views)
Hello!

The FindEdges2 function has an optional EdgeReport parameter that you eluded to in your post. This Edge report consists of:

Contrast - Intensity contrast at the edge.
Coordinate Point - contains the coordinates of the edge.
Polarity - Polarity of the edge. (Light to Dark, Dark to Light)
Position - Position of the edge from the first point in the Points parameter passed to CWIMAQVision.FindEdges2. This is a subpixel interpolated distance.


So in your application, you will want to use the Polarity item within the Edge Report. I found this information in the IMAQ Vision for Visual Basic Reference, which is installed with Vision when you include VB support.

Hope this helps!

Robert
0 Kudos
Message 2 of 3
(6,280 Views)
Yep Using that EdgeReport seems to have done it for me.
Now I can look down my measurement line and just return either lighter objects or darkers objects.
It seems to work pretty good if I have an edge that satisfies.

Thanks
0 Kudos
Message 3 of 3
(6,271 Views)