Link to home
Start Free TrialLog in
Avatar of Ray Paseur
Ray PaseurFlag for United States of America

asked on

Detect Closed Loops (circles, figure-8s, etc) in PNG Images

I want to detect closed loop formations in PNG images of handwritten numbers.  If you know how to do this in any of the topic languages and can share a code example, I'd be grateful.  If you have a link to a reference that explains the algorithm, that would be great, too.

Here are some images with closed loops.
User generated imageUser generated imageUser generated image
Here are some images without closed loops.
User generated imageUser generated imageUser generated image
Thanks and regards, Ray
SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ray Paseur

ASKER

Thanks, Doug.  I'm familiar with Geitgey - he has really good explanations, and already have read most of his medium articles on ML.  I'm at the stage here where I want to do image feature detection in PHP and my next step will be building the neurons.  I already know enough about this to be sure that PHP is the wrong language for this work, but I have my reasons for wanting to make the examples in PHP, even if they will never win any speed contests.  I don't know Python well enough to read it for understanding, so that's why I'm looking for examples in other languages.

Interestingly, PHP imageCopyResampled() can downsize large image files into small files with high cohesiveness.  Here's the number 8 built from a collection of 55 handwriting samples.  A little normalization goes a long way toward getting something worthy of the more costly (slower) processes like imageConvolution() User generated image
Avatar of dpearson
dpearson

Yeah I think all of this low level processing ends up happening in C/C++.  So you should be able to find various wrapper libraries out there which handle the access from other higher level languages.  I no speaky PHP (and personally have never used the libraries in his post) so I'm not the guy to point you to the right wrappers.  Just hopefully giving some insight into which approach to take.

Doug
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, Zoppo.  Didn't know about OpenCV, thanks.  It looks like a good place to start.  Thanks for the links!
Thanks guys - appreciate the help!