Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert image from usb camera to array

Hello Everyone

 

I am trying to use a USB camera and then convert the image obtained to array format so that i can have access to each pixel intensity. But when i am using IMAQ image to array, it gives error like invalid image formatThought i an see the image in image window it is just that i can not convert it to array. A little help from anyone is appreciated

 

Regards

Chauhan

Download All
0 Kudos
Message 1 of 3
(3,514 Views)

You are using a USB camera, which generates color images.  You are using ImageToArray for grayscale images, which is why the image format is not compatible.  You need to do one of two things:

 

1.  Convert your color image to a grayscale image.  IMAQ Cast is the easiest way to do this - just create a second image that is grayscale and use it as the destination.

 

2.  Use ImageToArray for color images to extract the data you need.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 3
(3,501 Views)

Thnaks

 

IMAQ cast did the work.

 

0 Kudos
Message 3 of 3
(3,489 Views)