取消
显示结果 
搜索替代 
您的意思是: 

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?

 

 

 

11 条消息(共 21 条)
3,109 次查看

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 项奖励
12 条消息(共 21 条)
3,102 次查看

 

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 项奖励
13 条消息(共 21 条)
3,090 次查看

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

0 项奖励
14 条消息(共 21 条)
3,078 次查看

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

15 条消息(共 21 条)
3,070 次查看

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 项奖励
16 条消息(共 21 条)
3,098 次查看

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
17 条消息(共 21 条)
3,085 次查看

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 ǝɥʇ'


18 条消息(共 21 条)
3,070 次查看

Hi,

 

Thanks for your reply.

 

Can you save the VI as LabVIEW 8.6 ?

Thanks,

 

Sébastien

0 项奖励
19 条消息(共 21 条)
3,051 次查看

here you go

 

 

original.png

 

 

 

 

 

0 项奖励
20 条消息(共 21 条)
2,983 次查看