Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Thresholding problem

Hello all!

I'm having a problem thresholding images.

I send in attachment 2 examples, one of the original image, and another with a thresholded binary image.

The problem is that I want to isolate the crack in the right, and get rid of the other things (considered noise). Using the automatic thresholding methods I cannot achieve the desired results, while manually thresholding the images I can isolate the crack, but the application I'm develloping is intended to do that threshold automatically.

I thought of detecting the valleys in the image histogram and then use the corresponding intensity value as the threshold value, but I don't know how can I get that intensity value (the valley one), and if the histogram as for example 3 valleys, how can I get the right valley?

Any ideas?

Thanks in advance!
Download All
0 Kudos
Message 1 of 7
(4,382 Views)
What type of lighting are you using, or is this an existing image file you are working with.
I would suggest trying diffuse ring lighting at various angles of attack,if possible. This may enhance the contrast of the crack and 'hide' surface details yielding a better image to process in software.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 7
(4,365 Views)
That's an existing file I'm working on... Smiley Sad
0 Kudos
Message 3 of 7
(4,363 Views)
Any help??? Smiley Sad
0 Kudos
Message 4 of 7
(4,338 Views)

Hi,

Which software do you use ? LabVIEW, Vision assistant, LabWindows/CVI ? version 7.1, 8.0 ?

One possibility for make that you want, is to use IMAQ ROI profile function to retrieve the line profil of one part of your image.

With this we can have the minimum level value, and we can use this value with a manual treashold.

See one example in LabVIEW 8.0.

Regards,

 

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 5 of 7
(4,297 Views)
Hi
I have done this slightly differently. I have used an arbitrary threshold and found dark blobs. Using the centre of mass of this as a base then used the magic wand function to find the connected blob with a relative threshold.
Hope this helps

Mike
0 Kudos
Message 6 of 7
(4,292 Views)
Thanks a lot for your help! The results are very good, better with the imaq.vi file.

I also got into a solution. I start by getting the peak of the histogram (corresponding to the background pixels) and then I start to look through the histogram from that peak to the left until I find the first valley, corresponding to my threshold level.
Then I remove the particles below a certain pixels-area and I keep the more elongated particle in the image (which corresponds to the crack).

For the images I'm dealing with, this revealed to be the best method.


Thanks anyway!

Best regards!

Message Edited by Goju-Ryu on 05-04-2006 11:48 AM

0 Kudos
Message 7 of 7
(4,273 Views)