Page 1 of 1

converted png to raw then identify says unexpected EOF

Posted: 2018-04-20T20:52:31-07:00
by manit
Here is what I did

$ identify ~/Downloads/sd04/png_txt/figs_0/f0001_01.png
/home/lxuser/Downloads/sd04/png_txt/figs_0/f0001_01.png PNG 512x512 512x512+0+0 8-bit RGB 256c 212KB 0.000u 0:00.000

$ convert ~/Downloads/sd04/png_txt/figs_0/f0001_01.png f0001_01.rgb

$ identify f0001_01.rgb
identify: must specify image size `f0001_01.rgb' @ error/rgb.c/ReadRGBImage/144.

$ identify -size "512x512" f0001_01.rgb
f0001_01.rgb RGB 512x512 512x512+0+0 16-bit TrueColor sRGB 786KB 0.020u 0:00.020
identify: unexpected end-of-file `f0001_01.rgb': No such file or directory @ error/rgb.c/ReadRGBImage/237.

I am using
$ convert --version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
on 64 bit ubuntu OS .

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-20T22:39:14-07:00
by snibgo
You saved the RGB image as 8 bits/channel, but you are using Q16, so that is the default depth for reading. Use "-depth 8" in the read:

Code: Select all

identify -size "512x512" -depth 8 f0001_01.rgb 

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-27T21:39:42-07:00
by manit
ok , i will try and report back.

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-27T22:08:25-07:00
by manit
Can the rgb image I have made in original post be called raw pixmap ?

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-28T00:47:56-07:00
by manit
I am trying to convert a png image to format suitable for this utility .
It mentions raw pixmap as an option.
https://github.com/lessandro/nbis/blob/ ... an1/cwsq.1

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-28T08:59:20-07:00
by snibgo
In the context of grayscale fingerprints, "raw pixmap" might mean a headerless image file with one byte per pixel, 0=black and 255=white. IM can make this with ".gray" format, eg:

Code: Select all

conver rose: out.gray

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-29T22:47:21-07:00
by manit
i will try that

Re: converted png to raw then identify says unexpected EOF

Posted: 2018-04-29T23:10:30-07:00
by manit
That works.
Thanks a lot snibgo .
For somebody else who wants to convert image to wsq so that mindtct can detect minutae in it.

convert <input_image> sth.gray
identify -size <imgXximgY> -depth 8 sth.gray # to verify sth.gray
cwsq <compressionratio> wsq sth.gray -raw_in <imgX,imgY,8>

0.75 will make smaller wsq file in comparison to 3 .
I am guessing, they have recommended compression ratio of 3 .
Cannot understand tags (.br,.RE,.RS,.I,.TP) strewn all over https://raw.githubusercontent.com/lessa ... an1/cwsq.1 .