Jump to content

exporting image in tif format


Recommended Posts

I have written a vi that currently acquires data from a camera. The image steams in continuously in 16bit. I have a case structure that snaps the image and exports a single frame of the streaming image to a tif format using "IMAQ Write TIFF file". The tif file that results however is extremely low contrast. I am guessing that I need a conversion before exporting to tif, but I am unsure how to implement that. I am considering using "IMAQ Cast Image". Is there a better way? I don't necessarily need to use tif, so if there is another better method, I would be open to suggestions. If I do need to use cast image does anyone have recommendations for "# shifts" or "image type" that would work well for tiff?

Any and all suggestions would be greatly appreciated!!!

(Cast Image is shown in the pic)

Link to comment

QUOTE(tcplomp @ May 1 2007, 09:54 PM)

What I think Ton means is that, if you cross post, please state that you have cross-posted your question and put a link to the other (cross) post so that people here will know if your question has been sufficiently answered in another forum.

Thanks,

-Jim

Link to comment

CITATION(lkranker @ May 2 2007, 05:47 AM)

I have written a vi that currently acquires data from a camera. The image steams in continuously in 16bit. I have a case structure that snaps the image and exports a single frame of the streaming image to a tif format using "IMAQ Write TIFF file". The tif file that results however is extremely low contrast. I am guessing that I need a conversion before exporting to tif, but I am unsure how to implement that. I am considering using "IMAQ Cast Image". Is there a better way? I don't necessarily need to use tif, so if there is another better method, I would be open to suggestions. If I do need to use cast image does anyone have recommendations for "# shifts" or "image type" that would work well for tiff?

Any and all suggestions would be greatly appreciated!!!

(Cast Image is shown in the pic)

Hi,

What do you mean by "extremely low contrast" ? Could you post an image ?

Before trying to enhance you image through the soft, maybe you could try to put some more light on the object you taking pictures of. Also, if the image is too dark you can increase the exposure time. By the way, what camera are you using an d how did you set it up ?

You can also check that you images are really 16bit using the IMAQ histogram, depending on the camera file (*.icd) you are using (you can select it in MAX) you could be saving an 8bit image into 16bit TIFF...

Hope these thoughts will help.

Link to comment

Thank you for the quick responses. I apologize for crossposting. I am new and I must have missed the option when I posted and wasn’t aware that I did. I will be more careful in the future.

The camera I am using is a Q-Imaging Retiga EXi which is a digital CCD camera which mounts on a microscope for live cell imaging. The streaming image to the front panel has great contrast/brightness/resolution, so I am pretty sure that the settings on the camera/microscope are correct for my purposes. The problem seems to occur only when I export.

The image type is Grayscale I16 if that helps (before I export). When I do a histogram of the image the values are between 0 and 4095. I did not test this using MAX as I am not sure how to do that.

I have now discovered that if I export to PNG instead of TIF, the contrast is perfect (exactly as in the streaming image). Does that help with understanding my problem? Unfortunately, PNG is one of the few image types that my post-processing software won’t open. I know I can convert it from PNG to TIF using other software (ex MATLAB), but I would rather just export to something besides PNG in the first place.

oops...I forgot to attach the sample file inputs. For whatever reason it would not allow me to attach the tif format file. Therefore, I have attached two png files.

test.png = an unaltered image exported directly from my vi

test2.png = the tif file being exported (only converted into a png, but with low contrast maintained)

Link to comment

CITATION(lkranker @ May 2 2007, 12:45 PM)

From 0 to 4095, this is 12bit resolution, if you check the NI camera advisor, you'll see that you can't get more than 12 bit resolution (http://sine.ni.com/apps/we/nipc.specs?action=view_specs&asid=1102&pid=6843&tier=3)

CITATION(lkranker @ May 2 2007, 12:45 PM)

I have now discovered that if I export to PNG instead of TIF, the contrast is perfect (exactly as in the streaming image). Does that help with understanding my problem? Unfortunately, PNG is one of the few image types that my post-processing software won't open. I know I can convert it from PNG to TIF using other software (ex MATLAB), but I would rather just export to something besides PNG in the first place.

This is surprising... I never noticed such issue.

I'll try to test this and let you know... at least now you have a work-around.

Edit :

Hmmm, after having a closer look to your images, my best guess is that the issue is a byte inversion (little endian / big endian) I bet that the "save TIFF image" function has a setting for this !

Link to comment

I have decided to save as an 8-bit image instead of trying to achieve 16bit resolution. The contrast exports perfectly in tif, jpg, and png. I guess I am losing some resolution, but it is still satisfactory for my purposes. The Cast Image did eventually accomplish this purpose, though I was able to do it through a sub vi specific to my application.

Thank you to everyone who helped me figure out what was going on and pointed me in the right direction!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.