
IMT-OCR-LOG: Found 0 occurence(s) of text 'Portrait' in attempt #2 IMT-OCR-LOG: Scaling image to 200% in attempt #2 IMT-OCR-LOG: Sharpening image in attempt #1 IMT-OCR-LOG: Inverting the major color of image from 0xF5F5F5 to 0x0A0A0A in attempt #1 IMT-OCR-LOG: Major color of image is 'grey96' with hex value of F5F5F5 in attempt #1 IMT-OCR-LOG: Getting major color of image in attempt #1 IMT-OCR-LOG: Found 0 occurence(s) of text 'Portrait' in attempt #1 Tesseract Open Source OCR Engine with Leptonica IMT-OCR-LOG: Scaling image to 100% in attempt #1 IMT-OCR-LOG: image-magick-tesseract-processing]$ sh imt-ocr.sh test.jpeg Portrait Inv_color_hex=`echo $(printf '%06X\n' $((0x$white_color_hex - 0x$input_color_hex)))`įor ((scale=$start_scale, attempt=$attempt scale White_color_hex=FFFFFF # White color's hex vlaue Input_color_hex=$1 # Input color's hex value # Return format: Returns a string "hex_val_of_color major_color_name"Ĭonvert $1 -format %c histogram:info: > x.txtĬolor_info=$(cat x.txt | grep "$h" | cut -d '#' -f2) # Returns the major color of an image with its hex value # 2 - text to search in image (default to '')

# imt-ocr.sh is image magick tessearc OCR tool that is used for finding out text in image I wanted your input on this as this script seems to work with most images, but not those images where the text font color is similar to smaller-surroundings around the text.
Based on the text, the script will try its best to get the text from the image. I am trying to build a shell script that allows me to search for text in an image.
