LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sort XY by closest

certain file formats are disabled in this forum e.g. you can't attach .bmps, too

 

 

but, yes I'm fine with the excel sheet!

 

 

 

the object extraction algorithm seems to produce valid values quite continously for each object.

have you considered to delete wrong pixels instead of swapping them?

 

 

I'd like to understand why or when this error occurs:

 

could you post the image - or draw a picture e.g. paint-  from which the objects are meant to be extracted?

are you're objects liberated or do they touch each other on the picture?

 

 

 

Message 11 of 21
(2,238 Views)

Hi,

 

I see what you mean, but in fact, it's not only one line. That can happen to much more.

I've attached a new XLSX (with a correction from the previous one) and better example with more than one swap.

 

I was close to succed to do it with complex but the VI sort by X first but that's not enough, I would like him to sort by X and Y (http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/sort_complex_numbers/) -> in fact by the closest distance from 2 points. EDIT -> Maybe storing by magnitude can solve my problem here, I'm checking it.

 

Any idea, because I'm really stuck 😞 Also, don't forget number of objects isn't fixed to 3.

 

Thank you, 

 

PS : Here is an explanation that might help you to understand why I encounter this problem.

Explanations.png

0 Kudos
Message 12 of 21
(2,231 Views)

 

from your draft, it looks like as if your objects were moving.

 

 

do you want to trace objects in a video-sequence?

 

 

or don't the objects move?

if it was static, have you ever considered to do your own "object extraction" VI?

in this thread there's a quick'n'dirty implementation of the well-known flood-fill algorithm:

http://forums.ni.com/t5/LabVIEW/Floodfill-Algorithm/m-p/438947#M214627

 

 

0 Kudos
Message 13 of 21
(2,219 Views)

Yes objects move, the XY I'm giving you are the XY coordinates every frame. In fact, these objects are insects.

0 Kudos
Message 14 of 21
(2,207 Views)

Do you also need to account for the case where the insects crawl or fly over each other? When this happens do you need to identify the individual insects or simply note the passage?  Note that in your arrays from images this will be equivalent to some objects merging or combining and then splitting apart.

 

Lynn

Message 15 of 21
(2,199 Views)

Yeah, this is also one of my problem 😞 A huge one, I agree.

However, with a good threshold greyscale, we may avoid this because flies doesn't really use to climb on each other and doesn't stuck to each other.

In case it happens, I don't really know what to do. I posted on the Vision forum to have more informations about it; because I hoped that LabVIEW Vision was able to extract and follow objects, but I'm not sure anymore :S I don't think IMAQ Count Object can be set to remember objects frame after frame, unfortunatly 😕

0 Kudos
Message 16 of 21
(2,227 Views)

Hello Sebastien,

 

after your explanations I made this VI, using complex numbers to calculate the nearest point. Perhaps it helps to sort the coordinates the right way.

 

Greets, Dave
Message 17 of 21
(2,214 Views)

Zepiii wrote:..
because flies doesn't really use to climb on each other and doesn't stuck to each other.

In case it happens, I don't really know what to do.


Well, if they really don't use to climb on each other and don't stuck to each other, they usually will die out 😄

SCNR

 

To your problem: Regard each fly (item) as an vector with position , moving direction and velocity (two complex numbers) . Now you can predict the new location and improve you relocation of the actual fly.

SO you keep a list (array) of flies and for each fly (array entry) you can calc the prediction.

With the list of new items you can calc the distances from new to old and new to prediction (for/to each item/fly)  , give them a weigth.  Use this weigth to identify old to new.

This will not work everytime to all items, some items migth leave or enter the FOV or other conflicts will rest. Sit back, look at yourself and analyse the way YOU use to solve this conflict.

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 18 of 21
(2,199 Views)

Hi,

 

Thanks for your reply.

 

Can you save the VI as LabVIEW 8.6 ?

Thanks,

 

Sébastien

0 Kudos
Message 19 of 21
(2,180 Views)

here you go

 

 

original.png

 

 

 

 

 

0 Kudos
Message 20 of 21
(2,112 Views)