possible bug convert to pfm IM 6.8.0.3

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug convert to pfm IM 6.8.0.3

Post by fmw42 » 2012-10-30T20:26:10-07:00

IM 6.8.0.3 with or without HDRI Mac OSX Snow Leopard.

When using FFT (-fft without HDRI or +fft with HDRI), the center pixel of the magnitude or the real components should be the same as the mean of the original image.

convert cameraman.jpg -format "%[fx:mean]" info:
0.622039

With or Without HDRI:

convert cameraman.jpg -fft -delete 1 -format "%[fx:u.p{128,128}]" info:
0.622034

convert cameraman.jpg -fft -delete 1 MIFF:- | convert - -format "%[fx:u.p{128,128}]" info:
0.622034

convert cameraman.jpg -fft -delete 1 PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
0.344869



The same happens with +fft in HDRI.

imh convert cameraman.jpg -fft -delete 1 -format "%[fx:u.p{128,128}]" info:
0.622039

imh convert cameraman.jpg -fft -delete 1 -define quantum:format=floating-point MIFF:- | imh convert - -format "%[fx:u.p{128,128}]" info:
0.622039

imh convert cameraman.jpg -fft -delete 1 PFM:- | imh convert - -format "%[fx:u.p{128,128}]" info:
0.344879


Is this a bug or am I misunderstanding something about PFM?

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug convert to pfm IM 6.8.0.3

Post by magick » 2012-10-31T04:41:57-07:00

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.0-4 Beta available by sometime tomorrow. Thanks.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug convert to pfm IM 6.8.0.3

Post by fmw42 » 2012-11-01T11:32:35-07:00

magick wrote:We can reproduce the problem you posted and have a patch in ImageMagick 6.8.0-4 Beta available by sometime tomorrow. Thanks.

I am still seeing the same result in IM 6.8.0.4 HDRI downloaded today.

imh convert -version
Version: ImageMagick 6.8.0-4 2012-11-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: HDRI


imh convert cameraman.jpg -fft -delete 1 PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
0.344869

This should have a result as given by

imh convert cameraman.jpg -fft -delete 1 -format "%[fx:u.p{128,128}]" info:
0.622039


Do I misunderstand? Is there some oddity with PFM colorspace conversion going on in relation to MIFF or MPC?

Other than this issue, using PFM format to save FFT images does not seem to be different from MPC or miff.

It seems odd that I have to do this to get it to work. Is PFM linear like PGM?

imh convert cameraman.jpg -fft -delete 1 -colorspace sRGB PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
0.622034

Correct me if I am wrong, but I thought the result of fft was still sRGB and not linear? Has that changed?

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug convert to pfm IM 6.8.0.3

Post by magick » 2012-11-01T16:18:30-07:00

PFM can be color of grayscale. If its grayscale its linear, if color, sRGB. Your command,
  • convert cameraman.jpg -fft -delete 1 PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
returns 0.622022 for us, we're using ImageMagick 6.8.0-4.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug convert to pfm IM 6.8.0.3

Post by fmw42 » 2012-11-01T18:08:00-07:00

magick wrote:PFM can be color of grayscale. If its grayscale its linear, if color, sRGB. Your command,
  • convert cameraman.jpg -fft -delete 1 PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
returns 0.622022 for us, we're using ImageMagick 6.8.0-4.
It does not work for me in HDRI mode., though it does work in non-HDRI mode


imh convert -version
Version: ImageMagick 6.8.0-4 2012-11-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: HDRI

imh convert cameraman.jpg -fft -delete 1 PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
0.344869



convert -version
Version: ImageMagick 6.8.0-4 2012-11-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:

convert cameraman.jpg -fft -delete 1 PFM:- | convert - -format "%[fx:u.p{128,128}]" info:
0.622034

User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug convert to pfm IM 6.8.0.3

Post by magick » 2012-11-01T18:48:00-07:00

We have HDRI enabled. Not sure why its failing for you.

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug convert to pfm IM 6.8.0.3

Post by fmw42 » 2012-11-01T20:07:36-07:00

magick wrote:We have HDRI enabled. Not sure why its failing for you.
Very strange! I just re-installed IM 6.8.0.4 HDRI and now it works fine.

I cannot explain it. It did not work previously as shown above. Any way, sorry about the false alarm.

Post Reply