Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image contrast is too low

Solved!
Go to solution

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!glass protect film's proflie size.pngoriginal image.png

Striving is without limit!
0 Kudos
Message 1 of 8
(3,722 Views)

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

Bruce Ammons
Ammons Engineering
Message 2 of 8
(3,698 Views)
Message 3 of 8
(3,688 Views)
Bruce,Thanks for your reply! Indeed,use "Find Straight Edge " and increase the Kernel Size and Projection Width can improve the SNR.But in my project I need measure the profile midline's dimension(both horizontal and vertical).My approach is:first ,Use "Find Straight Edge " find the left edge and right edge;second,Use IMAQ Bisecting Line VI to get the left & right edge's bisecting line;Third,compute the intersection point between the bisecting line and the profile's top & bottom edge;Fourth,compute the distance between the two intersection points.So,find the a single point is needed.Looking forword to your further reply!
Striving is without limit!
0 Kudos
Message 4 of 8
(3,663 Views)

The light I currently used  is the backlight,I need measure the glass protector's profile dimension,In addition,the glass has mirror reflection.

Striving is without limit!
0 Kudos
Message 5 of 8
(3,662 Views)
Solution
Accepted by topic author leq_82

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

Bruce Ammons
Ammons Engineering
Message 6 of 8
(3,649 Views)

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.

Striving is without limit!
0 Kudos
Message 7 of 8
(3,637 Views)

Bruce,I see,Thanks a lot!

Striving is without limit!
0 Kudos
Message 8 of 8
(3,628 Views)