cancel
Showing results for 
Search instead for 
Did you mean: 

detect dark spots using camera

Arjun247
Member

detect dark spots using camera

Message contains an attachment

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.

16 REPLIES 16
Andy_C.
NI Employee (retired)

Re: detect dark spots using camera

Hey Arjun,

 

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

Andy Chang
National Instruments
muks
Proven Zealot

Re: detect dark spots using camera

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.
Arjun247
Member

Re: detect dark spots using camera

Message contains an attachment

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.

 

 

muks
Proven Zealot

Re: detect dark spots using camera

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?
Arjun247
Member

Re: detect dark spots using camera

Message contains an attachment

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

I will keep you posted.

muks
Proven Zealot

Re: detect dark spots using camera

Post a good image and a bad one so that we can also work on that.
Arjun247
Member

Re: detect dark spots using camera

Message contains an attachment

Ok

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

 

 

 

muks
Proven Zealot

Re: detect dark spots using camera

And again will it be ok if I give you a solution to differtiate the good and bad? Is some measurement involved?
Highlighted
muks
Proven Zealot

Re: detect dark spots using camera

Message contains an attachment

Try this