3 ms·
Nice! Yeah, I am using Vision's rectangle detection.. but it's really touchy. I've got a lot of heuristics in there to throw out bad results and smooth things
by yeldarb 9y ago
Nice!
Yeah, I am using Vision's rectangle detection.. but it's really touchy. I've got a lot of heuristics in there to throw out bad results and smooth things out.
It doesn't do well if there's something near the puzzle though (like a horizontal rule or text like you might see in a newspaper layout).
Any suggestions on a better way to segment the rectangles? Or any preprocessing tips (I couldn't really find anything that made it detect things more reliably)
- iamflimflam1 9y agoI've got a very old and slightly broken blog post on what I was doing: https://www.cmgresearch.com/2009/08/14/How-does-it-all-work.html https://www.cmgresearch.com/2009/08/14/How-does-it-all-work.... My approach was to adaptive threshold the image and then assume that that the object of interest was the biggest connected region in the image. Then run that though rectangle detection. Have you tried setting the aspect ratio and minimum width on the Vision rectangle detector? That might filter out any nonsense.
- yeldarb 9y agoThe parameters are not very well documented. (Or at least it wasn't when I was coding that part). But yeah I did get those set finally. Whatever I do though I can't get it to recognize any rectangles here: http://www.telegraph.co.uk/news/science/science-news/9359579/Worlds-hardest-sudoku-can-you-crack-it.html http://www.telegraph.co.uk/news/science/science-news/9359579... For our demo video we ended up photoshopping out the horizontal line right above it and that seemed to work.
- iamflimflam1 9y agoJust tried it on my old app and it worked well :) I think you'll have to roll your own rectangle detection and use heuristics to make it better. So in mine I assume that the connected object in the thresholded image with the largest number of pixels must be the puzzle. That makes it a lot easier. Good luck!
- yeldarb 9y agoCool I'll put that on my todo list. Thanks!