For test I used an image with just square blocks.Did you blur the image as I had originally suggested. If you do not, it will try to find each letter.
Prepare for OCR, find words and rotate.
Re: Prepare for OCR, find words and rotate.
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.
Re: Prepare for OCR, find words and rotate.
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.
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.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Prepare for OCR, find words and rotate.
Code: Select all
-dissimilarity threshold
Code: Select all
-dissimilarity-threshold
snibgo's IM pages: im.snibgo.com
Re: Prepare for OCR, find words and rotate.
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?
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?