#222 can't load images

open
nobody
5
2009-05-10
2009-05-10
Anonymous
No

trying to load images with Load(imageFileName, img) always returns false. when run in verbose mode the error says: "Couldn't find format for..." no matter what the image format is, have tried with jpeg, png, ppm, tiff. linking with both RavlImageIO and RavlExtImgIO or just with one of them. i'm under linux.

Discussion

  • Are you using QMake ? If you are this really should work, and could you add the output of 'qm info' to the bug report.

    If your not then you also have to link

    $(RAVL_INSTALL)/lib/RAVL/$(ARC)/obj/ExtImgIO.o

    and

    $(RAVL_INSTALL)/lib/RAVL/$(ARC)/obj/RavlImgIO.o

    directly into your executable to ensure all the file formats are registered. Alternately use the shared version of the libraries, which has the same effect.

     
  • thanks for super fast answer.

    no, i'm not using qmake, has tried, but got some errors. anyway i've tried adding the .o files and i get this errors:

    ExtImgIO.cc:(.text+0x5): undefined reference to `RavlImageN::InitJPEGCompressConv()'
    ExtImgIO.cc:(.text+0xa): undefined reference to `RavlImageN::InitTIFFFormat()'
    ExtImgIO.cc:(.text+0xf): undefined reference to `RavlImageN::InitJPEGFormat()'
    ExtImgIO.cc:(.text+0x18): undefined reference to `RavlImageN::InitPNGFormat()'
    /home/art/RavlProject/lib/RAVL/linux64/obj/RavlImgIO.o: In function `RavlImageN::InitDPImageIO()':
    RavlImgIO.cc:(.text+0x5): undefined reference to `RavlImageN::InitStdImageCnv()'
    RavlImgIO.cc:(.text+0xa): undefined reference to `RavlImageN::InitStdImageCnv2()'
    RavlImgIO.cc:(.text+0xf): undefined reference to `RavlImageN::InitStdImageCnv3()'
    RavlImgIO.cc:(.text+0x19): undefined reference to `RavlImageN::InitStdImageCnv4()'
    RavlImgIO.cc:(.text+0x21): undefined reference to `RavlImageN::InitStdImageCnv5()'
    RavlImgIO.cc:(.text+0x29): undefined reference to `RavlImageN::InitPNMFormat()'
    RavlImgIO.cc:(.text+0x31): undefined reference to `RavlImageN::InitImgIOInt()'
    RavlImgIO.cc:(.text+0x39): undefined reference to `RavlImageN::InitImgIOByte()'
    RavlImgIO.cc:(.text+0x41): undefined reference to `RavlImageN::InitImgIOReal()'
    RavlImgIO.cc:(.text+0x49): undefined reference to `RavlImageN::InitImgIOUInt16()'
    RavlImgIO.cc:(.text+0x51): undefined reference to `RavlImageN::InitImgIOFloat()'
    RavlImgIO.cc:(.text+0x59): undefined reference to `RavlImageN::InitImgIOByteRGB()'
    RavlImgIO.cc:(.text+0x61): undefined reference to `RavlImageN::InitImgIORealRGB()'
    RavlImgIO.cc:(.text+0x69): undefined reference to `RavlImageN::InitImgIOByteYUV()'
    RavlImgIO.cc:(.text+0x71): undefined reference to `RavlImageN::InitImgIORealYUV()'
    RavlImgIO.cc:(.text+0x79): undefined reference to `RavlImageN::InitImgIOByteYUV422()'
    RavlImgIO.cc:(.text+0x81): undefined reference to `RavlImageN::InitImgIOByteVYU()'
    RavlImgIO.cc:(.text+0x89): undefined reference to `RavlImageN::InitImgIOUInt16RGB()'
    RavlImgIO.cc:(.text+0x91): undefined reference to `RavlImageN::InitImgIOByteRGBA()'
    RavlImgIO.cc:(.text+0x99): undefined reference to `RavlImageN::InitImgIORealRGBA()'
    RavlImgIO.cc:(.text+0xa1): undefined reference to `RavlImageN::InitRGBImageCnv()'
    RavlImgIO.cc:(.text+0xa9): undefined reference to `RavlImageN::InitImgIOByteYCbCrBT601Value()'
    RavlImgIO.cc:(.text+0xb1): undefined reference to `RavlImageN::InitImgIOUInt16YCbCrBT601Value()'
    RavlImgIO.cc:(.text+0xb9): undefined reference to `RavlImageN::InitImgIOYCbCrBT601ValueFloat()'
    RavlImgIO.cc:(.text+0xc2): undefined reference to `RavlImageN::InitImgIOByteYCbCr422BT601()'

    can it have something to do that i'm using the version in the svn? i'm having also some undefined references when trying to use the image conversion functions:

    ImageConv.cc:(.text+0x108): undefined reference to `RavlBaseVectorN::g_Real2ByteD'
    ImageConv.cc:(.text+0x15f): undefined reference to `RavlBaseVectorN::g_Real2ByteD'

    has just tried to compile the latest stable version in sourceforge but gcc crashes! after lots of obsolete char* to const char* warnings

    thanks

     
  • I, too had problem loading images using the Load(imageFileName, img) method, which always returns faulse. I solved the problem by instead using the ImageC(UIntT rows,UIntT cols,PixelT *data,bool deletable = true) constructor to load an image. Syntax is as follows:

    ImageC<ByteT> img ((UIntT) nrow, (UIntT) ncol, ptr, true);

    and ptr points to the memory location where the image is loaded into using your trusty image loader. I chose the pgm loader which is part of the KL Tracker downloaded from http://www.ces.clemson.edu/~stb/klt/installation.html