LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Motion Reconstruction using LabVIEW

Solved!
Go to solution

Nabil,

 

     Congratulations on your persistence.  As a "reward" (and to help other readers of the Forum), I'm attaching the "All-at-Once" version of the code (described above, and recreated by you) and one way to turn it into a "Movie" (at 100 fps).

     Here is the 3D Graph routine that does the steps I described to you earlier.

3D Graph.png

Creating a Movie requires drawing successive 3D Graphs, first with one data point, then two data points, then three ..., i.e. wrapping the Graphing routine in a For Loop, like this:

3D Graph Movie.pngI'm sure, given enough time and patience on your part, you could have figured this out for yourself ...

 

Bob Schor

Message 21 of 32
(1,244 Views)

Hi Bob,

Thank you very much!!!

 

However, I have a question, with the spreadsheet 3D data, what kind of graph in Labview that is suitable to produce like in the video attached (Cluster Marker/White Dots)?

FYI, the spreadsheet data is 3D data of 2 cluster markers/points located on human thigh, (the one with white dots in the video). By using the data, it need to be reconstruct into 3D motion. The output is more likely like the video attached.

My point is, is it possible to make the same output as the one in the video by using graphs in LabVIEW? Just focusing on the white dots.

 

 

0 Kudos
Message 22 of 32
(1,231 Views)

OK, now you are definitely getting outside my area of expertise!

 

I was able to "guess" that the data came from 3-D coordinates of markers placed on a (presumably human) thigh during (presumably) locomotion.  What you got was a 3-D plot that could be (a) turned into a Movie, (b) "manipulated" by grabbing the axes and rotating it to view the motion from various perspectives, and (c) altered in time by varying the rate of playback.  The AVI includes other data points from a fixed perspective, but with "ball images" (instead of points).  Could you generate such things in LabVIEW?  Probably, using either the IMAQ Vision routines or possibly geometric transformations of 3D "center" movement onto a fixed 2D Picture and drawing a suitable "ball" at that location.  It would be an interesting exploration of Image Visualization Geometry (projecting 3D into 2D, which is what the 3D Plot does for you, but only for points, not "balls").  Not a bad research or Project topic, but you should work with a colleague (or Professor), at least one of you should be familiar with the mathematics of 3D transformations (rotation and translation matrices).

 

Bob Schor

 

P.S. -- If your question is "Can I create an AVI from a series of X, Y, Z data samples, obtained (perhaps) from a 3D Motion Capture system, similar to the one shown in the example", then the answer is "Yes, using functions from the Vision Toolkit, but it will be a lot of work, and there are probably already existing software out there, possibly from people who make Motion Capture systems, that will do this already (for a price)". 

Message 23 of 32
(1,222 Views)

Hi Bob,

Sorry for my bad explanation. Yes, that is what i meant.

However, I may not chose to create an AVI using IMAQ Vision since you said it takes a lot of work and time.

 

There is something I would like to ask, from the 3D plot that I got that move like a "movie", the graph shows the plots drawn as dots that creates line (that shows like a trace of moving plot). My question is, is it possible to unshow the "trace" and only shows the plot moving as a dots that does not create lines? I don't know how to explain, I hope you get the idea.

0 Kudos
Message 24 of 32
(1,209 Views)

Continuation*

 

Plus, how to show the value of X,Y,Z of each plot?

0 Kudos
Message 25 of 32
(1,206 Views)

Correction:-

 

I meant the value of the position of each plot. I tried to put numeric value but it does not connect.

0 Kudos
Message 26 of 32
(1,196 Views)

Oh, that's fairly simple.  As it happens, I'm on another computer, and for reasons I don't understand, the Snippet that I posted won't "open" on this machine, so I'll have to use words, again.

 

Look at the two code examples in my last post (with examples).  The first one generates all the points, accumulates them in "arrays of points" (that is, in lines), and plot them once.  The second has a For loop that makes a 1-point line, a 2-point line, a 3-point line, etc. and plots them at 100 Plots/second to make a Movie.

 

What do you want to do?  You want to "make a movie", but you want only 1-point lines, one point at a time.  So simply remove the Shift Registers that are accumulating the 1, 2, 3, ... point lines, take the 1-point "point" and pass it through Build Array to make it a 1-point line and wire those "lines" to the Plot Line functions.  Voilà.

 

Bob Schor

Message 27 of 32
(1,186 Views)

Hi Bob,

I tried to do what you told. This is what I got so far. Can you check it for me?

 

However, how to show the value of position of each plot using numeric indicator?

0 Kudos
Message 28 of 32
(1,175 Views)

Well, my apologies -- I spoke too soon!  My suggestion for plotting "a moving point" said to make each point a 1D Array using Build Array, and then do a Line Plot.  But I should be enough of a Mathematician to remember "two points determine a (straight) line".  If you append a 0 to each point to make a 1D Array with, say, 0 and the X value, you'll get a line from the Origin to your chosen point that wiggles around, not what you want.

 

So here's an idea.  Given a point X, Y, Z, write a little sub-VI that returns a small cube surrounding X, Y, Z.  Let (x, y, z) be the coordinates of a point that you want to enclose in a cube of side 2*s.  Create the following lines:  (x+s, y+s, z+s), (x+s, y-s, z+s), (x-s, y-s, z+s), (x-s, y+s, z+s), (x+s, y+s, z+s), (x+s, y+s, z-s), (x+s, y-s, z-s), (x-s, y-s, z-s), (x-s, y+s, z-s), (x+s, y+s, z-s), (x+s, y-s, z-s)*, (x+s, y-s, z+s), (x-s, y-s, z+s)*, (x-s, y-s, z-s), (x-s, y+s, z-s)*, (x-s, y+s, z+s).  Note that three of the points are starred -- these represent lines that you draw twice (work it out -- to draw the outline of a cube with a single line, you need to draw three edges twice).

 

I just tried this, and it's not very satisfactory -- the sides of the Cube are not equal, as the X, Y, and Z axes have different scales.  Makes the whole problem more complex, I'm afraid.  Here's a picture of the revised Line Graph --

Revised 3D Point Plot.png

The inputs are the two sets of X, Y, Z from the earlier loop.  The sub-VI, Point to Cube, is just a For loop with 16 wired to the N and containing a 16-fold Case Statement (wire the Index to the Case Selector).  Case 0 add the bottom (half-side) input to X, Y, and Z.  Case 1 is identical to Case 0 except the Y operation is Subtract.  And so on.  If you know Quick Drop, and know about the options for Case statements, including Duplicate, you can do this fairly quickly.  I'll get you started:

  • Put an empty Case Statement into the For loop.  Find the "0" case, drop three Add functions, wire the first to X and Half-side, the second to Y and Half-side, and the third to Z and Half-side.  Bring them out to an indexing tunnel of the For loop.
  • Right-click the Case statement and choose "Remove Empty Cases".
  • Right-click again and choose "Duplicate Case".  This will get you the "1" Case.  Change the Y operation to Subtract.
    • Quick-drop lesson -- select the Y (add) operation, type Ctrl-space (which starts Quick Drop).
    • Start typing "Subtract" (until you see it selected).
    • Type Ctrl-P to rePlace the Add with Subtract.
  • Repeat the previous Step to generate Cases 2 .. 15, changing one appropriate Add to Subtract or Subtract to Add until you have generated lines for all edges of the Cube.

[We're having Power problems here -- I need to shut down my PC, will try to pick this up this evening from home].

 

I'm a little worried that this Project is a little unfocused -- you need to stop and consider what it is you really want to do.  Are you trying to reproduce (in LabVIEW with Plots of some sort, or possibly Images and Movies) the output of Motion Analysis Software packages?  If you are going to "Reinvent the Wheel", you'll want to make sure you have proper understanding of how to represent 3D data on a fixed 2D "picture Plane", then consider how you want to represent your Image (e.g. a Ball-and-Stick model like one of the movies you attached).

 

We're getting out of my "experience" zone ...

 

Bob Schor

Message 29 of 32
(1,160 Views)

Hi Bob,

 

Wow, it looks complicated. I'll try to understand it.

 

Thank You so much for helping me.

0 Kudos
Message 30 of 32
(1,153 Views)