12-14-2022 10:28 AM - edited 12-14-2022 11:09 AM
Hello,
I am employing producer consumer architecture to capture images if it satisfies the voltage condition. My issue is that, the images are not getting saved in the destination location that I have specified. Btw, I tried to use the solution code posted here and adapted it to my requirement
Attached is my code and screenshot. Please let me know what is going wrong and how I can fix it. Thanks.
(Code attached in the below reply chain)
Regards
Anand
Solved! Go to Solution.
12-14-2022 11:00 AM
@anandr05 wrote:
Attached is my code and screenshot. Please let me know what is going wrong and how I can fix it. Thanks.
You forgot to attach your code and screenshot...
12-14-2022 11:07 AM
Sorry my bad!!
Attached!!
12-14-2022 11:15 AM - edited 12-14-2022 11:16 AM
I am curious why there is not top-level loop. Are you using "continuous run" to poll the voltage control?
Does the destination folder exist?
What is the pace of the producer loop?
Do the images arrive at the dequeue operation?
Do you get any errors?
(Sorry, I don't have your toolkits, so my advice is limited)
12-14-2022 11:24 AM - edited 12-14-2022 11:25 AM
Thanks @altenbach for getting back. Below is my response to your questions.
I am curious why there is not top-level loop. Are you using "continuous run" to poll the voltage control?
Currently using analog input to see if I could capture the image based on the threshold condition.
The ultimate objective is to set up the Trigger condition as follows
Does the destination folder exist?
Yes, it does. Its G: because its the google drive. I don't think that's the issue because the images are not getting saved even if I specify a local drive
Do the images arrive at the dequeue operation?
Not sure how to check that. Sorry, I am new to this.
Do you get any errors?
No, I do not get any errors. Loop is running as expected and the producer/consumer count keeps ticking but no images are saved.
12-14-2022 12:10 PM
If both Producer and Consumer loops are running (judging by the loop counts increasing), you still don't know if an image is getting sent and received. Try replacing the "write to PNG" code with a simple "Display in Image Display" (to make sure you are extracting an Image from the Camera).
Bob Schor
12-14-2022 12:21 PM
Thanks Bob for the response. I have the image display called out IMAQ write file. And the live image is getting displayed. For reference, please check this link of the screen recorded clip of the front panel when the code is executed.
https://www.veed.io/view/a7fdd872-4a65-489c-91bb-36af1a3c4612?source=compressor-sharing
Thanks
Anand
12-14-2022 12:37 PM
Oops, I forgot to look at your Front Panel. So the Camera takes an Image, puts it in the Queue, it gets dequeued and displayed, but doesn't show up in the output folder. Are any SampleN.png files being written? If not, there's your problem (try writing a dummy file, "My Picture.txt", using the same File Path and make sure the "writing" works). I could make a few quibbles about style, but don't yet see anything to explain why you have images but no .png's. Incidentally, why are you saving separate PNGs, instead of making a video (.avi)?
Bob Schor
12-14-2022 12:53 PM
One thing i can suggest is getting rid of the Producer Consumer structure. You only create a single IMAQ image location which the camera is continually overwriting. Sending multiple identical copies of the reference to the image is doing nothing but introducing potential race conditions.
12-14-2022 01:14 PM
Bob,
Are any SampleN.png files being written?
Yes, you are right about the issue and no SampleN.png files are written.
try writing a dummy file, "My Picture.txt", using the same File Path and make sure the "writing" works
I used "Write to Text File" I/O but still not response. Not sure if you were referring to that. I don't see any other type of IMAQ Write to File utility function.
Also, wanted to share the below details:
Why are you saving separate PNGs, instead of making a video (.avi)?
Wanted to process these saved images using vision assistant algorithm on FPGA target
Thanks
Anand