09-06-2017 07:37 PM
Dear all,
As titled, my laptop having high CPU usage when grabing image using the IMAQdx. I had attached my front panel image and program for your reference. I found that the CPU consume high usage for USB camera only as no high CPU usage if i am using my laptop integrated camera. Besides, i tried to grab the image in NI-MAX software, the usage is around 30%. I had searched the NI forum and tried to install the NI-IMAQ for USB driver as forum members told but still no improvement on the CPU usage. I need to solve this because i have to connect to 4 cameras in an application and the usage is accumulative with number of camera. My laptop just hang if i connected to 3 and above cameras simultaneously. I am appreciate if you can guide me for furher troubleshooting method.
Usage when connected to 2 cameras
Program
Usage when grabbing in NI-MAX
09-07-2017 11:27 AM
We have an application using 24 Axis IP cameras sampling 640x480 RGB images at 30 fps, all running at the same time (we have 24 "Camera Clone" routines, one per camera, acquiring the images, with the ability to select one Camera to allow us to view the Image in the Top-Level VI).
At one point, we attempted to migrate this routine to use USB cameras, and found that while the TCP/IP protocol allowed us to handle the traffic from 24 IP cameras, we couldn't run more than 2 or 3 USB cameras simultaneously. This was the case about 4 years ago -- we haven't tried again with newer cameras and newer USB hardware ...
Bob Schor
09-07-2017 07:41 PM
Maybe this is a bug for IMAQ with USB Camera. I tried to put the open/configure/close.vi inside the while loop and found that the % is reduced to below 10%. But this is not a good solution as this will keep open/close the camera periodically. Besides, my cameras have initial warm up period which it will take few seconds to focus. For this open/close solution, i only able to grab blur images. I am wondering why this happens to USB cameras only. As my laptop also have an integrated camera but the CPU usage is ok if i run that integrated camera. Maybe i had miss install some drivers?
09-08-2017 09:39 AM
You definitely want to structure your IMAQdx code as Initialize and Open Camera, Create IMAQ Buffer, While [Grab Image, Display in Buffer], Close Camera. The While Loop should contain the Grab and Display, with Open and Close outside the loop.
What happens if you run this with only one Camera? Are you "happy" with the images you see?
What is the objective? For example, do you need to simply view images, do you need to save images? Do you need to see every image (i.e. if your camera acquires at 30 FPS, can you view every 5th image)? Do you need to see images from multiple cameras at the same time, or can you have a single Display and change which Camera's Images you are viewing?
Bob Schor
09-10-2017 08:07 PM
Sorry for late reply. I tried to structure out the program that you suggested previously but i cannot found "create IMAQ buffer" & "Display in buffer" in IMAQdx function.
The objective i wanna do this is to embedded CCTV function inside my application. So i need to display every images. 5seconds delay time is ok for me to display out the images. However, although i had set the delay time to 10seconds, the CPU is reduced a little bit only. As my integrated camera runs ok so i thought maybe i had miss to install some USB drivers.
I think i can do like what you had suggested. Display a single camera only in a time so that the CPU usage wont accumulated.
09-11-2017 09:14 AM
Here is a Snippet of what I was saying, along with where you should find the Functions if you have IMAQdx and the Vision Software installed and licensed. Note that Vision requires an additional license -- if you don't see some of the functions listed when you look in the Vision Palette, this might indicated that the required License is missing.
Bob Schor