Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-06-26T05:28:34-07:00
Hi,
I'm a Newbie to ImageMagick, Im trying to cross compile ImageMagick to ARM based freescale processors.
I'm getting an error while cross compiling.
Code: Select all
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `gzseek64'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so: undefined reference to `g_ptr_array_ref'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so: undefined reference to `g_byte_array_ref'
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `gztell64'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so: undefined reference to `g_array_unref'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so: undefined reference to `g_byte_array_unref'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so: undefined reference to `g_array_ref'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so: undefined reference to `g_ptr_array_unref'
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `gzopen64'
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `pango_font_map_create_context'
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/usr/lib/libcairo.so: undefined reference to `__longjmp_chk@GLIBC_2.11'
MagickCore/.libs/libMagickCore-7.Q16HDRI.so: undefined reference to `FcConfigSetRescanInterval'
collect2: ld returned 1 exit status
make[1]: *** [utilities/magick] Error 1
make[1]: Leaving directory `/media/4b98fa50-5746-44a0-a066-e25383d2338a/swamy/Image_Magic/ImageMagick-7.0.8-2'
make: *** [all] Error 2
Please help me to fix this error.
Regards,
Thippeswamy H
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2018-06-26T07:38:22-07:00
gzseek64, et. al. are calls to the libz compression library. Is it included in your link path?
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-03T21:47:20-07:00
Hi,
Im done with the cross compilation part.
But i need to percentage difference between two images based on RGB and SRGB colorspace, i need some information how the images are compared based on RGB and sRGB colorspace.
command used as following
convert image1 image2 -compose Difference -composite -colorspace rgb -format '%[fx:mean*100]' info:
Following Below link
http://www.imagemagick.org/Usage/compare/
Regards,
Thippeswamy H
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2018-07-04T04:50:29-07:00
Swamy wrote: But i need to percentage difference between two images ...
There are many ways to calculate a difference, either as a percentage or normalised to 1.0, including:
1. The mean of the differences, as you have done.
2. The square root of the mean of the differences squared (RMSE).
3. The maximum difference.
4. And many others.
Personally, I most often use RMSE:
Code: Select all
magick img1.png img2.png -metric RMSE -format %[distortion] -compare info:
0.100002
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-04T05:01:44-07:00
Thanks for the help..
Please suggest the same for pixel difference in percentage. using ImageMagick version 6.7.7-10.
Regards,
Thippeswamy H
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2018-07-04T05:59:27-07:00
For IM v6, use "convert" instead of "magick". I don't know if "-compare" was available in v6.7.7. If not, then use the compare program:
Code: Select all
compare -metric RMSE img1.png img2.png NULL:
The number (in parentheses) is on a scale from 0.0 to 1.0. For a percentage, multiply by 100.
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-04T21:36:04-07:00
Hi,
On what basis RMSE value as been determined, I mean based on PIXELS, RGB or SRGB values.
Regards,
Thippeswamy H
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2018-07-05T01:50:05-07:00
RMSE, like other comparison metrics, is calculated from pixel values in the two images. The values might represent colours in sRGB, RGB, Lab, AdobeRGB, Rec2020, or any colorspace.
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-05T01:52:52-07:00
Hi
Thanks for the help!
An error occured when comparing two images with different sizes. May i know how to compare images with different sizes.
Ex :-
compare white.JPG test1.jpg -metric AE -verbose NULL:
compare: ImageWidthsOrHeightsDiffer `white.JPG' @ error/compare.c/CompareImageCommand/962.
Regards,
Thippeswamy H
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2018-07-05T02:19:20-07:00
The "compare" methods compare corresponding pixels in the two images, so they must be the same size. You can first crop or resize the images to make them the same size.
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-05T02:34:50-07:00
Hi
But as i gone through convert utility, as i previously mentioned
convert image1 image2 -compose Difference -composite -colorspace rgb -format '%[fx:mean*100]' info:
was able to work fine images with different sizes, on what basis value as been determined,
Regards,
Thippeswamy H
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2018-07-05T03:03:13-07:00
"-composite" can operate on images of different sizes. See
http://www.imagemagick.org/Usage/compose/ . When the second image is larger than the first, the extra pixels will be ignored. When the first image is larger than the second, the extra pixels be used in the fx:mean calculation. So for sensible results, it is best to ensure they are the same size.
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-05T03:26:59-07:00
Hi
ThanX for all the help Dear!
Regards,
Thippeswamy H
Swamy
Posts: 8 Joined: 2018-06-26T05:03:27-07:00
Authentication code: 1152
Post
by Swamy » 2018-07-16T23:38:19-07:00
Hi,
"-metric AE" gives the number of pixels that have changed.
how to get image difference percentage in pixels in ubuntu or fedora environment using -metric AE option.
Regards,
Thippeswamy H
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2018-07-17T09:06:29-07:00
Metric AE does not give percentages. You will need to take the number of pixels that are changed from compare -metric AE and divide the the area of the image (widthxheight), which is the total number of pixels in the image, then multiply by 100. You can do that with an fx calculation (%[fx:...])
In unix syntax:
Code: Select all
diff=$(compare -metric AE image1 image2 null: 2>&1)
pct=$(convert image1 -format "%[fx:100*$diff/(wxh)]" info:)