Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

rgb24 to rgb32 conversion using VDM in C++

Hi,

my task is to display/process images acquired from a USB camera using the VDM 8.5, in MSVC++ 2008.

 

I'm using an ActiveX server routine for snapping images from the camera (into a CBitmap object), and then I store the pixel values into an array. However, the color format of the snapped images is RGB24.

Thus, I cannot use 'imaqArrayToImage()' because VDM accepts color images with RGB32 format (i.e. RGB24 plus the Transparency channel).

 

Is there any workaround?

 

Obviously I can go through the RGB24 pixel array and copy each pixel value  into a new array that has for each pixel an extra byte (=0) for transparency, but I want to avoid this.

 

Thanks!

0 Kudos
Message 1 of 8
(5,382 Views)

Does your USB camera have a directShow interface? If so, I would recommend you try the latest version of the NI Vision Acquisition Software. The latest NI-IMAQdx driver supports acquiring images from DirectShow compliant USB devices. You can download the eval version from here:

http://joule.ni.com/nidu/cds/view/p/id/1393/lang/en

 

Christophe

0 Kudos
Message 2 of 8
(5,376 Views)

I think that the latest NI-IMAQdx driver supports USB camera acquisition only for LabView (neither CVI or VC++).

Please correct me if I'm wrong!!

0 Kudos
Message 3 of 8
(5,365 Views)

Greetings Costas,

 

I just verified that with Vision Acquisition 2009, using IMAQdx 3.4, you can acquire from a DirectShow USB camera through IMAQdx using our .NET API that installs with Vision Acquisition.  NI-IMAQdx 3.4 will see a DirectShow USB camera the same as it sees a GigE camera or a FireWire camera, so you shouldn't have any problems using IMAQdx to acquire from your DirectShow camera in any supported text-based language.

 

Let us know if you have problems doing this.

 

Take Care,

 

Evan D.
Installer R&D
National Instruments
0 Kudos
Message 4 of 8
(5,356 Views)

ok, that's perfect!

one more minor question...the .NET API is in C#.NET , C++.NET, VB.NET, any of them??

 

Thanks again!

0 Kudos
Message 5 of 8
(5,346 Views)

> one more minor question...the .NET API is in C#.NET , C++.NET, VB.NET, any of them??

 

VDM 2009 and Vision Acquisition 2009 provide a native .NET implementation (assemblies) and examples in C# .NET and VB .NET.

 

-Christophe

Message 6 of 8
(5,343 Views)

Ok, thanks a lot,

 

I guess 'VDM 2009' does not include the .NET API for acquiring from DirectShow compliant USB cameras , right?

0 Kudos
Message 7 of 8
(5,286 Views)

> I guess 'VDM 2009' does not include the .NET API for acquiring from DirectShow compliant USB cameras , right?

 

Actually, it does. The Vision Development Module package contains the image processing library API for all development languages and also contains Vision Acquisition Software,  the driver software for IMAQ devices, GigE Vision, IEEE 1394 and USB camera. Your serial number for Vision Development module should license Vision Acquisition as well.

National Instruments also give its customers the possibility to purchase Vision Acquisition software separately, for people who are just interested in displaying images, or are not using our image processing library.

 

Hope it clarifies things.

 

Best regards,


Christophe

0 Kudos
Message 8 of 8
(5,268 Views)