1 (edited by joan 2011-05-12 12:13:48)

I was asked by mail about markers and the tracking algorithm.

The automatic tracking in Kinovea works by computing the cross correlation coefficient between a candidate window and the feature window of the previous image.
For each possible position in the search window, we get a score, and the best score is the match (unless it is under a specific threshold in which case we assume the target was lost).

So it is a measure of how much the candidate look like the original.
- Contrasting area will make the matching easier. (marker should have a different brightness than its background. Bright on bright is not so good.)
- It is not invariant to rotation, so if rotating the marker changes its look, it will be harder to match. (triangle, rectangle, square: not so good)
- It will look in the immediate surroundings, so having a target that does not resemble any other part of its vicinity is better to avoid mismatches. (background and other parts on the person should be clear of anything that look like the marker).

To sum it up (based on the theory, I haven't done extensive testing in real conditions yet)
- Circular marker.
- Marker that takes about half the feature window.
- A color and brightness contrast with background that is not present in the rest of the search window.

Please post your findings, experiments, which markers work best, etc.
Anyone to do a video showing how various markers perform ?

2 (edited by Chas Tennis 2011-05-12 17:37:50)

Definition:  By "markers" do you mean the features inherently in a scene such as a ball or the edge of a baseball bat. Or do you mean artificial things that are added for tracking such as tape, LED lights, etc.?  Or, it does not matter for the tracking problem?

I tried to track a tennis ball going away with Kinovea.  It tracked the ball for a short distance away from the racket until the contrast deteriorated and then lost it.  It reacquired it again after several/many? frames as the ball passed in front of a dark green practice hitting wall.  I just tried it a few times and don't recall any settings such as the search window. Does the search window continue on its previous path after the object is lost?

Eventually I would like to attach a marker to a point on my tennis racket and track a total path as has been done. But I don't know of effective video techniques that are practical. Attach a ping pong ball?

To serve I put black electrician's tape on my upper arm and hand.  It showed high contrast and a changing rectangular shape.   A ring of tape could be used on an arm or leg so that turning does not lose sight.

Has anyone used very light weight & bright LED markers that would show up in sunlight illumination?

3

- markers = stuff to stick or attach to the person to improve automatic tracking.
- feature window = the smaller rectangle around the point during tracking. This is the actual patch of the image that is looked for in the next frame.
- search window = the large rectangle during tracking, this is the area where the smaller "feature" window will be looked for.

Tracking tennis/baseball balls is most probably out of reach without super high speed camera (can do it manually if needed). But tracking a joint is definitely doable, although it may need some manual adjustments. Using physical markers might lessen or even remove the need for manual adjustement.

Using ping pong balls might be a good idea smile Cheap, round, and come in various colors. But how to attach them ?
Or maybe using balls from these beach racket games with scratch material (or is it called "velcro" I don't know the English term))

4 (edited by Chas Tennis 2012-10-12 16:34:50)

I have just a little experience using markers for high speed film imaging and almost no experience for sports applications or tracking. No internet search yet so there may be many markers that I’m not familiar with.  This thread could use some advice on marker options from those who have professional experience selecting markers for high speed video in biomechanical research. 

1) Tape.  Contrasting tape placed in reference locations.  http://vimeo.com/21512296  If applied to the body one issue is that the tape may not move with the bones due to muscles bouncing, etc.  Did the upper arm rotate or did the muscle with tape lag the rapid upper arm internal shoulder rotation?

2) Retro-Reflective Tape or Paint. One marker candidate is retro-reflective tape.  It reflects light back in the direction that the light arrived from.  Retro-reflective tape has the same glass beads that are used in the road signs to reflect the headlights of your car back to you.  To use RRT put the markers on the object and place light sources very close and alongside the camera lens.  Lighting is an issue, easiest to use in low ambient background light. The use of RRT with considerable ambient background light and especially in full sunlight may not be practical. ?  3M has technical information on its retro-reflective products.
http://vimeo.com/21529497

3) Markers with Patterns.  I don’t know how the Kinovea tracker works.  To improve chances of tracking would it be better to have the tracker work on the contrast & shape within the marker instead of between a marker and the varying background?  For example, would high contrast markers with patterns such as these help the tracker?

  1) Black circle surrounded by white ring
  2) White circle surrounded by black ring
  3) Circle half white and half black, etc.
  4) Other, high contrast within the marker
  5) Multi-markers, 3 circles close together.
  6) A black rectangle - similar in size to the feature window? - with a white circle inside. 

4) Balls as Markers.  Spheres regardless of how they are oriented display the same shape and reflect light the same way. (A tennis ball seems to be an ideal object to track.) Therefore using small balls as markers seems like one option. Ping pong balls are very light weight.  They would have to be rigidly attached.  Velcro is an option but not completely rigid.  Epoxy the ball to a machine screw, clamp, bendable aluminum strip or strap, etc. and attach that to the object?   Ping pong balls add air resistance and that may not be negligible for some high speed applications such as on a tennis racket.  Style is an issue.

5) LEDs.  Are point light sources good candidates for tracking? These have been used in biomechanical research.  But are they bright enough to be useful, probably not in sunlight.   LEDs are manufactured in thin credit card shaped magnifiers. Do they also make other very small, light weight, self-contained LEDs with light weight, small batteries?
---------------------------------------------------------------------------

“Tracking tennis/baseball balls is most probably out of reach without super high speed camera.” 

I have not tried high speed video yet using the following set up.

Generally a very useful camera location for projectiles or balls is with the camera on or very near the trajectory and viewing parallel to the trajectory. If coming toward the camera images of objects get slowly bigger and if going away they get slowly smaller – but the image of the object moves very slowly in the frame in comparison to viewing the object on its trajectory from the side.  [With bullets first surface mirrors are placed next to or on the trajectory looking back at the gun to protect the camera.]

Tracking. This set up viewing the ball going away after it has been struck or thrown is very favorable for tracking especially if the ball is viewed against a high contrast background.  This view also tends to be very informative.  It may show the effects of tennis ball spin or golf ball slice and also may show where the ball lands. 

I’ve seen some golf trajectories and believe that golf balls are routinely tracked going away by golf software. A camera position often used in golf is from just behind and 1 meter above the golf tee but not exactly along the initial trajectory.

Tennis strokes, volleyball serves, baseball pitches, etc., can be viewed from behind and exactly parallel to the initial trajectory. I have not seen this view in high speed video of tennis serves probably because the camera has to be positioned higher (3+ meters) than a standard tripod reaches (2 meters). This makes the setup inconvenient for non-professional use.  For example, I'd like to see high speed video of the initial trajectory of a kick serve as it leaves the racket.  The path of the racket strings across the back of the ball could also be seen.  Kinovea might be able to track the ball after the racket has moved off to the side especially if the court is the background.

For a video taken from behind and 1 meter below the trajectory/racket height using a Casio FH100 at 240fps -

Using video not optimized for setup I tried to track a tennis ball going away with Kinovea.  K tracked the ball for a short distance away from the racket until the contrast deteriorated and then lost it.  K reacquired the ball again after several frames when the ball passed in front of a dark green background.  I just tried tracking a few times and don't recall any settings such as the search window. Does the feature window/search window continue on its previous path after the object track is lost?   

I believe that tracking a tennis ball just after it is served could be a clean, informative and important tracking problem especially if observed exactly along the initial trajectory. 

Motion Blur.  Always use the fastest shutter speed possible to minimize motion blur and get a sharp image of the ball.   I use 1/10,000s or faster.  In addition, the along- trajectory view itself will also minimize motion blur.

If anyone is interested in tracking tennis serves or other objects along the trajectory with high speed video please describe your application. 

You’ll see me at the US Open this year with my Casio FH100.  I'll be in the stands sitting in the row with the proper height to video serves along the trajectory.  #1 on my list is Stosur’s kick serve.   Anyone going to the French Open?

5 (edited by Chas Tennis 2011-05-18 15:14:49)

Websites with marker information. 

Search terms - biomechanical, markers, retro-reflective, sphere, video, analysis

General       http://en.wikipedia.org/wiki/Motion_capture

Sphere application.   http://en.wikipedia.org/wiki/File:Kistler_plates.jpg

Retro-reflective sphere markers - discussion on making or purchasing the spheres.
http://biomch-l.isbweb.org/threads/1893 … on-Request

Reflective tape.
http://books.google.com/books?id=PrOKEc … mp;f=false

Markers with patterns.     http://www.youtube.com/watch?v=7JiD1mFan5E

Application of markers in dance - Techniques used briefly described for many publications for the analysis of dance motions.

http://www.citraining.com/Biomechanical … Dance.html

A company offering video analysis of pitching. Retro-reflective balls are used.
http://www.youtube.com/watch?v=BhNmUv4XkyU&NR=1

A company discussing retro-reflective balls & IR LED ring light limitations outdoors.  Uncertain of what video techniques and markers they applied outdoors.
http://w4.ub.uni-konstanz.de/cpa/articl … /4387/4078

Vicon system able to operate outdoors with IR LED illumination & retro-reflective balls -
http://blogs.discovermagazine.com/80bea … aroos-hop/

LED markers. Also, LED sources themselves could be used as markers but again lighting outdoors is an issue.  In addition, when tracking point light sources outdoors such as LEDs there will be competing sources from small solar reflections.  These frequently appear outdoors from the sun reflecting from specularly reflecting surfaces especially those that have small curved surfaces, for example, a ball bearing or curved chrome tube.  These reflections might also appear as point sources and saturate the video levels just like the LED marker.   ( A ball bearing itself might be useful as a marker in sunlight.)

Estimated beam spread from retro-reflective materials. - As a first rough guess for RR applications a collimated laser beam might be reflected from the retro-reflective materials in a cone of 15 degrees back toward the light source.  Consult specs for materials.  [Corner cube reflectors can reflect light back to the light source with much less spread.]   The camera lens must be within this cone.  To observe the cone send a laser pointer through a hole in a screen and onto the RR material, look at the reflected light on the screen.

Professional systems. At this point I see some applications with LED IR ring lights at the camera for illumination (Vicon, etc) and retro-reflective spheres on the subject.  Often expensive 3D multi-camera systems for professional use. Many applications are indoors with controlled lighting.  Lighting outdoors in sunlight is an issue for retro-reflection markers.   

Non-professional users. First impression after a brief Internet search.  For the non-professional 2D user with a single high speed camera and working outdoors, markers with patterns, such as white diffusely reflecting spheres on black backgrounds that will produce contrast from sunlight are probably the most practical.  All affordable video & high speed video cameras (Casio, etc.) have a filter that blocks IR. Therefore applications with similar cameras must be in the visible.   Indoors, where lighting might be controlled, the retro-reflective tapes, RR spheres, and LED markers are probably workable.

Other options especially outdoors at reasonable cost or high cost?   Disagree with any points above?

6

Thanks for compiling all this. Many interesting things to read !

Regarding point 3 - markers with patterns, I think that yes, a pattern within the marker can improve tracking results.
Nested black and white rings would be the most efficient in my opinion (maximum contrast + not rotation variant).

7

Color Tracking?

joan wrote:

I was asked by mail about markers and the tracking algorithm.

The automatic tracking in Kinovea works by computing the cross correlation coefficient between a candidate window and the feature window of the previous image.
For each possible position in the search window, we get a score, and the best score is the match (unless it is under a specific threshold in which case we assume the target was lost).

So it is a measure of how much the candidate look like the original.
- Contrasting area will make the matching easier. (marker should have a different brightness than its background. Bright on bright is not so good.)
- It is not invariant to rotation, so if rotating the marker changes its look, it will be harder to match. (triangle, rectangle, square: not so good)
- It will look in the immediate surroundings, so having a target that does not resemble any other part of its vicinity is better to avoid mismatches. (background and other parts on the person should be clear of anything that look like the marker).

To sum it up (based on the theory, I haven't done extensive testing in real conditions yet)
- Circular marker.
- Marker that takes about half the feature window.
- A color and brightness contrast with background that is not present in the rest of the search window.

Please post your findings, experiments, which markers work best, etc.
Anyone to do a video showing how various markers perform ?

To double check, does Kinovea use the color information as well as the brightness for tracking?

Any idea of what might happen with a marker pattern made up of two saturated colors but similar brightnesses, for example, a red circle surrounded by a blue ring?

8

Chas Tennis wrote:

To double check, does Kinovea use the color information as well as the brightness for tracking?

Sorry, it wasn't clear at all from the first post. Yes, the color information is fully used during the matching.
Black/White will always be better for the matching itself (color and contrast) but color difference alone should help.
Aside from the internal pattern of the marker itself, it could help when using several markers of the same material/shape/brightness. It should help matching the right marker with the right trajectory.

9

This should be a sticky mounted to the top of this forum?

10

LED Marker Candidates & Throwies!

As far as cheap, self-contained LEDs are concerned it is hard to beat “Throwies”.  These connect directly (without circuitry) to button batteries that are supplied with the LEDs for under $1 each.  Light output for 2 weeks claimed.

“Throwies” - http://www.youtube.com/watch?v=YjTP_T-w … re=related

http://www.instructables.com/id/LED-Throwies/

Colors. LEDs are available in a variety of colors.  These LED emission spectra lend themselves to filtering as an option.
http://www.oksolar.com/led/led_color_chart.htm

For use as marker the best LEDs should probably be very bright.  They should also be ‘diffuse’ emitters – imperfectly diffuse as supplied but tending to emit more into all directions.  The light from ‘diffuse’ emitters is more likely to hit the camera lens than light from non-diffuse beam LEDs.   [Non-diffuse LEDs emit in a cone, for example, of only, say, 10°, severely limiting the use of that type of LED for markers.]

A good choice for marker candidates would be large, 10 mm, ‘super bright’, diffuse LED Throwies.  To try some I have spent some time trying to find this type for testing.   Finally I found some, just $7 for 10 10mm LEDs with batteries. But with minimum order and shipping the final cost exceeded $40, too much for me to test. 

http://www.lilyleds.com/Products/113/LED-Throwies

I did purchase 5, 5mm, non-diffuse, LEDs for under $10, shipped.  (The website is not now coming up.?). The output colors were white, red, blue, green, and amber.  Unfortunately, these were found to emit in a narrow beam of about 8° (hold a paper out in front of the LED to estimate).  While bright, strong sources when pointed at the camera, a slight tilt of the LED causes the beam to miss the camera lens and appear to have little brightness.  There may be some applications where the directional LEDs are better markers than the diffuse LEDS but the LEDs will have to stay pointed at the camera lens.

Video Test Non-Diffuse LEDs. A test of these LEDs, outdoors in overcast skies is shown with description of the test -  http://vimeo.com/25126884   The video can be downloaded.

I have not tested the tracking function of Kinovea for these directional LED sources in the video test.  One issue for tracking small light source markers is the Kinovea tracker's response to 'point' light sources. These LEDs, especially for low resolution high speed video cameras, will probably often just be imaged on just a few elemental detectors of the camera's sensor. 

I may still mount these non-diffuse LEDs in tissue paper diffusers but that will reduce output in some unknown way. 

I’m still looking for the large 10 mm, super bright, diffuse, LED Throwies, 10 for <$20 delivered,  to test next…….

Pending testing, I view LEDs as a good marker option for indoors and possibly workable outdoors in overcast skies. Guessing, LED markers are probably very difficult to use in direct sunlight.

11 (edited by Chas Tennis 2011-07-31 18:38:41)

Fluorescent Orange Ping Pong Ball Marker Test

A ping pong ball painted fluorescent orange (Tulip Slick Fabric Paint) was attached to the top of a tennis racket using a long, thin machine screw.  Fluorescent paint was chosen on the possibility that some paints might produce brighter markers in select wavelength bands.  An internet search did not yield information on the magnitude of the reflection plus fluorescent emission of these paints. Are any fluorescent paints considerably brighter than white in select wavelength bands?

http://www5.snapfish.com/snapfish/slide … =snapfish/

http://www5.snapfish.com/snapfish/slide … =snapfish/

One serve was recorded from the side against a darker background of trees in shadow. A second serve was recorded with a high camera (~10ft or 3 meters) so that the serve was seen from behind somewhat along the tennis ball’s trajectory. 

In order to see how well the tracker could follow the ping pong ball marker on the racket the Kinovea tracker was applied with no manual corrections.  In addition, in the view from behind the tennis ball was also tracked.  There was a consistent loss of track whenever any object approached a white line on the tennis court. 

These were first tests without optimizing, etc.   

Serve from the side with dark background, slightly underexposed. This setup is very useful for showing a considerable length of the racket path.
http://vimeo.com/25144725

Serve from high & behind.  Only the first serve has tracking.
http://vimeo.com/25414832

These videos cannot be viewed stop action, frame-by-frame on Vimeo.  The videos can be downloaded and viewed in Kinovea and probably other players such as Quicktime, etc.

Details on compression & non-compression as used by Vimeo are described in these FAQ-

http://vimeo.com/help/faq#compression

12 (edited by velocanman 2012-02-12 18:33:38)

Hello.  I realize this is an older post but I wanted to share my experience with LED tracking and a variation of the "LED Throwie" that I developed.

Following is a photo of frontal knee tracking for road bike fit using 5 mm LED markers on each knee:

https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/376003_2703497106467_1227925311_32797360_977623481_n.jpg

The minor variation on the LED Throwies that I use is I soldered the 5mm white LED to a CR2032 battery holder.  I used epoxy to seat the LED on the battery holder and protect the terminals.  The on/off function is simply removal of the battery.  These and small, sturdy, and easily taped to a desired body part.

As an aside, following is a graph of the data from the above track.  I exported to Excel for the graphing.  I'm looking for anyone that has developed a Visual basic script to automate the Excel import for data selection.

https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/388848_2701372173345_1227925311_32796848_1446071195_n.jpg

Regards,
Alan

------
http://www.facebook.com/velocanman

13 (edited by Chas Tennis 2012-01-25 18:37:37)

velocanman wrote:

...................................................
Following is a photo of frontal knee tracking for road bike fit using 5 mm LED markers on each knee:
.........................................................................................

Nice result. 

Could you provide some of the photographic details -

1) Output wavelength/color of the LED?

2) Was the LED directional or diffuse?  If directional, any issues aligning the LED emission cone (10°?) to include your camera lens?

3) Camera model, frame rate, shutter speed, ISO, etc.  Estimate of the resulting motion blur.

4) Did the LED appear to saturate the signal levels in the video?

If you try some outdoor measurements in direct sunlight, specular reflections from bicycle surfaces and background objects will compete with the LED.  On a completely overcast day these solar specular reflections would be absent and would make tracking of the LEDs easier.

14

Excellent questions.  I will try to answer the ones that I can:

1.  The LEDs are 5mm white, 7000 mcd, 25 mA.  "High brightness" on the package is accurate.

2.  The LEDs have a 30 deg viewing angle.  Semi-directional?  I did not have an issue aligning with the emission cone.  The more important issue is aligning the camera with the bicycle for the parallel and orthogonal views.

3.  The camera used is a Canon T2i DSLR.  The maximum ISO is 6400, not sure if that applies in the video mode though.  Resolution used was 1280x720 at 60 fps.  Use the higher fps to capture the foot/pedal motion.  I have AF disabled during filming and the shutter/AE locked.  So I'm not sure what shutter speed or exposure setting was.  My estimate is that the motion blur was minimal and acceptable, based upon the clarity in the screen captures.  The posted image is significantly compressed.

4.  The LED did not saturate the video but there is some diffusion in the LED image.  A lower intensity LED might actually be preferred but I need to check with higher ambient lighting first.

I appreciate the feedback on the sunlight reflections.  I understand it helps to mask reflective surfaces on the bike.  It may be impractical with all the brushed aluminum in the component groups, but I can look into it.   I may try out retroreflective tape both in- and outdoors.  I don't like the bright lights for indoor use but I've seen some folks publish good results.

I am just getting into this, and am a complete novice at digital video, so I have to apologize for the ignorance.   I appreciate all input and feedback.

15 (edited by jontyc 2012-01-26 14:23:42)

Excellent collection of links, Chas, thanks. Did you end up getting Stosur's kick serve? smile

I'm contemplating going down the 3M retroreflective tape route, on top of 20mm spheres, to measure 10-15 places on a golfer (and one on the club head) via multiple cameras. A long search has revealed no reasonably priced software that can do this automatically. So I thought I might start with Kinovea as the base and see where it leads.

Idea is to add one or more IR LEDs to PS3 Eye cameras and replace their IR filter with a visible light filter and work solely in the IR domain (I'm only after tracking information leading to data, not image). No idea at this stage how many IR LEDs will be needed to work outside or even if I've have enough power via USB to drive them all.

I do have a Casio FC100 but will go with the PS3 Eyes because they are cheap, they can be synced and give me shutter control. They can do 125fps but only at 320x240 which I'm thinking will give insufficient accuracy, so I'll stick to 60fps with 4 times the pixels. Frustratingly the FC100 doesn't have shutter control in its high-speed modes, unlike your FH100. Unfortunately the PS3 Eye cameras also have a rolling shutter which give noticeable distortion at golf swing velocities.