LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Object tracking - virtual draw, paint

Solved!
Go to solution

You'll find the object, lay the plots, but did not remain there in the plots and do not tie them together. 

How could I lay and connect the plots?

Thanks for the help!

0 Kudos
Message 1 of 12
(4,246 Views)

Dear Nerich34,

I am not sure what are you trying to do. Can you be more specific in your question? Can you provide a sample acquired image so we can simulate the acquisition to understand your application better and help you effectively?

Thank you

0 Kudos
Message 2 of 12
(4,120 Views)

Dear Martiko!

I like to make a program, which "object tracking" by webcam found x,y points and this help to draw. This is a virtual drawing program.

I already solved the previous problem. However, the drawing will always start with 0,0 points, and if the cam can not find your object and so draw a line unnecessarily form 0,0 points.

Thank you in advance for your help.

0 Kudos
Message 3 of 12
(4,114 Views)

Dear Nerich,

 

I am sorry but I am also not really sure that I completely understand what are you trying to do. Can you provide the sample picture and/or maybe make a short video showing what should be the outcome?

 

PS: For the sake of readability for other users, let's move with the new topic of discussion to a new topic in forums.

0 Kudos
Message 4 of 12
(4,097 Views)

Dear Martiko!

 

For example, such program:: https://www.youtube.com/watch?v=SWCiqPRZetA

 

0 Kudos
Message 5 of 12
(4,091 Views)

Hi Nerich34,

 

thank you for explanation video, it helps a lot. I made your application running with my camera and new color template. Now I completely understand what is your point.

 

The help of Draw Line.vi says "Draws a line from the current pen position to the specified location in a picture".

As you draw, your algorithm always takes the old position of the object as start and new position as the end.

The problem is in the first iteration, where there is no previous position of the object, so the application takes default position which is 0,0.

You can change pen position before first search algorithm with Move pen.vi.

 

I can imagine final architecture setting first acquired the position of the colored object as the input for Move pen.vi and all the other positions as the input for Draw line.vi.

 

 

In case you find this post helpful please mark it as a solution for future visitors of this topic.

 

 

Good luck with your thesis!

0 Kudos
Message 6 of 12
(4,084 Views)

Dear Martiko!

 

Unfortunately, that's not good either. 😞 I send the pictures and code in attachment.

May I have done poorly. 😞

Download All
0 Kudos
Message 7 of 12
(4,073 Views)

Dear Nerich34,

 

your application logic is not very clear to me, but based on the picture, what happens is, that you change the position of the pen every iteration back to position 0,0.

I would recommend using construct with the First Call? in combination with case structure.

For example something like this shows how to change starting point from 0,0 to 200,200:

 

0 Kudos
Message 8 of 12
(4,060 Views)

Dear Martiko,

 

Unfortunately, not good. I would need a "vi" which lifts up the pen and puts it down.

0 Kudos
Message 9 of 12
(4,046 Views)

Dear Nerich34,

NI Community is here for you to help you get better in LabVIEW programming and help you with your specific problems. At the same time, I believe that your thesis should be written mainly by yourself and not glued together from VIs you request around the web.

Did you think about the architecture of your program? Do you have any idea how to "lift up the pen"? 

 

My proposal would be to implement switch button for recording the movement (Draw line). Every time you switch recording on, you use the first point to move pen and second and the following points to draw the line until button is switched off.

 

Would that make sense to you? Do you need any further help?

 

Best regards

0 Kudos
Message 10 of 12
(4,029 Views)