6
$\begingroup$

I am a research student in a university. I think I need some help.

I used a video camera to monitor the vibration of a plank. Then I should calculate the amplitude and frequency of the vibration from the frames pictures extracted from the videos.

The pictures extracted from the videos are thousands. It is really hard to do it manually.

All I need is to choose a point in the mid of the plank. Then trace the point's coordinate values in sequentially images.

I can trace one point in two pictures using order "ImageFeatureTrack", but I do not know how to apply this order to thousands of images.

aw0 = Import["E:\\ImageJ\\raw\\C000200.jpg"];
raw1 = Import["E:\\ImageJ\\raw\\C000201.jpg"];
ImageFeatureTrack[{raw0,raw1}]

Please help me, if you have any ideas about this task.

Thanks a lot.

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$ – bbgodfrey Feb 3 '15 at 2:35
  • 2
    $\begingroup$ You do realize that we cannot access your E drive to make your code function? $\endgroup$ – bill s Feb 3 '15 at 3:58
  • $\begingroup$ @bills The ExampleData function provides easily accessible example sequences. See my answer below. $\endgroup$ – Sjoerd C. de Vries Feb 11 '15 at 11:51
  • $\begingroup$ I do not quite understand how to put the point and get its coordinates. It is not clear how to select the image. How to select and put an end to. Thank you! $\endgroup$ – Alex Kulay Feb 3 '16 at 18:56
19
$\begingroup$

Let's start with an example set everyone (at least everyone with a recent Mathematica version) should be able to use:

frames = Image /@  ExampleData[{"TestAnimation", "ToyVehicles"}][[1, 1, All, 2]]

Start with an interesting point and follow that. To get a point, just select an image, press . and select your point and copy its coordinates using ctrl+c. In this case I selected a point on the car's grille.

pos = ImageFeatureTrack[frames, {{44.0889`, 213.333`}}]

{{{44.0889, 213.333}}, {{43.7442, 205.102}}, {{45.1014, 196.86}}, {{64.4982, 189.781}}, {{83.8232, 177.966}}, {{110.223, 169.809}}, {{153.965, 169.902}}, {{195.111, 167.888}}, {Missing[]}, {Missing[]}}

Mathematica was able to track the point up to the frame where the car turned too much.

Displaying the results:

Multicolumn[
  Show[
    frames[[#]], 
    Graphics[{Point[pos[[#]]], Red, Line[pos[[1 ;; #, 1]]]}]
  ] & /@  Range[Length@frames], 
  2, Appearance -> "Horizontal"
]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.