Page 2 of 2

Re: Prepare for OCR, find words and rotate.

Posted: 2014-10-20T00:54:43-07:00
by eleison
Thanks so much for your answer! I've been busy with family past week, this week i'm going to put time into this project again! I will try your suggestions, and see if I can a solution.
Did you blur the image as I had originally suggested. If you do not, it will try to find each letter.
For test I used an image with just square blocks.

Re: Prepare for OCR, find words and rotate.

Posted: 2014-11-09T13:49:46-07:00
by eleison
Thank you so much for the detailed explanation! I've been so busy with other projects lately. Sorry for late reply :/

You'r method works but might be little bit too slow for me. So I wanted to try my other method I explained previous in this thread. You gave me this -> data=`compare -metric pae -subimage-search -dissimilarity-threshold 1 -similarity-threshold 0 \
out_tmp.jpg \( -size 1x1 xc:black \) null: 2>&1`
# echo "$data"

I get this error message:
compare: unrecognized option `-dissimilarity' @ error/compare.c/CompareImageCommand/556.

My other solution would be to just run your multicrop script and modify it to just return the coordinates, too use for cropping the "none blured org-image". Is that possible?

I'm now using Centos 7 with ImageMagick 6.8.9-10 Q16 x86_64.

Re: Prepare for OCR, find words and rotate.

Posted: 2014-11-09T14:15:36-07:00
by snibgo

Code: Select all

-dissimilarity threshold
should read

Code: Select all

-dissimilarity-threshold
(with a hyphen). See http://www.imagemagick.org/script/comma ... -threshold

Re: Prepare for OCR, find words and rotate.

Posted: 2014-11-09T16:03:55-07:00
by eleison
Thanks! It was obvious, but didn't notice it. The command takes long time to finish :/, but i get correct pixel.

I came up with another method that could work for me: Step 1: use -trim and crop a fixed sized rectangle from each corner. Step 2: fill cropper area with white color then repeat step 1. Since i got quite much white space around each text-object this might work. Either I manually try to find a size for the "fixed sized rectangle" that works for my project, or maybe there is a way to determine the size of the biggest text area?