Hi. I have been dealing with a difficult to find issue. I have a FastFoto scanner which is an Automatic Document Feeder. As it feeds the images, it scans via fixed scanner elements. This works well but if there is dirt or some sort of debree on the scanner glass then it results in a very narrow line on the scanned image. I tried using examples utilizing HoughLines and HouphLinesP and even with a threshold of 1, it was unable to pick this line up. Is there anyone they knows a simple way to detect whether I need to clean the sensor then rescan an image?
yes, don’t take object scans, take blank scans. then you’ll see ONLY the debris.
Not sure what that means exactly? If you mean that I need to scan a blank photo every X images, maybe that would work for the future, but I have thousands of scans already and need a simple way to see if I need to rescan any of them. It would take me days to rescan them all. If you meant that there is some way in OpenCV to check for blank space, I would be happy to look into that if you can give me some indication on how to do that
got a sample picture to look at?
Since these are family photos, I have removed the faces. I highlighted the error area with an ellipse and arrow. You can see that the line goes all the way through the image (it affects the removed area as well, and continues to the bottom of the image)
has that scan been rotated in any way? the streak isn’t going straight down.
All I would have done manually is 90 degree rotations. The software I use has the option to fix rotation issues which was likely selected, so the adf could have pulled it in at a slight angle and the software then corrected it
just to state the obvious, all that interference makes the task much harder.
it’s especially silly because whatever program did those things did nothing about the streaks.
Understood. I have seen that the software for newer hardware has an option to detect dirt, but it’s not available for my model. Even if it was available, it will not go back and check old scans. Is there something I can do to detect, or is it to complicated?
If I need to manually check old ones, I can accept that, but even for future scans, it would be great to have something, so if I didn’t have it correct for slightly skewed images, I would need to check for the streak and then correct the skew, so if that is something opencv could do then I would try that
@crackwitz any additional thoughts?
well…
undo the rotation. assuming there are streaks, some kind of radon transform would accurately estimate the rotation of the entire thing based on those streaks. I’m not gonna comment further on that because that’s easier solved by not having whatever software mess with the source data.
to find the streaks themselves, I’d try various statistics along rows and columns, upto and including histograms.
you’ll need a model of those streaks. light is complex. if you’re lucky, you can model that as merely a layer on top of the image, i.e. streak has a color and an opacity value, and the result is a weighted combination.
that’ll recover the image for streaks that aren’t fully opaque. those that are… then at least you’ll know where it is, and you can apply any kind of inpainting that looks good enough to you.
those pics also deserve to get that sepia removed. that’s another topic though.
Thanks for the assistance. I have a lot of experience in software, but none in openCV, so some of the things you suggest are foreign to me. Any chance you can point me to examples on what these things are and how to do it? I dont know what a radon transform is, I have never dealt with histograms, so not really following there. Agree about the sepia, but more interested in having these digitized than perfect. Open to suggestions on sepia as well. Wish I had all the time in the world to do this, but have maybe an hour a day to look into this and its not a simple topic to read up on, so unfortunately without some examples, its unlikely I will be able to follow up on these