ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

detect dark spots using camera

I have taken a snapshot of a light source. I am posting a sample of

bad light source. It has dark spots in it. I just need the area of dark

spots of the circle. The processing I did to get an equalized image is

 

acquisiton-->extract luminance plane-->imaq mask and extract-->threshold-->imaq equalize.

 

i used vision assistant for the above steps.  

The images are attached to this post. I did use count and find objects, but results are not

that accurate. Does anyone know a better way to get more accurate results. Just let me

know if anyone knows a better way of finding all the dark spots.

Download All
0 Kudos
Message 1 of 17
(5,236 Views)

Hey Arjun,

 

How many spots were you able to locate? Could you post your script?

Andy Chang
National Instruments
0 Kudos
Message 2 of 17
(5,200 Views)
Is the blue patch that you are calling as a black spot? Will the perfect image have a perfect white circle? One method you ca use is detect circles in binary image and depending on the diameter you can say whether you have any black spot or not.
0 Kudos
Message 3 of 17
(5,183 Views)

Muks

yes a perfect image will have perfect white circle. I am attaching the code as well as

original image and snap of my output. I got this code from vision assistant. In original

image the innermost circle is what I am masking and extracting.

 

When you will open my output image you will see that the dark spots near the border

of circle go unnoticed. The reason could be because of no border. I need to find the area

of all the dark spots, and thats it. If anyone feeds the my original to my code you will see

the result of what I see on my output. I appreciate your help. In circle the slight dark spots

are what I am lookingto detect.

 

I did try what Muks suggested os using circular edge detection, the result was interesting but

not what I need.

 

 

Download All
0 Kudos
Message 4 of 17
(5,147 Views)
Before circular detaction you can try morpological operation namely dilation and increase the iteration till you get satisfactory result. Can you attach the vi for 8.0 or post a screen shot?
0 Kudos
Message 5 of 17
(5,132 Views)

I am attaching the snapshot of the code. I am trying some experiments.

I will keep you posted.

0 Kudos
Message 6 of 17
(5,109 Views)
Post a good image and a bad one so that we can also work on that.
0 Kudos
Message 7 of 17
(5,089 Views)

Ok

I am attaching the good image to thia post. Here w go.

 

 

 

0 Kudos
Message 8 of 17
(5,073 Views)
And again will it be ok if I give you a solution to differtiate the good and bad? Is some measurement involved?
0 Kudos
Message 9 of 17
(5,071 Views)

Try this

 

 

0 Kudos
Message 10 of 17
(5,069 Views)