65 points · by docsproX · 2y ago · 24 comments
Still fun to learn about Hough transforms, canny edge detection, and all that 1990s computer vision though!
Wouldn't re-using Meta's SAM (Segment Anything Model) be sufficient here? (which is freely available and, I think, free to use?) Or do you think you need to build your own model specifically for detection bills/sheets of paper?
Have vision models started offering better alternatives for such use cases? It's a genuine question; it's been a while since I last looked.
There is an entire spectrum of models, from something like Mask-RCNN, U-Net family upto something like Meta's SAM, which you can use without even training.
In my domain of metrology, this part isn't acceptable:
> you will get a model that can predict the exact edges of every input image.
Prediction is a nice way to limit the space I have to consider for a proper edge detection, but usually it's better to just go straight to something more deterministic.
https://www.youtube.com/watch?v=Nnpm-rJfFjQ
The accuracy is probably quite bad, when looked at individual manipulations, but the overall result is jaw dropping - even, if it's only a demonstration
I've seen some kind of edge detection also used in software used in automated KYC/AML pipelines, to detect obvious cut/paste in utility bills / passport scans etc.
Forgot the name of the (commercial) software but it's a thing.
It's of course possible to fool these but a great many dumb copy/paste which do look perfect to a human will actually become obvious after applying simple edge detection.
FWIW Gimp has Sobel edge detections for sure (don't know about the others), so you can "play" with edge detection if you're on Linux.
One way this could be done is downsampling the image and then use sobel or canny edge detection.
EDIT: I remembered one anecdote. At some point, we had poor accuracy with the white paper on a white background. I really liked how it was solved: agents were equipped with a branded black silk cloth to use as a background.