LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ-Grab and Save with Matlab Script

Dear All,

I am using an IMAQ based program to capture Jpeg Image from a USB 2.0 camera and afterwards using that image to calculate white area percentage (from Binary image which is black and white) using Matlab Script. I am trying to pass image address to Matlab script. But after 2-3 images, it gives me error.

The objective is to capture images and process it (like real time). I tried to put delay but it does not work. I have attached Vi and error snapshot. Kindly guide me why this is happening.

Thank you for your support.

Download All
0 Kudos
Message 1 of 4
(2,449 Views)
Image Saving to Disk is slower process and try to separate it from acquisition check Producer/Consumer Architecture.
-Make sure you have enough User Buffers(IMAQ Create) created without overwriting the previous buffers and corresponding IMAQ Dispose is present.
-Any reason why trying half in LabVIEW and othe in Matlab?(You have almost all functionalities in LabVIEW too.)
Thanks
uday
0 Kudos
Message 2 of 4
(2,438 Views)

Dear Udka,

 

Thanks for the reply.

I understand that saving to disk is slow. That is why i tried to create a delay, but it does not work (Or i don't know how to create exact delay). Further, it is requirement of project to use Matlab as it may needed to do further image processing. Your suggestion to check for Producer/Consumer Architecture seems valid. i will check it at home (I don't have access to IMAQ right now). One more thing, is there any other solution for checking the file is saved or not? so that Matlab access file after it? (Sorry for asking such simple questions, I am new to LV)

Thanks.

0 Kudos
Message 3 of 4
(2,426 Views)
Simple Option would be to follow Data Flow model and pass error wire after saving the file to Matlab Script. This ensures the image is saved to Disk and then the processing is done then next image is acquired.
-LabVIEW has lot of Vision Functions inbuilt. Check this : https://zone.ni.com/reference/en-XX/help/370281AC-01/
Thanks
uday
0 Kudos
Message 4 of 4
(2,415 Views)