I have an image that has various characters hand drawn in it, like numbers and letters. I'm trying to partition each character into it's own image so I can run it through Classify[]
and identify them one at a time (since TextRecognize[]
doesn't work well on individual characters). My images look like this:
That's a bunch of 1's for putting into Classify[]
. So it should be pretty easy to partition each one, but I'm not sure what the best way to do it is. I tried adapting this example:
http://reference.wolfram.com/mathematica/example/AnalyzeSegmentedCellsInAnImage.html
but I couldn't get it to work.
characters =
SelectComponents[
DeleteBorderComponents[Binarize[a, {0, .7}]], {"Area"},
100 < #1 < 1000 &];
outlines =
ComponentMeasurements[
ImageMultiply[a, characters], {"BoundingBox"}][[All, 2]];
Show[a, Graphics[{Red, Thick, Circle @@ # & /@ outlines}]];
This just returns a slightly lighter version of the original image with no red anywhere.