c++flycapture

Decrease in the quality of the image in flycapture


I am using flycapture sdk sample program to capture image form the flycapture. My problem is that when i capture the image using the flycapture installed application the size of image is about 1.3 - 1.5 Mb. But when the take the same image using my program which consist of flycapture sample program. The size of the image is about 340K to 500K(max).Image format is .tiff There is reduction in the quality of the image due to which my program is not able to get any valuable information form the image.

Using the following approach to save the image:

FlyCapture2::Camera camera;			
 FlyCapture2::Image image;
 camera.RetrieveBuffer(&image);
 ostringstream saveImage;
 saveImage << "Image-" << "-" << i << ".tiff";
image.Save(saveImage.str().c_str());

And using the windows application following the approach mentioned in the link: http://www.ptgrey.com/Content/Images/uploaded/FlyCapture2Help/flycapture/03demoprogram/saving%20images_flycap2.html

Please let me of any other details required


Solution

  • I am not 100% sure about this, since the documentation I found was for Java and not c++, but it is probably very similar.

    You are using :

    image.Save(saveImage.str().c_str());
    

    to save your image, but are you sure it is saved as a tiff? the documentation (the java one), doesn't go deep into this, I am not sure if it is like OpenCV's imwrite that it automatically deduces the type and does it or not. So you should check that. There was one overload that you can pass the ImageFileFormat... this should be set to the TIFF one.

    Another overload let's you specify the TIFF Options... in here you may tune it to have a different compression method. Notice that there is JPEG compression method... which would make something wayyy lighter but lossy... You may try with None, or the one that OpenCV uses LZW.