I am running following command to compare phash of two images in ubuntu terminal
compare -metric phash 01.png 02.png compare.png
but it giving error that:
compare.im6: unrecognized metric type `phash' #error/compare.c/CompareImageCommand/728
my identify version is:
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
You get this error because the phash metric has been added in version 6.8.8-2. I would advise you to upgrade to the latest version if you need this feature.
Related
I asked about this on the Tesseract forum already
Via Tesseract (and ImageMagick), I'm trying to find out the text of this
PDF file
This is the section of the PDF that I'm working on, it's line #7 of the
PDF:
In this section, Tesseract is running into problems when trying to identify
the string CONSTRUCTORA.
It sees CO NSTRUCTO RA
It should see CONSTRUCTORA
Can anyone suggest any possible fixes for this?
This is the commandline sequence:
convert -density 600 my_pdf.pdf tmp.tif
tesseract -l spa tmp.tif stdout > tmp.txt
These are the software versions:
~% tesseract --version
tesseract 3.05.01
leptonica-1.74.4
libgif 4.1.6(?) : libjpeg 8d (libjpeg-turbo 1.3.0) : libpng 1.2.50 :
libtiff 4.0.3 : zlib 1.2.8
~% convert --version
Version: ImageMagick 6.7.7-10 2014-08-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
For dealing with the irregular kerning of the PDF file, Will suggested tweaking the parameters around tosp_min_sane_kn_sp of the docs https://github.com/naptha/tesseract.js/blob/master/docs/tesseract_parameters.md
Setting tosp_min_sane_kn_sp=2.8 solved the issue that was described in the question.
The new Tesseract invocation is the following:
tesseract -c tosp_min_sane_kn_sp=2.8 -l spa tmp.tif stdout > tmp.txt
The default value for tosp_min_sane_kn_sp seems to be 1.5. So far, I have only tested with values larger than 1.5.
I am using Imagemagick to compare two screenshots in windows environment.
https://blog.codecentric.de/en/2017/09/robot-framework-compare-images-screenshots/
*** Settings ***
Library String
Library OperatingSystem
*** Variables ***
${IMAGE_COMPARATOR_COMMAND} C:\\"Program Files"\\ImageMagick-7.0.7-Q16\\convert.exe
*** Test Cases ***
Image Comparison Ok
Compare Images C:/Users/user/imagecompare/Test/src/reference-screenshots/reference-1.png C:/Users/user/imagecompare/Test/src/test-screenshots/test-1.png 0.1
Image Comparison NOk
Compare Images C:/Users/user/imagecompare/Test/src/reference-screenshots/reference-1.png C:/Users/user/imagecompare/Test/src/test-screenshots/test-1.png 0.1
*** Keywords ***
Compare Images
[Arguments] ${Reference_Image_Path} ${Test_Image_Path} ${Allowed_Threshold}
${TEMP}= Replace String ${IMAGE_COMPARATOR_COMMAND} __REFERENCE__ ${Reference_Image_Path}
${COMMAND}= Replace String ${TEMP} __TEST__ ${Test_Image_Path}
Log Executing: ${COMMAND}
${RC} ${OUTPUT}= Run And Return Rc And Output ${COMMAND}
Log Return Code: ${RC}
Log Return Output: ${OUTPUT}
${RESULT} Evaluate ${OUTPUT} < ${Allowed_Threshold}
Should be True ${RESULT}
But getting the following issue:
KEYWORD BuiltIn . Log Return Output: ${OUTPUT}
Documentation:
Logs the given message with the given level.
Start / End / Elapsed: 20171016 15:45:38.561 / 20171016 15:45:38.562 / 00:00:00.001
15:45:38.561 INFO Return Output: The system cannot find the path specified.
00:00:00.003KEYWORD ${RESULT} = BuiltIn . Evaluate ${OUTPUT} < ${Allowed_Threshold}
Documentation:
Evaluates the given expression in Python and returns the results.
Start / End / Elapsed: 20171016 15:45:38.562 / 20171016 15:45:38.565 / 00:00:00.003
15:45:38.563 FAIL Evaluating expression 'The system cannot find the path specified. < 0.1' failed: SyntaxError: invalid syntax (<string>, line 1)
If you want to use the "legacy" convert command with ImageMagick v7, you need to click the option during installation of ImageMagick that says "Install legacy tools".
Or, use the new command which is:
magick input.png ... output.png
rather than:
convert input.png ... output.png
So, if you know how to change your configuration variable IMAGE_COMPARATOR_COMMAND to C:\\"Program File"\\ImageMagick-7.0.7-Q16\\magick, you can do it without re-installing ImageMagick.
${IMAGE_COMPARATOR_COMMAND} C:/"Program Files"/ImageMagick-7.0.10-Q16/convert.exe REFERENCE TEST -metric RMSE -compare -format "%[distortion]" info:
replace with above IMAGE_COMPARATOR_COMMAND with suitable changes for your path.
It worked for me.
Thanks
I tried to increase the quantum depth of the GraphicsMagick to 16bits. I downloaded the GraphicsMagick package from here. Here is the result for the version details and quantum depth result for gm version.
karthikeyan#karthikeyan:~$ gm version
GraphicsMagick 1.3.25 2016-09-05 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2016 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
..
...
....
Configured using the command:
./configure '--with-quantum-depth=16' '--enable-shared' '--disable-static' '--with-magick-plus-plus=yes'
So I went ahead to process images,assuming my graphicsmagick can handle 16 bits, but I am getting this error. Please help to resolve this:
karthikeyan#karthikeyan:~$ octave
octave:1> i = imread("/home/karthikeyan/Pictures/Wallpapers/f1376677896.jpg");
warning: your version of GraphicsMagick limits images to 8 bits per pixel
*** Error in `/usr/bin/octave-cli': malloc(): memory corruption: 0x0000000002300dd0 ***
panic: Aborted -- stopping myself...
^C^CPress Control-C again to abort.
^Cpanic: attempted clean up apparently failed -- aborting...
Aborted (core dumped)
I am trying to use ImageMagick to convert a CMYK image to a RGB image using the following command:
convert inputimage.jpg -colorspace RGB outputimage.jpg
If the inputimage is a CMYK image, I get the following error:
lcms: Error #12288; Pointer error; probably corrupted file
I am using ImageMagick 6.8.8-5 Q16 i686 on Debian.
Any ideas how to fix this error?
Thanks in advance
I'm trying to upload some photos into my Rails app. But I'm getting:
Paperclip::NotIdentifiedByImageMagickError in Admin::ImagesController#create
C:/Users/Dwayne/stream20110816-3680-1hm9dag-0.jpeg is not recognized by the 'identify' command.
I know this has been asked before. I thought I'd give my side of the story though, be a bit more verbose than the others, and in doing so help increase awareness of this terrible tragedy.
What platform are you on?
# uname
CYGWIN_NT-6.1-WOW64
Is ImageMagick installed?
# identify
Version: ImageMagick 6.4.0 01/19/10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
Where is it?
# which identify
/usr/bin/identify
Tell that to Paperclip:
# config/environments/development.rb
Paperclip.options[:command_path] = "/usr/bin"
See if all the files and folders work:
# identify C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg
stream20110817-1264-1xuum8v-0.jpg JPEG 249x262 249x262+0+0 PseudoClass 256c 8-bit 9.88281kb
# identify /cygdrive/c/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg
stream20110817-1264-1xuum8v-0.jpg JPEG 249x262 249x262+0+0 PseudoClass 256c 8-bit 9.88281kb
Try the same from within the Rails console:
# irb(main):005:0> system("identify C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg")
C:/Users/Dwayne/stream20110817-1264-1xuum8v-0.jpg JPEG 360x360 360x360+0+0 DirectClass 8-bit 32.3281kb
=> true
Still nothing?
Take it to Paperclip's GitHub.
Still nothing?
Hope that somebody here might know.
Courtesy of Travis Pessetto:
Uninstall ImageMagick for Cygwin, install ImageMagick for Windows and try again!