Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Analysis / Processing.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hello All, I am looking for a wee bit of help concerning image processing.
Right now i am having trouble using some of the basic free/shareware image processing tools, such as the libtiff (tiff / tiffio) file types, or anything else of the like, which would eventually let me read a .tif file as a multidimensional array of numbers (the pics are gray scaled too, which makes life much easier). Once I get this array i'll be able to work my code out, but this first step is killing me! Any suggestions are welcome!

Thanks
 
What are you having trouble with exactly? How to declare your multidimensional array? How to access its elements? How to use the library functions?

Maybe if you post a snippet of your code along with the specs for the library functions you're trying to use someone can help you.

Russ
bobbitts@hotmail.com
 
Like I said, this is the first hurdle towards solving my problem, so this code beginning is very basic. Here it is:

#include <stdio.h>
#include <tiff.h>
#include <tiffio.h>
#include <stdlib.h>
#include <ctype.h>
#define TIFFGetR(abgr) ((abgr) & 0xff)
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)

FILE tif;


int main()
{
TIFF* tif = TIFFOpen(&quot;exp.tif&quot;, &quot;r&quot;);
if (tif == NULL) {
fprintf(stderr, &quot;Cannot open exp.tif.\n&quot;);
exit (8);
}
else {
int TIFFReadRGBAImage(TIFF* tif, u_long width, u_long height,
u_long* raster, int stopOnError);
}
TIFFClose(tif);

system(&quot;PAUSE&quot;);
return 0;
}

Now, this is textbook coding, but I get the following errors when I try to compile it (well, not errors really, bloodshed says that the program compiled, but if you go to &quot;compiler results&quot; this is what it says.):

c:\windows\TEMP\ccdXtcgb.o(.text+0x41):tiff.c: undefined reference to `TIFFOpen'
c:\windows\TEMP\ccdXtcgb.o(.text+0x88):tiff.c: undefined reference to `TIFFClose'

All the libraries are in the correct location (? I think at least, the complier would otherwise give me an error to an unknown library file, and i made sure that the library file was being read by bloodshed (my compliler)), so I can't understand why the code fails to be capable of opening the tiff file.
Any help is much appreciated.
Also, any ideas on how to make a spread sheet of the pixil values (grey-scaled) would be excellent.

Thanks
 
Well, i think you have a problem with the headers :
<stdio.h> is a &quot;system&quot; header. Somehow i dont' think that tiff.h and tiffio.h are system headers.
Try including them as

Code:
#include &quot;tiff.h&quot;
#include &quot;tiffio.h&quot;

 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top