LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code review

Solved!
Go to solution

Good morning, I am writing to request a revision to the attached code. It is a program whose purpose is to visualize and describe the motion of a cube by analyzing 4 points on its faces. For now only one camera has been set up and I would ask how I can insert the second one to take measurements at the same time.
In general, the doubt I have about the code concerns the stability and correctness of the output information. I would have preferred to replace the transformation of ROIs to binary, now implemented through an internal function, with an explicit function so as to better control its operation. I hope for your valuable help, I remain available for more details and have any needs. Kind regards.

 

0 Kudos
Message 1 of 5
(296 Views)

It looks like you're doing the exact same things 4 times in parallell. Combine it into 1 parallell loop instead.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 5
(293 Views)

Thank you very much for your reply.The cycle is done 4 times because 4 areas of interest were identified on the cube. How could I modify it so that the binary transformation of the image is more stable using the IMAQ Threshold command even in low light conditions? I am having trouble determining the threshold. Also, I would like to figure out how to add a camera (with 4 other areas of interest) that works simultaneously with this one. Sorry for so many questions, best regards and thanks again.

0 Kudos
Message 3 of 5
(278 Views)

I'm stuck on LabVIEW 2015 so I can't look at your code.

 

As for image processing you can try:

  • Enabling auto exposure if available for your camera
  • Experimenting with Vision assistant to find optimal threshold settings and apply these in your LabVIEW code
0 Kudos
Message 4 of 5
(220 Views)
Solution
Accepted by fra24

I don't have IMAQ installed, so I can only look at the rest of the code.

 

  • It is always a bad idea to have the diagram maximized to the screen.
  • Yes, You can use a parallel FOR loop
  • your SubVI outputs a hairball of scalars. It would be much more manageable to output a cluster of properly named values. Too many places where wiring mistakes can happen. No need for herding cats wires). Why does it output "Center of Mass Y" twice? In the caller, you would use unbundle by name to avoid all ambiguities.

altenbach_0-1725983287381.png

 

0 Kudos
Message 5 of 5
(218 Views)