lkranker Posted May 3, 2007 Report Share Posted May 3, 2007 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) Quote Link to comment
Ton Plomp Posted May 3, 2007 Report Share Posted May 3, 2007 Hello lkranker/vwkafer, please don't crosspost (forums.ni.com). Your pictures were missing, and you should take a look at the IMAQ help for this function (I don't know it), normally the help files are rather cood. Ton Quote Link to comment
Jim Kring Posted May 3, 2007 Report Share Posted May 3, 2007 QUOTE(tcplomp @ May 1 2007, 09:54 PM) please don't crosspost (http://forums.ni.com/ni/board/message?board.id=170&message.id=245017#M245017' target="_blank">forums.ni.com). 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 Quote Link to comment
LAVA 1.0 Content Posted May 3, 2007 Report Share Posted May 3, 2007 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. Quote Link to comment
lkranker Posted May 3, 2007 Author Report Share Posted May 3, 2007 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) Quote Link to comment
LAVA 1.0 Content Posted May 3, 2007 Report Share Posted May 3, 2007 CITATION(lkranker @ May 2 2007, 12:45 PM) 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. 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 ! Quote Link to comment
lkranker Posted May 5, 2007 Author Report Share Posted May 5, 2007 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! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.