Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-m.b-one.net (mx-m.one.com [91.198.169.60])
	by mail9.b-one.net (Postfix) with ESMTP id A645440080A
	for <info@awaresystems.be>; Fri,  5 Mar 2010 20:49:15 +0100 (CET)
Received: by mx-m.b-one.net (Postfix, from userid 106)
	id 9D5962AF5BD3; Fri,  5 Mar 2010 20:49:15 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0.001
X-Spam-Level: 
X-Spam-Status: No, score=0.001 tagged_above=0 required=4
 tests=[HTML_MESSAGE=0.001]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-m.b-one.net (Postfix) with ESMTP id 2CA122AF5BC1 for
 <info@awaresystems.be>; Fri,  5 Mar 2010 20:49:14 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id B0BF31D0E5298; Fri,  5 Mar 2010
 14:47:29 -0500 (EST)
Received: from homiemail-a4.g.dreamhost.com (caiajhbdccah.dreamhost.com
 [208.97.132.207]) by lists.maptools.org (Postfix) with ESMTP id 15ED41D4CC752
 for <tiff@lists.maptools.org>; Fri,  5 Mar 2010 13:50:58 -0500 (EST)
Received: from [192.168.0.29] (adsl-99-41-51-203.dsl.pltn13.sbcglobal.net
 [99.41.51.203]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No
 client certificate requested) by homiemail-a4.g.dreamhost.com (Postfix) with
 ESMTP id B3460418CB; Fri,  5 Mar 2010 10:50:48 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1077)
From: Larry Gritz <lg@larrygritz.com>
In-Reply-To: <7b8dc8a61003050830p11e94286j9f0578efa1db120d@mail.gmail.com>
Date: Fri, 5 Mar 2010 10:50:47 -0800
Message-Id: <EA03D5F2-59CA-4F7A-8136-B4A7BBD60EC7@larrygritz.com>
References: <AcqpXL8+AwuqhKweTnmRcD0ppsEkcA==>
 <043A2251497417458673CD21741F2F84064CFC@VF-MBX30.internal.vodafone.com>
 <7b8dc8a61003050830p11e94286j9f0578efa1db120d@mail.gmail.com>
To: Deborah <debita@gmail.com>
X-Mailer: Apple Mail (2.1077)
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] Tiffs
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1903841351=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org


--===============1903841351==
Content-Type: multipart/alternative; boundary=Apple-Mail-393--402445153


--Apple-Mail-393--402445153
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

I'll answer your question in a separate email (and CC the OIIO dev =
list).  No reason to have it on the TIFF list.

	-- lg


On Mar 5, 2010, at 8:30 AM, Deborah wrote:

> Hi Larry,
>=20
> I don't remember if I thanked you for your comments on my problem.
>=20
> As you adviced me I'm trying to use OpenImageIO.=20
>=20
> This is the code I have so far:
>=20
> #include <imageio.h>
> using namespace OpenImageIO;
> #include <fftw3.h>
>=20
> int main (int argc, char *argv[])
> {
>     ImageInput *Recibida =3D ImageInput::create (argv[1]);
>     ImageInput *Original =3D ImageInput::create (argv[2]);
>=20
>     ImageSpec specRecibida;
>     ImageSpec specOriginal;
>=20
>     Recibida->open (argv[1], specRecibida);
>     Original->open (argv[2], specOriginal);
>=20
>     int width =3D specOriginal.width;
>     int height =3D specOriginal.height;
>=20
>     fftw_complex *imgRecibida =3D ( fftw_complex* =
)fftw_malloc(sizeof(fftw_complex) * width * height);=20
>     fftw_complex *imgOriginal =3D ( fftw_complex* =
)fftw_malloc(sizeof(fftw_complex) * width * height);=20
>     fftw_complex *imgResultado =3D ( fftw_complex* =
)fftw_malloc(sizeof(fftw_complex) * width * height);
>=20
>     fftw_plan fft_imgRecibida =3D fftw_plan_dft_1d( width * height, =
imgRecibida, imgRecibida, FFTW_FORWARD,  FFTW_ESTIMATE );
>     fftw_plan fft_imgOriginal =3D fftw_plan_dft_1d( width * height, =
imgOriginal, imgOriginal, FFTW_FORWARD,  FFTW_ESTIMATE );
>     fftw_plan ifft_Resultado =3D fftw_plan_dft_1d( width * height, =
imgResultado,  imgResultado,  FFTW_BACKWARD, FFTW_ESTIMATE );
>=20
> unsigned char *pixelsRecibida, *pixelsOriginal;
>     Recibida->read_image (TypeDesc::DOUBLE, pixelsRecibida, =
2*sizeof(double));=20
>     Original->read_image (TypeDesc::DOUBLE, pixelsOriginal, =
2*sizeof(double));
>=20
>   for(int k =3D 0 ; k < width * height ; k++ ) {
>         imgRecibida[k][0] =3D pixelsRecibida[k];           =20
>         imgRecibida[k][1] =3D 0.0;
>        =20
>         imgOriginal[k][0] =3D pixelsOriginal[k];
>         imgOriginal[k][1] =3D 0.0;
>     }
>=20
>=20
>     fftw_execute( fft_imgRecibida );
>     fftw_execute( fft_imgOriginal );
>=20
>     return 0;
> }
>=20
> I'm trying to do two autocorrelations, as you can see, of two images. =
One is an image received via Fax and the other one is the original image =
(the one that was sent).=20
>=20
> When I read the image with read_image, I want this image to be read =
into imgRecibida (and the other image in imgOriginal). They are pointers =
to=20
>  typedef double fftw_complex[2];
>=20
> I don't understand what is the x stride, or why in your example you =
said 2*sizeof(double), I tried reading the OpenImageIO documentation but =
still can't get the meaning... I suppose this is because I'm not really =
familiar with image processing and also because my native language isn't =
English, so maybe I'm missing some important point. Shouldn't it be =
specRecibida.nchannels * something, AutoStride ? or something like that?
>=20
> Do you have any other comment that could help me?=20
>=20
> Thanks again and I'm sorry if I'm bothering you.
>=20
> Deborah
>=20
> ---------- Mensaje reenviado ----------
> From: "Larry Gritz" <lg@larrygritz.com>
> To: <tiff@lists.maptools.org>
> Date: Mon, 8 Feb 2010 18:43:23 +0100
> Subject: [Tiff] OpenImageIO; was Re: fftw and TIFF files
> I'll take this opportunity to point people to another open source =
project I'm administering: http://www.openimageio.org
>=20
> OpenImageIO (OIIO for short) is a format-agnostic API for reading and =
writing image files.  TIFF is among many image file formats supported =
(using libtiff underneath, of course).  But even if you are only =
interested in TIFF, you may find that using OIIO's API's to read TIFF =
files is simpler and more straightforward than struggling with the raw =
libtiff calls.  There are also a lot of other useful features of the =
library, including an image tile cache that lets you literally access =
hundreds of GB of image data without worrying about which parts are in =
memory or which files are opened, and a filtered texture system.
>=20
> But the aspect of OIIO that is relevant to Debora's question is that =
the basic API for reading images automatically does format conversion =
and will read data into buffers with strides.  For example, your basic =
issue is that you want to read data from a TIFF file (perhaps with =
arbitrary bit depth) into a buffer of double[2], but you want the pixel =
values to end up in every other buffer slot.  Piece of cake.  You can do =
it with about 7 lines of code:
>=20
>         ImageInput *in =3D ImageInput::create (filename);
>         ImageSpec spec;
>         in->open (filename, spec); /* res is now in =
spec.{width,height} */
>         fftw_complex *img1 =3D fftw_malloc(sizeof(fftw_complex) * =
spec.width * spec.height);
>         memset (img1, 0, sizeof(fftw_complex) * spec.width * =
spec.height);  // zero it out
>         in->read_image (TypeDesc::DOUBLE /* desired data format */,
>                         pixels /* buffer */,
>                         2*sizeof(double) /* optional: x stride */);
>         in->close ();
>         delete in;
>=20
> This will work for scanline or tiled images, any bit depth with proper =
conversion to double, etc.  (Though as I've written it, the code assumes =
a single data channel. To be robust, it should check spec.nchannels =
before proceeding with the read_image.)  Also, if you had the need to =
read other file formats, this code would not need to be modified, as =
long as it's a file format that OIIO understands or can find a plugin =
for.
>=20
> I hope you are using C++.  If it's straight C, never mind.
>=20
>         -- lg
>=20
>=20
> On Feb 8, 2010, at 8:48 AM, tiff-request@lists.maptools.org wrote:
>=20
> > =
----------------------------------------------------------------------
> >
> > Date: Mon, 8 Feb 2010 11:47:27 +0100
> > From: "Gil, Debora, VF-ES (dgilalv) STU" <debora.gil@vodafone.com>
> > Subject: [Tiff] fftw and TIFF files
> > To: <tiff@lists.maptools.org>
> >
> > Hi,
> >
> > I'm trying to do the phase correlation of two TIFF images (a =
reference
> > image and an image received via fax) to determine if they are =
similar
> > and or have any offset.
> >
> > For this I'm using LibTIFF and FFTW. In order to do this I need to =
load
> > the Image data to the FFTW input arrays:
> >
> > fftw_complex *img1 =3D ( fftw_complex* )fftw_malloc( sizeof( =
fftw_complex
> > ) * width * height ); <- this is the input array (it's a double[2]
> > composed of the real and imaginary parts of a complex number)
> >
> > As I said, what I need to do is load the image data on that input =
array.
> > I would like to do something like this:
> >
> > for( i =3D 0; i < height ; i++ ) {
> >    for( j =3D 0 ; j < width ; j++) {
> >        img1[k][0] =3D <- here goes the image data
> >        img1[k][1] =3D 0.0;
> >    }
> > }
> >
> > This kind of thing is what I've seen in an OpenCV example for =
reading
> > TIFF images, but it doesn't seem to work so I decided to try with
> > LibTIFF.
> >
> > Thanks in advance,
> >
> > Debora
> >
>=20
> --
> Larry Gritz
> lg@larrygritz.com
>=20
>=20
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/
>=20
>=20
>=20
> ---------- Mensaje reenviado ----------
> From: "Bob Friesenhahn" <bfriesen@simple.dallas.tx.us>
> To: "Gil, Debora, VF-ES (dgilalv) STU" <debora.gil@vodafone.com>
> Date: Mon, 8 Feb 2010 17:48:31 +0100
> Subject: Re: [Tiff] fftw and TIFF files
> On Mon, 8 Feb 2010, Gil, Debora, VF-ES (dgilalv) STU wrote:
>=20
> > I=CA=BCm trying to do the phase correlation of two TIFF images (a =
reference image and an image received
> > via fax) to determine if they are similar and or have any offset.
>=20
> Hi Debora,
>=20
> Thanks for introducing yourself and the problem you want to solve.  We
> did receive your email.  Your email was not formulated as a simple
> question that any of us can answer.
>=20
> Unless you are willing to perform a lot of libtiff-specific work to
> read images, then I suggest using an existing library on top of
> libtiff which simplifies the task for you, and allows using other
> image file formats as well.
>=20
> It may be that OpenCV is the ideal library for you and that you will
> achieve more success from discussing the issue with OpenCV developers.
>=20
> Bob
> --
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, =
http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>=20
>=20
>=20
>=20
>=20
> --=20
> D=C3=A9borah

--
Larry Gritz
lg@larrygritz.com



--Apple-Mail-393--402445153
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'll =
answer your question in a separate email (and CC the OIIO dev list). =
&nbsp;No reason to have it on the TIFF list.<div><br></div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>-- =
lg</div><div><br></div><div><br><div><div>On Mar 5, 2010, at 8:30 AM, =
Deborah wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><div class=3D"gmail_quote"><div>Hi Larry,<br><br>I don't =
remember if I thanked you for your comments on my problem.<br><br>As you =
adviced me I'm trying to use OpenImageIO. <br><br>This is the code I =
have so far:<br><br>
#include &lt;imageio.h&gt;<br>using namespace OpenImageIO;<br>#include =
&lt;fftw3.h&gt;<br><br>int main (int argc, char =
*argv[])<br>{<br>&nbsp;&nbsp;&nbsp; ImageInput *Recibida =3D =
ImageInput::create (argv[1]);<br>&nbsp;&nbsp;&nbsp; ImageInput *Original =
=3D ImageInput::create (argv[2]);<br>
<br>&nbsp;&nbsp;&nbsp; ImageSpec specRecibida;<br>&nbsp;&nbsp;&nbsp; =
ImageSpec specOriginal;<br><br>&nbsp;&nbsp;&nbsp; Recibida-&gt;open =
(argv[1], specRecibida);<br>&nbsp;&nbsp;&nbsp; Original-&gt;open =
(argv[2], specOriginal);<br><br>&nbsp;&nbsp;&nbsp; int width =3D =
specOriginal.width;<br>&nbsp;&nbsp;&nbsp; int height =3D =
specOriginal.height;<br>
<br>&nbsp;&nbsp;&nbsp; fftw_complex *imgRecibida =3D ( fftw_complex* =
)fftw_malloc(sizeof(fftw_complex) * width * height); =
<br>&nbsp;&nbsp;&nbsp; fftw_complex *imgOriginal =3D ( fftw_complex* =
)fftw_malloc(sizeof(fftw_complex) * width * height); =
<br>&nbsp;&nbsp;&nbsp; fftw_complex *imgResultado =3D ( fftw_complex* =
)fftw_malloc(sizeof(fftw_complex) * width * height);<br>
<br>&nbsp;&nbsp;&nbsp; fftw_plan fft_imgRecibida =3D fftw_plan_dft_1d( =
width * height, imgRecibida, imgRecibida, FFTW_FORWARD,&nbsp; =
FFTW_ESTIMATE );<br>&nbsp;&nbsp;&nbsp; fftw_plan fft_imgOriginal =3D =
fftw_plan_dft_1d( width * height, imgOriginal, imgOriginal, =
FFTW_FORWARD,&nbsp; FFTW_ESTIMATE );<br>
&nbsp;&nbsp;&nbsp; fftw_plan ifft_Resultado =3D fftw_plan_dft_1d( width =
* height, imgResultado,&nbsp; imgResultado,&nbsp; FFTW_BACKWARD, =
FFTW_ESTIMATE );<br><br>unsigned char *pixelsRecibida, =
*pixelsOriginal;<br>&nbsp;&nbsp;&nbsp; Recibida-&gt;read_image =
(TypeDesc::DOUBLE, pixelsRecibida, 2*sizeof(double)); <br>
&nbsp;&nbsp;&nbsp; Original-&gt;read_image (TypeDesc::DOUBLE, =
pixelsOriginal, 2*sizeof(double));<br><b><br>&nbsp; for(int k =3D 0 ; k =
&lt; width * height ; k++ ) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
imgRecibida[k][0] =3D pixelsRecibida[k];&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; imgRecibida[k][1] =3D 0.0;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; imgOriginal[k][0] =3D =
pixelsOriginal[k];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
imgOriginal[k][1] =3D 0.0;<br>&nbsp;&nbsp;&nbsp; =
}<br></b><br><br>&nbsp;&nbsp;&nbsp; fftw_execute( fft_imgRecibida =
);<br>&nbsp;&nbsp;&nbsp; fftw_execute( fft_imgOriginal =
);<br><br>&nbsp;&nbsp;&nbsp; return 0;<br>}<br>
<br>I'm trying to do two autocorrelations, as you can see, of two =
images. One is an image received via Fax and the other one is the =
original image (the one that was sent). <br><br>When I read the image =
with read_image, I want this image to be read into imgRecibida (and the =
other image in imgOriginal). They are pointers to <br>
<pre class=3D"example"> typedef double fftw_complex[2];<br></pre><br>I =
don't understand what is the x stride, or why in your example you said =
2*sizeof(double), I tried reading the OpenImageIO documentation but =
still can't get the meaning... I suppose this is because I'm not really =
familiar with image processing and also because my native language isn't =
English, so maybe I'm missing some important point. Shouldn't it be =
specRecibida.nchannels * something, AutoStride ? or something like =
that?<br>
<br>Do you have any other comment that could help me? <br><br>Thanks =
again and I'm sorry if I'm bothering =
you.<br><br>Deborah<br><br></div><blockquote class=3D"gmail_quote" =
style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt =
0.8ex; padding-left: 1ex;">
---------- Mensaje reenviado ----------<br>From:&nbsp;"Larry Gritz" =
&lt;<a =
href=3D"mailto:lg@larrygritz.com">lg@larrygritz.com</a>&gt;<br>To:&nbsp;&l=
t;<a =
href=3D"mailto:tiff@lists.maptools.org">tiff@lists.maptools.org</a>&gt;<br=
>
Date:&nbsp;Mon, 8 Feb 2010 18:43:23 +0100<br>Subject:&nbsp;[Tiff] =
OpenImageIO; was Re: fftw and TIFF files<br>






<div><p><font size=3D"2">I'll take this opportunity to point people to =
another open source project I'm administering: <a =
href=3D"http://www.openimageio.org/" =
target=3D"_blank">http://www.openimageio.org</a><br>
<br>
OpenImageIO (OIIO for short) is a format-agnostic API for reading and =
writing image files.&nbsp; TIFF is among many image file formats =
supported (using libtiff underneath, of course).&nbsp; But even if you =
are only interested in TIFF, you may find that using OIIO's API's to =
read TIFF files is simpler and more straightforward than struggling with =
the raw libtiff calls.&nbsp; There are also a lot of other useful =
features of the library, including an image tile cache that lets you =
literally access hundreds of GB of image data without worrying about =
which parts are in memory or which files are opened, and a filtered =
texture system.<br>

<br>
But the aspect of OIIO that is relevant to Debora's question is that the =
basic API for reading images automatically does format conversion and =
will read data into buffers with strides.&nbsp; For example, your basic =
issue is that you want to read data from a TIFF file (perhaps with =
arbitrary bit depth) into a buffer of double[2], but you want the pixel =
values to end up in every other buffer slot.&nbsp; Piece of cake.&nbsp; =
You can do it with about 7 lines of code:<br>

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageInput *in =3D =
ImageInput::create (filename);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageSpec spec;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in-&gt;open (filename, spec); =
/* res is now in spec.{width,height} */<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fftw_complex *img1 =3D =
fftw_malloc(sizeof(fftw_complex) * spec.width * spec.height);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memset (img1, 0, =
sizeof(fftw_complex) * spec.width * spec.height);&nbsp; // zero it =
out<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in-&gt;read_image =
(TypeDesc::DOUBLE /* desired data format */,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pixels /* buffer */,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2*sizeof(double) /* optional: =
x stride */);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in-&gt;close ();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete in;<br>
<br>
This will work for scanline or tiled images, any bit depth with proper =
conversion to double, etc.&nbsp; (Though as I've written it, the code =
assumes a single data channel. To be robust, it should check =
spec.nchannels before proceeding with the read_image.)&nbsp; Also, if =
you had the need to read other file formats, this code would not need to =
be modified, as long as it's a file format that OIIO understands or can =
find a plugin for.<br>

<br>
I hope you are using C++.&nbsp; If it's straight C, never mind.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- lg<br>
<br>
<br>
On Feb 8, 2010, at 8:48 AM, <a =
href=3D"mailto:tiff-request@lists.maptools.org" =
target=3D"_blank">tiff-request@lists.maptools.org</a> wrote:<br>
<br>
&gt; =
----------------------------------------------------------------------<br>=

&gt;<br>
&gt; Date: Mon, 8 Feb 2010 11:47:27 +0100<br>
&gt; From: "Gil, Debora, VF-ES (dgilalv) STU" &lt;<a =
href=3D"mailto:debora.gil@vodafone.com" =
target=3D"_blank">debora.gil@vodafone.com</a>&gt;<br>
&gt; Subject: [Tiff] fftw and TIFF files<br>
&gt; To: &lt;<a href=3D"mailto:tiff@lists.maptools.org" =
target=3D"_blank">tiff@lists.maptools.org</a>&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I'm trying to do the phase correlation of two TIFF images (a =
reference<br>
&gt; image and an image received via fax) to determine if they are =
similar<br>
&gt; and or have any offset.<br>
&gt;<br>
&gt; For this I'm using LibTIFF and FFTW. In order to do this I need to =
load<br>
&gt; the Image data to the FFTW input arrays:<br>
&gt;<br>
&gt; fftw_complex *img1 =3D ( fftw_complex* )fftw_malloc( sizeof( =
fftw_complex<br>
&gt; ) * width * height ); &lt;- this is the input array (it's a =
double[2]<br>
&gt; composed of the real and imaginary parts of a complex number)<br>
&gt;<br>
&gt; As I said, what I need to do is load the image data on that input =
array.<br>
&gt; I would like to do something like this:<br>
&gt;<br>
&gt; for( i =3D 0; i &lt; height ; i++ ) {<br>
&gt;&nbsp;&nbsp;&nbsp; for( j =3D 0 ; j &lt; width ; j++) {<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; img1[k][0] =3D &lt;- here =
goes the image data<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; img1[k][1] =3D 0.0;<br>
&gt;&nbsp;&nbsp;&nbsp; }<br>
&gt; }<br>
&gt;<br>
&gt; This kind of thing is what I've seen in an OpenCV example for =
reading<br>
&gt; TIFF images, but it doesn't seem to work so I decided to try =
with<br>
&gt; LibTIFF.<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt; Debora<br>
&gt;<br>
<br>
--<br>
Larry Gritz<br>
<a href=3D"mailto:lg@larrygritz.com" =
target=3D"_blank">lg@larrygritz.com</a><br>
<br>
<br>
_______________________________________________<br>
Tiff mailing list: <a href=3D"mailto:Tiff@lists.maptools.org" =
target=3D"_blank">Tiff@lists.maptools.org</a><br>
<a href=3D"http://lists.maptools.org/mailman/listinfo/tiff" =
target=3D"_blank">http://lists.maptools.org/mailman/listinfo/tiff</a><br>
<a href=3D"http://www.remotesensing.org/libtiff/" =
target=3D"_blank">http://www.remotesensing.org/libtiff/</a><br>
</font>
</p>

</div>
<br><br>---------- Mensaje reenviado ----------<br>From:&nbsp;"Bob =
Friesenhahn" &lt;<a =
href=3D"mailto:bfriesen@simple.dallas.tx.us">bfriesen@simple.dallas.tx.us<=
/a>&gt;<br>To:&nbsp;"Gil, Debora, VF-ES (dgilalv) STU" &lt;<a =
href=3D"mailto:debora.gil@vodafone.com">debora.gil@vodafone.com</a>&gt;<br=
>
Date:&nbsp;Mon, 8 Feb 2010 17:48:31 +0100<br>Subject:&nbsp;Re: [Tiff] =
fftw and TIFF files<br>






<div><p><font size=3D"2">On Mon, 8 Feb 2010, Gil, Debora, VF-ES =
(dgilalv) STU wrote:<br>
<br>
&gt; I=CA=BCm trying to do the phase correlation of two TIFF images (a =
reference image and an image received<br>
&gt; via fax) to determine if they are similar and or have any =
offset.<br>
<br>
Hi Debora,<br>
<br>
Thanks for introducing yourself and the problem you want to solve.&nbsp; =
We<br>
did receive your email.&nbsp; Your email was not formulated as a =
simple<br>
question that any of us can answer.<br>
<br>
Unless you are willing to perform a lot of libtiff-specific work to<br>
read images, then I suggest using an existing library on top of<br>
libtiff which simplifies the task for you, and allows using other<br>
image file formats as well.<br>
<br>
It may be that OpenCV is the ideal library for you and that you will<br>
achieve more success from discussing the issue with OpenCV =
developers.<br>
<br>
Bob<br>
--<br>
Bob Friesenhahn<br>
<a href=3D"mailto:bfriesen@simple.dallas.tx.us" =
target=3D"_blank">bfriesen@simple.dallas.tx.us</a>, <a =
href=3D"http://www.simplesystems.org/users/bfriesen/" =
target=3D"_blank">http://www.simplesystems.org/users/bfriesen/</a><br>
GraphicsMagick Maintainer,&nbsp;&nbsp;&nbsp; <a =
href=3D"http://www.GraphicsMagick.org/" =
target=3D"_blank">http://www.GraphicsMagick.org/</a><br>
</font>
</p>

</div>
<br></blockquote></div><br><br clear=3D"all"><br>-- <br>D=C3=A9borah<br>
</blockquote></div><br><div>
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
auto; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; ">--<br>Larry Gritz<br><a =
href=3D"mailto:lg@larrygritz.com">lg@larrygritz.com</a><br><br></span>
</div>
<br></div></body></html>=

--Apple-Mail-393--402445153--

--===============1903841351==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============1903841351==--
