11-14-2016 09:40 AM
Matt,
It looks like this may have come up before, and the issue is that the session ID is defined for the Bayer image, so since the SaveBufferEx function is basing it off of that session ID, then we're only getting the 8 bith depth. Here's the recommended workaround
Use IMAQ Vision functions (imaqWriteFile function as well as imaqCreateImage and imaqArrayToImage) like this: 0) Add the following code in the beginning. ////////////////////// #include "nivision.h" ////////////////////// 1) Add the following code before the While state statement that includes imgBayerColorDecode ////////////////////// Image* RGBImage; RGBImage = imaqCreateImage(IMAQ_IMAGE_RGB, 0); ////////////////////// 2) Add the following code after imgBayerColorDecode ////////////////////// imaqArrayToImage (RGBImage, RGBBuffer, AcqWinWidth, AcqWinHeight); imaqWriteFile(RGBImage, "C:\\RGBImage.jpg", NULL); ////////////////////// 3) Add the following code after the While statement that includes imgBayerColorDecode (before return 0;) ////////////////////// imaqDispose (RGBImage); //////////////////////
11-15-2016 12:24 PM
Ty P,
I don't have nivision.h on my computer. Is it part of the IMAQ Vision Library that I don't have either?
R,
Matt
11-16-2016 02:15 PM
Matt,
If you have the vision acquisition software installed on your computer, then the nivision.h should be located at:
C:\Program Files (x86)\National Instruments\Vision\Include
If you don't, go ahead and download + install it from:
http://www.ni.com/download/ni-vision-acquisition-software-february-2016/5801/en/
11-17-2016 02:58 PM
Ty P,
Ok I found the file and the work around you supplied works great! Thanks for all your help!
R,
Matt