Hi there,

I'm doing a camera caliberation program which will detect whether there is stain on the camera lens.
i have a program that can detect the stain and display but how do i go about detecting the position and also CIRCLE the position whereby there is stain. any suggestion? cause i'm not very sure of what to use. THANKS=)

Recommended Answers

All 5 Replies

Not sure but here is a suggestiong. Look at the pixel where its way off
the average , so if a camera lens is white , then its average should be
close to white. If there is a dirt on the lens, then its pixel will be
way of the average pixel, white. So now you detected the spot.
And to circle it, you can find the the radius of the spot by tracing the pixel, seeing where it reaches close to the average. Now you have the diameter, just using polar coordinates to draw a circle around the pixels.
Just a suggestion, don't know if it will work completely though.

Or you can just look at your lenses and clean them.

Not sure but here is a suggestiong. Look at the pixel where its way off
the average , so if a camera lens is white , then its average should be
close to white. If there is a dirt on the lens, then its pixel will be
way of the average pixel, white. So now you detected the spot.
And to circle it, you can find the the radius of the spot by tracing the pixel, seeing where it reaches close to the average. Now you have the diameter, just using polar coordinates to draw a circle around the pixels.
Just a suggestion, don't know if it will work completely though.

Or you can just look at your lenses and clean them.

haas i wished but this a project that i'm working on=(
so how do we go about a tracing pixel?? do u actually have a sample.?
i got the diameter of the of the spot /100 to direction x & /100 to direction y.

You need to read the pixels. I guess you can take a snapshot of the
lenses. Then read in the data an trace pixels from there.

You need to read the pixels. I guess you can take a snapshot of the
lenses. Then read in the data an trace pixels from there.

ya i am using the snapshot after which display out. just that i duno if there is a program that read pixel? any idea?...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.