I'm evaluating the technical quality of an images and I'd like to scan it for defects from dirty sensors. Are there any filters to quickly detect a blob of discoloration? Here are a few examples:
-
4$\begingroup$ Broken pixels and dust on the matrix are always sitting at fixed place. Therefore, you need to record video (or fast frame sequence) of dynamic scene and just look for correlation over long frame sequence. Another thing is pixel noise. It is the same camera-related defect but it is randomly generated at each frame. I guess the Fourier spectrum of such noisy image should contain short-periodic components which amplitude is proportional to amount noise . $\endgroup$– Rom38Commented Aug 26, 2016 at 6:59
-
$\begingroup$ If you can generate desired images, then sensor noise or surface defects can be imaged by us of a small aperture (say f/22) and making two images of a reasonably uniform background. A visual flicker compare or correlation of the two images with show a sensor noise. | As suggested by Rom38, you can correlate existing images - with results improved by small aperture and increasing number of images used. $\endgroup$– Russell McMahonCommented Aug 26, 2016 at 8:49
-
$\begingroup$ See also this post photo.stackexchange.com/questions/21640/… $\endgroup$– yarchikCommented Aug 26, 2016 at 10:53
-
2$\begingroup$ If you only have access to individual images taken at unknown times, but not the camera itself, please indicate that. Comments and answers seem to assume that you are able to take any number of images with the same camera with arbitrary settings and compare them. $\endgroup$– SzabolcsCommented Sep 6, 2016 at 8:18
-
$\begingroup$ I'm sure wavelet analysis can do this,so I add that tag,but I don't know how to do it. $\endgroup$– yodeCommented Apr 14, 2017 at 20:21
2 Answers
If you can generate desired images, then sensor noise or surface defects can be imaged by use of a small aperture (say f/22) and making two images of a reasonably uniform background.
A visual flicker compare or correlation of the two images with show a sensor noise.
For '35mm' digital images I find a relatively uniform area - a wall or the sky is usually good enough, and set the camera for an exposure of say 1 to 4 seconds. I then defocus the image and "wave" the camera pseudo randomly across the target area during the exposure. This typically gives a near uniform detail free image. (Blue biased for the sky, green for a wall of foliage etc.) Comparison of two images makes sensor noise and similar very visible.
As suggested by Rom38, you can correlate existing images - with results improved by small aperture and increasing number of images used.
-
$\begingroup$ Hmmm. Downvoter at work. Strange. Not 103% correlated with query but "useful" in the context. $\endgroup$ Commented Sep 10, 2016 at 0:27
I'm still working on it and there still can be a lot improvements in my work, but I think it's a good thing to let you know there's still someone working on this interesting question.
detect[img_, th_: .04, filt_Integer: 2, bin_Integer: 5,size_:25] :=
Block[{imgp, disks},
imgp = LocalAdaptiveBinarize[LaplacianGaussianFilter[img, filt],
bin, {1, 0, th}];
disks =
ComponentMeasurements[
imgp, {"Centroid", "EquivalentDiskRadius"}, #Count < size &];
HighlightImage[img, Disk @@@ disks[[;; , 2]]]]
then run detect[img1]
where img1
is the second picture with a almost uniform background, we can get a fairly good detection!
but as you can see, in other pictures with not that good uniformity over regions, things could go messy, so I'm trying to use some other filter like EntropyFilter
or StandardDeviationFilter
to map out the area in which blobs can possibly be found. By saying "possibly be found", I mean even people cannot find blobs in a not that uniform region as we cannot be sure whether it is a blob or a real stuff!
But as your ultimate question is
Are there any filters to quickly detect a blob of discoloration?
Then my answer is LaplacianGaussianFilter
, EntropyFilter
and StandardDeviationFilter
. The first finds out blobs and the latter two tell which of them are valid.
Hope this can help.
-
1$\begingroup$ Lightroom has a feature to make it easier to see these dust spots. Google for "lightroom visualize spots". By the looks it works by increasing (local?) contrast and doing edge detection. Since most such spots are circular, they will be easier to spot. But they aren't always circular, see examples. As a human, I rely not only on spotting the shape of a spot, but also knowing what to exact in that region of the image. No well-defined spots are expected in the sky, of any shape. No circles are expected among natural forms. $\endgroup$– SzabolcsCommented Sep 12, 2016 at 12:50