Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in IMAQ Bayer Decode on 64 bit systems

I believe I have found a bug in the IMAQ Bayer Decode subVI that is shipped as part of the Vision Acquisition Drivers, August 2010 (NI-IMAQ 4.5).  Inside this subVI, there is a call to imaq.dll to convert a grayscale image to a color image, to pass pointers to the memory space for the source and destination image, 32 bit pointers are used in a 64 bit OS.  Obviously this is incorrect and could cause crashes if the program is working with the large amounts of memory on 64 bit systems. 

 

It is possible to work around this bug by manually changing the first two calling parameters of CLN from int32's to i64's or u64's.  Since the Map Pixel Pointer subVI returns u64's for pointers on 64 bit OS's, this CLN should probably use u64's as well.  You could wrap the CLN call in a conditional disable structure with flags for 64 or 32 bit operating environments, if you want.  I've been happy with that solution when I've needed to make code work on 64 bit and 32 bit LabVIEW.  I've tested this work around in my appliation, after I discovered the issue, and my application works fine now.  Until the bug is fixed, I'll be sticking with this solution, unless a better work around is provided in the comments below.

 

I know this may not be the best place to post this bug, but I wanted others to avoid the issues that I've faced when dealing with this bug.  Immediate crashes when calling this subVI, unmodified from the initial install were hard to track down.

 

When an NI engineer reads this, please post the CAR for future reference.

 

I've tested this with LabVIEW 2009 64 bit on Windows Vista Business 64 bit and Windows 7 Professional 64 bit.

 

Cross-posted at LAVA

Message 1 of 7
(4,396 Views)

CSD,

 

Thank you for brining this to our attention.  I will attempt to replicate this here at NI and file a CAR if appropriate.  I will update this forum with any updates or questions for you.

 

Regards,

 

Sam K

Applications Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 2 of 7
(4,363 Views)

Hi, Sam.

 

My name is Eisuke Ono, NIJ AE.

It's been a quite long time since this forum is post.

 

However, now, my customer is facing the same problem, did you reproduce the problem?

If it is done, please let me know.

 

Thank you.

 

Best regards.
Eisuke Ono
NIJ AE.

0 Kudos
Message 3 of 7
(4,016 Views)

Hi,

 

These VIs have since been replaced by the (much more capable) "IMAQ Bayer To RGB" VI on the Vision Utilities->Color Utilities palette.

 

Eric

0 Kudos
Message 4 of 7
(4,011 Views)

Hi, Eric.

 

Thank you for your reply.

My customer chose Visual C as a development environment.

same functions are available in C if the customer bought vision development module?

 

Eisuke Ono.

NIJ AE.

0 Kudos
Message 5 of 7
(4,006 Views)

Yes:

 

 (from nivision.h)

 

//============================================================================
// Bayer's_Decoding functions
//============================================================================
IMAQ_FUNC int IMAQ_STDCALL imaqBayerToRGB(const Image* srcImage, Image* dstImage, int bayerPattern, int algorithm, double blueGain, double greenGain, double redGain);

 

Also note that the legacy functions mentioned earlier (in the IMAQ palette/driver and exported in the C API as imgBayerColorDecode/imgCalculateBayerColorLUT) are also still available and never had the 64-bit API issue the LabVIEW VI did. However, the new functions are better in every way:

-Much faster, with multi-core and SSE improvements

-Supports 64-bit RGB output for >8-bit source images

-Supports multiple conversion algorithms for different trade-offs

0 Kudos
Message 6 of 7
(4,003 Views)

Hi, Eric.

 

Thank you so much.

All things are clear to me now.

 

I appreciate you very much.

 

Eisuke Ono.

0 Kudos
Message 7 of 7
(3,999 Views)