08-04-2008 12:51 PM
08-04-2008 02:22 PM
Some cameras or hardware have the ability to reduce the resolution of the image. This can be called binning or scaling usually. The factors are usually 1/2, 1/4, etc.
If your hardware won't do it, you can do it pretty easily using the NI Vision module. Use IMAQ Extract and set the X and Y step to 2. This will reduce the resolution to 320x240.
Bruce
08-04-2008 03:16 PM
Thanks for your quick and much awaited reply! Is there a way to call a function using the NI Vision Library to do the 'scaling down'? I am using Visual Studio C++/C# as my development tool.
Thanks so much.
08-04-2008 04:17 PM
You can do it from C, but I don't know the function names. You would have to read through the Vision manual to find them.
Bruce
08-04-2008 04:50 PM
Thank you again. I tried to search for the manual but the best i got is the 'NI Vision Concepts Manual'. Is there a more thorough manual that describes the functions/gives code examples. If there is one! I would appreciate a link to it![]()
Thanks...
08-04-2008 05:46 PM - edited 08-04-2008 05:49 PM
08-06-2008 11:57 AM
Hi!
I wanted to get more details about how to use imaqResample() with regards to the problem below:
I have a camera that streams images of resolution 640x480. I wanted to know if there is a way of scaling down the image to 320x240. How do I use this function or another to do this.
Thank you so much.
08-07-2008 10:36 AM
08-07-2008 11:18 PM - edited 08-07-2008 11:22 PM
I saw imaqScale. But the problem is that the first 2 parameters require an image type and not an array. I am using the 'HL Grab' project provided by NI which uses an array:
static
char *ImaqBuffer=NULL;// acquisiton bufferstatic
IplImage *image = 0; // Let NI-IMAQ manage the memoryImaqBuffer = NULL;
imgGrab(Sid, (
void **)&ImaqBuffer, TRUE);_size.height = AcqWinHeight;
_size.width = AcqWinWidth;
image = cvCreateImage( _size, IPL_DEPTH_8U, 4 );
image->imageData = ImaqBuffer;
So, I need to first convert this into an image type and then pass the image to be scaled. Can you show me how i can do this? Thank you so much.
08-08-2008 05:05 AM
I'm not an expert in C++, but to implement that in C#, just place sermi colon (;) to terminate the command ![]()
does this help?