05-06-2021 08:45 AM
Hi all, may i know how to reduce or eliminate the issue of order switching between 2 objects ?
is there any method to solve this by adding some conditions ? The item sorting will be sorted in 1 direction only which is left to right.
My current project is about vision aided sorting robot. The order switching may be an issue for sorting purpose
05-07-2021 01:38 AM
May i know what's your solution for this issue ? Thanks in advanced
05-07-2021 04:19 AM
A sort will sort the array.
Remove Duplicates From 1D Array removes duplicates. From a 1D array...
Note that your data is multiple doubles. Comparing doubles for equality will only work if they are exactly (binary) the same. Even if the indicator says 120.25, this could be 120.250 or 120.254 or anything in between. The sort will work, removing duplicates won't (as they are not duplicate).
05-07-2021 06:23 AM
I would store the coordinates in a shift register on the 1st frame. On all other frames compare by coordinates and reorder your array of properties. Update the shift register with the sorted coordinates of the current frame to allow for some movement.
05-07-2021 06:35 AM
May i know how to connect the coding to my VI ?
I have issue with that.
05-07-2021 07:04 AM
Can you upload your VI for LabVIEW 2015?
05-07-2021 08:52 AM
There you go !
05-07-2021 10:36 AM
I don't have the same Vision version so the VI is broken but this should get you started.
Reordering fails if the number of matches changes between frames or the change in position between frames is larger than the distance between matches.
You might also want to consider using subVIs to keep your code clean and readable.
05-07-2021 11:20 AM
Just tested the updated coding.
It seems like the issue still existed.
Is it i did something wrongly ??
05-07-2021 12:56 PM
Hi Jaycobian,
In your latest video at one point the number of matches found goes from 2 to 1. As said in this case reordering will not work, although I forgot to merge errors.
Vision pattern matching can be unreliable sometimes. In the attachment you will find an event case that ignores updating the front panel when the number of requested matches is not met. It should continue with the next frame.
Note that reordering will also fail if the number of matches is not met on the first frame.