08-04-2017 03:35 AM
Hello,All!
I use NI Vision to measure the protective film's boundary dimension for mobilephone screen glass,but the original image's contrast is very low(< 20) because of the protective film is too thin.When I use "Edge Detector" to find the edge,I must set the "min edge strength" to very low(almost 10) or I can't find the edge.The problem is,when the parameter is changed so small,the test result is very unstable ,often find the wrong edge.I think some image enhancement methods can improve the contrast,but I'm not familiar with this ,does anyone can give some suggestions?Best give me some image processing sample code according to the image in the my annex .Thanks very much!
Solved! Go to Solution.
08-04-2017 07:01 PM
See the attached image.
I would use Find Straight Edge so you can find the entire edge instead of a single point. Since you know roughly where the edge should be, just use a rectangle to select the area where it could be. You can increase the Kernel Size and Projection Width to improve the signal to noise ratio. I would also tell it which edge you are looking for (bright to dark) and select Best Edge.
With these settings, a minimum edge strength of 5 works just fine. You will need two separate searches for the top and bottom edges.
Bruce
08-04-2017 08:21 PM
You might want to look also on the option of dark field illumination
http://www.advancedillumination.com/Products/StandProducts/all-ring-lights-dark-field
https://www.stemmer-imaging.co.uk/en/knowledge-base/dark-field-illumination/
08-05-2017 08:33 AM
08-05-2017 08:45 AM
The light I currently used is the backlight,I need measure the glass protector's profile dimension,In addition,the glass has mirror reflection.
08-05-2017 11:27 PM
I would find the four edges using Find Straight Edge the way I suggested. The rest is just math.
Add together the equations for lines on the left and right sides (in the form x = Cy + D), and divide by two. This will give you the equation of the line going down the middle of the glass. The bisecting line VI might give you the same results.
Similarly, add together the equations for the lines on the top and bottom (in the form y = Ax + B), and divide by two. This is the line across the middle of the glass.
Now you have two equations, two unknowns. Solve for x and y to get the center of the glass.
But you wanted the midline dimensions. Just use the intersection points of the midlines and the edge lines, then calculate the distance between the points.
Bruce
08-06-2017 04:01 AM
Bruce,Thanks!Yes,your equations is a process of seeking bisecting line.As you described, the last step need find the intersection points of the midlines and the edge lines;Howerver,I always find incorrect intersection points if the edge contrast is too low.
08-06-2017 09:29 AM
Bruce,I see,Thanks a lot!