Page 1 of 1

Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-06-26T05:28:34-07:00
by Swamy
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

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-06-26T07:38:22-07:00
by magick
gzseek64, et. al. are calls to the libz compression library. Is it included in your link path?

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-03T21:47:20-07:00
by Swamy
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

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-04T04:50:29-07:00
by snibgo
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

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-04T05:01:44-07:00
by Swamy
Thanks for the help..
Please suggest the same for pixel difference in percentage. using ImageMagick version 6.7.7-10.

Regards,
Thippeswamy H

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-04T05:59:27-07:00
by snibgo
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.

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-04T21:36:04-07:00
by Swamy
Hi,

On what basis RMSE value as been determined, I mean based on PIXELS, RGB or SRGB values.

Regards,
Thippeswamy H

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-05T01:50:05-07:00
by snibgo
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.

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-05T01:52:52-07:00
by Swamy
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

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-05T02:19:20-07:00
by snibgo
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.

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-05T02:34:50-07:00
by Swamy
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

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-05T03:03:13-07:00
by snibgo
"-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.

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-05T03:26:59-07:00
by Swamy
Hi

ThanX for all the help Dear!

Regards,
Thippeswamy H

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-16T23:38:19-07:00
by Swamy
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

Re: Cross compiling ImageMagick-7.0.8-2 to ARM processor

Posted: 2018-07-17T09:06:29-07:00
by fmw42
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:)