09-13-2024 10:43 AM
Good morning, I am asking your advice regarding the code I am attaching. I don't understand why in the graph the X and Y coordinates of the 4 centers of the set ROIs are not shown, plus the stop button seems not to work correctly.
I would be grateful if you could upload me a corrected version of the code. Endless thanks, kind regards.
09-16-2024 01:50 PM
Hi, "ROI copy.vi" which sets up camera (?) is too specific for the camera you're using, so I simply replaced it with IMAQdx Open Camera and IMAQdx Configure Grab. Also, I had to use IMAQ Cast Image (inside the while loop) to cast RGB from my camera to I16 that you expect in the rest of the program. Maybe your camera is already set to output I16, but I would check that in the first place. Remember to connect Image Type input to IMAQ Cast Image, as I expected it to use "Image Dst" type - that's not the case ;).
"Image Dst" input of IMAQ Extract2 needs to have the same Image Type as your input image.
You need to use proper output of IMAQ ImageToArray, but since you're using I16, that shouldn't be a problem.
Stop works OK when framerate is high, but since timeout for grab is 5 seconds, you can feel like it doesn't work if there is a problem with the camera. Place a probe somewhere in the loop and observe "Last Update" time.
Please let me know if that helps you.
09-17-2024 03:04 AM
Thank you very much for your answer. To assign a name to the variables plotted in the graph via a for loop how should I do it?