1

Hi,

I'm using the tracking feature to track fish in order to estimate their burst swim speed.  My aim is to find the maximum speed over the interval on a frame by frame basis (25fps).  I've managed to get the data exported via html and then cut and paste into excel. I've then converted the coords and time string data to numbers. I then calculated the distance travelled between points using the Pythagorean theorem and converted to speed by dividing by the time between frames (0.04s in this case). This all seemed to work fine but when I go back and compare the speed displayed along the track as i click through it frame by frame my calculated values are exactly half those displayed. I'm pretty sure I've not done the calcs wrong so im wondering if the display value is off for some reason or if the coords have been exported incorrectly. Thanks for your help?

2

Hi,
First of all thank you for checking this.
It is very important that the results are right and I really appreciate these kind of tests.

willfig wrote:

This all seemed to work fine but when I go back and compare the speed displayed along the track as i click through it frame by frame my calculated values are exactly half those displayed.

Since it is exactly half the speed, the difference is most likely not how we computed the distance, but more likely how we get the frame time interval. My guess is that we get the same distance between points, but one of us use half the time frame interval of the other.

I get the time interval from the information contained in the file. One hypothesis that could explain this behavior is if the file is interlaced and the frame interval used for computations is actually the field interval (50 fields per second vs 25 frames per second). I'll have to double check that.

- How did you get to the 40ms value ?
- Can you post the info that Kinovea reads from the file ? Go to Help > Open log folder… > then open "log.txt" and look for the block of lines between the "--------------" lines.
It should look something like: [File] - Filename : fish.avi, [File] - Size (bytes) : 4024704, [Container] - Name: avi (AVI format), etc.
Post all the block if possible.
- Can you also go to menu Motion > High speed camera and read the fps value in the box. This is most probably what Kinovea is using for computations.

Thanks


Note: Euclidian distance = SQRT((xA - xB)² + (yA - yB)²).

3

Hi Joan,

I did a track on my reference scale, exported and calculated the distance and it is spot on.  So it seems there are no issues with the exported data.  So it definitely seems like it has to do with internal calcs to display the speed.  As you said, probably to do with frame rate.

I note that when I click that option to "set original speed" it says 50fps.  I've not clicked apply but if this is the value used then that would be the reason that speeds come out 2x what they should be for this video which is 25fps. I note when analysing a video which had 30fps that the speeds were still greater than what I calculated but not by double, it was more like a bit less than 1.5.  Again the value in the orginal speed box was 50fps.  So this would again make sense.  I did try chaning this value to the actual fps according to Kinovea time stamp but it didn't affect the displayed speed.  So I'm not sure what this does.  In answer to your questions:

- with 25fps, the time between frames is 1/25 sec or 40ms
- Log file info:  I don't see any "------------------------------". The file is .mts.  Here's what's in the log file after I open it:

2010-11-29 11:57:52,147 - INFO  - Kinovea.Root.RootKernel - Kinovea version : 0.8.7, (Production)
2010-11-29 11:57:52,147 - INFO  - Kinovea.Root.RootKernel - .NET Framework Version : 2.0.50727.3615
2010-11-29 11:57:52,147 - INFO  - Kinovea.Root.RootKernel - OS Version : Microsoft Windows NT 5.1.2600 Service Pack 3
2010-11-29 11:57:52,147 - INFO  - Kinovea.Root.RootKernel - Primary Screen : {Width=1920, Height=1200}
2010-11-29 11:57:52,147 - INFO  - Kinovea.Root.RootKernel - Virtual Screen : {X=0,Y=0,Width=3520,Height=1200}
2010-11-29 11:58:15,959 - ERROR - Kinovea.ScreenManager.ColorProfile - Error happenned while parsing color profile. We'll keep the default values.
2010-11-29 11:58:15,959 - ERROR - Kinovea.ScreenManager.ColorProfile - File we tried to read was :C:\Documents and Settings\wfig7057\Application Data\Kinovea\ColorProfiles\current.xml
2010-11-29 11:59:46,160 - ERROR - Kinovea.ScreenManager.ColorProfile - Error happenned while parsing color profile. We'll keep the default values.
2010-11-29 11:59:46,160 - ERROR - Kinovea.ScreenManager.ColorProfile - File we tried to read was :C:\Documents and Settings\wfig7057\Application Data\Kinovea\ColorProfiles\current.xml
2010-11-29 11:59:51,019 - ERROR - Kinovea.ScreenManager.ColorProfile - Error happenned while parsing color profile. We'll keep the default values.
2010-11-29 11:59:51,019 - ERROR - Kinovea.ScreenManager.ColorProfile - File we tried to read was :C:\Documents and Settings\wfig7057\Application Data\Kinovea\ColorProfiles\current.xml

- My motion menu only has two greyed out options, "Overview" and "Reverse"

4

Ah, yes. 0.8.7 has a not very verbose log level…
Please do the following:
- Go to the directory where you installed Kinovea, and open the file "logConf.xml".
- Look for the word "INFO" in capitals, and replace it with "DEBUG". (line should be: <level value="DEBUG"/>)
- Restart Kinovea, open the file, and check the log.

Note that the log file rolls over itself each time you open Kinovea, so you have to open it (or refresh it) after you actually open the video.

willfig wrote:

I note that when I click that option to "set original speed" it says 50fps.  I've not clicked apply but if this is the value used then that would be the reason that speeds come out 2x what they should be for this video which is 25fps.

I'm confident that the 25fps vs 50fps is coming from interlaced fields in the file, but would have to see the log to confirm.
Experimental version 0.8.11 will also trace more infos in this regard, if it's possible.

- with 25fps, the time between frames is 1/25 sec or 40ms

Yes but how did you know the video was 25fps? Is it a setting on the camcorder, info from another software like MediaInfo, etc. ?

I did try chaning this value to the actual fps according to Kinovea time stamp but it didn't affect the displayed speed.  So I'm not sure what this does.

A bug was fixed in the experimental versions recently to take this into account, but it will also change the actual play speed by half, so it may not be a viable workaround. (The real fix will be for Kinovea to find and use the proper frame rate of course)


willfig wrote:

My motion menu only has two greyed out options, "Overview" and "Reverse"

The new menu was also added more recently, but really it's the same as if you right click the image and do "set original speed".

Thanks

5

Hi Joan,

Log file output is at the end of this message.

On the frame rate...you raise and interesting question. My immediate answer is that I determined this from Kinovea...because the time interval of the output was 40ms and also by counting frames relative to the timer.  Now that I'm digging a bit deeper I'm not so sure this video is 25fps.  Its AVCHD lite format recorded on a Panisonic Lumix DMC-FT1. According to some reviews I've read it records at 30fps. Unfortunately the only program I've found that will open these files natively (other than Kinovea) is VLC.  But I can't find any file info here to see what it thinks the frame rate is. I can't even get the timer to work so I could try to step through frames to see how many there are per second. So ultimately I'm not sure. MediaInfo says its 25fps.  But technically it should be 30fps which would be 33ms between frames rather than the 40ms which it is showing.

The other video format I've been using is .wmv, recorded from a logitech web cam.  When I play this in windows media player and look at the statistics it says its 15fps but "actual rate" is about 29-30 (it bounces around a bit). MediaInfo says its 15fps.  When I analyse these files in Kinovea it usually says there is 30ms between frames (which would be 33fps) though occassionally I notice it has output that there is 40ms between frames (25fps). This camera apparantley delivers variable frames rates based on lighting.

So I'm not sure what the correct answer is here for either of these, or if Kiovea is getting it right or not.  I hope so as this interval is pretty important when calculating the burst swim speed as I'm doing.

Thanks for your help.


2010-11-30 12:07:06,425 - DEBUG - Kinovea.Root.Program - Kinovea starting.
2010-11-30 12:07:06,441 - DEBUG - Kinovea.Root.Program - Application level initialisations.
2010-11-30 12:07:06,441 - DEBUG - Kinovea.Root.Program - Show SplashScreen.
2010-11-30 12:07:06,519 - INFO  - Kinovea.Root.RootKernel - Kinovea version : 0.8.7, (Production)
2010-11-30 12:07:06,519 - INFO  - Kinovea.Root.RootKernel - .NET Framework Version : 2.0.50727.3615
2010-11-30 12:07:06,519 - INFO  - Kinovea.Root.RootKernel - OS Version : Microsoft Windows NT 5.1.2600 Service Pack 3
2010-11-30 12:07:06,519 - INFO  - Kinovea.Root.RootKernel - Primary Screen : {Width=1920, Height=1200}
2010-11-30 12:07:06,519 - INFO  - Kinovea.Root.RootKernel - Virtual Screen : {X=0,Y=0,Width=3520,Height=1200}
2010-11-30 12:07:06,519 - DEBUG - Kinovea.Services.PreferencesManager - System Culture: [en-US].
2010-11-30 12:07:06,519 - DEBUG - Kinovea.Services.PreferencesManager - Importing preferences.
2010-11-30 12:07:06,550 - DEBUG - Kinovea.Services.PreferencesManager - Culture from prefs: [en].
2010-11-30 12:07:06,566 - DEBUG - Kinovea.Root.RootKernel - Build the modules tree.
2010-11-30 12:07:06,816 - DEBUG - Kinovea.FileBrowser.FileBrowserKernel - Module Construction : FileBrowser.
2010-11-30 12:07:06,831 - DEBUG - Kinovea.Updater.UpdaterKernel - Module Construction : Updater.
2010-11-30 12:07:06,831 - DEBUG - Kinovea.ScreenManager.ScreenManagerKernel - Module Construction : ScreenManager.
2010-11-30 12:07:07,128 - DEBUG - Kinovea.VideoFiles.VideoFile - Constructing VideoFile.
2010-11-30 12:07:07,144 - DEBUG - Kinovea.ScreenManager.ThumbListView - Constructing ThumbListView
2010-11-30 12:07:07,238 - DEBUG - Kinovea.ScreenManager.ScreenManagerUserInterface - Constructing ScreenManagerUserInterface.
2010-11-30 12:07:07,331 - DEBUG - Kinovea.Root.RootKernel - Modules tree built.
2010-11-30 12:07:07,331 - DEBUG - Kinovea.Root.RootKernel - Create main UI window.
2010-11-30 12:07:07,394 - DEBUG - Kinovea.Root.RootKernel - Plug sub modules at UI extension points (Menus, ToolBars, StatusBAr, Windows).
2010-11-30 12:07:07,534 - DEBUG - Kinovea.Root.RootKernel - Register global services offered at Root level.
2010-11-30 12:07:07,534 - DEBUG - Kinovea.Root.RootKernel - Setting current ui culture.
2010-11-30 12:07:07,534 - DEBUG - Kinovea.Root.RootKernel - RefreshUICulture - Reload localized strings for the whole tree.
2010-11-30 12:07:07,550 - DEBUG - Kinovea.FileBrowser.FileBrowserKernel - Refresh UI Culture at FileBrowser level.
2010-11-30 12:07:07,550 - DEBUG - Kinovea.ScreenManager.ScreenManagerKernel - Refresh UI Culture at ScreenManager level.
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.RootKernel - RefreshUICulture - Whole tree culture reloaded.
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.RootKernel - Initial configuration:
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.RootKernel - InputFile :
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.RootKernel - SpeedPercentage : 100
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.RootKernel - StretchImage : False
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.RootKernel - HideExplorer : False
2010-11-30 12:07:07,550 - DEBUG - Kinovea.Root.Program - Close splash screen.
2010-11-30 12:07:07,581 - DEBUG - Kinovea.Root.Program - Launch.
2010-11-30 12:07:07,581 - DEBUG - Kinovea.Root.RootKernel - Calling Application.Run() to boot up the UI.
2010-11-30 12:07:07,644 - DEBUG - Kinovea.Services.PreferencesManager - Exporting preferences.
2010-11-30 12:07:07,722 - DEBUG - Kinovea.FileBrowser.FileBrowserUserInterface - Application is idle in FileBrowserUserInterface.
2010-11-30 12:07:07,722 - DEBUG - Kinovea.FileBrowser.FileBrowserUserInterface - Load initial directory.
2010-11-30 12:07:07,722 - DEBUG - Kinovea.FileBrowser.FileBrowserUserInterface - DoRefreshFileList called
2010-11-30 12:07:07,722 - DEBUG - Kinovea.FileBrowser.FileBrowserUserInterface - Updating file list : lvExplorer
2010-11-30 12:07:07,722 - DEBUG - Kinovea.FileBrowser.FileBrowserUserInterface - List updated
2010-11-30 12:07:07,722 - DEBUG - Kinovea.FileBrowser.FileBrowserUserInterface - Asking the ScreenManager to refresh the thumbnails.
2010-11-30 12:07:07,722 - DEBUG - Kinovea.ScreenManager.ThumbListView - New set of files asked, currently having 0 loaders
2010-11-30 12:07:07,722 - DEBUG - Kinovea.ScreenManager.ScreenManagerUserInterface - Application is idle in ScreenManagerUserInterface.
2010-11-30 12:07:36,643 - DEBUG - Kinovea.VideoFiles.VideoFile - Constructing VideoFile.
2010-11-30 12:07:36,643 - DEBUG - Kinovea.ScreenManager.PlayerScreen - Constructing a PlayerScreen.
2010-11-30 12:07:36,674 - DEBUG - Kinovea.ScreenManager.PlayerScreenUserInterface - Constructing the PlayerScreen user interface.
2010-11-30 12:07:36,721 - DEBUG - Kinovea.ScreenManager.Metadata - Constructing new Metadata object.
2010-11-30 12:07:36,721 - DEBUG - Kinovea.ScreenManager.Metadata - Metadata hash reset. New reference hash is: 0
2010-11-30 12:07:36,831 - DEBUG - Kinovea.ScreenManager.ColorProfile - Loading color profile from xml file.
2010-11-30 12:07:36,846 - ERROR - Kinovea.ScreenManager.ColorProfile - Error happenned while parsing color profile. We'll keep the default values.
2010-11-30 12:07:36,846 - ERROR - Kinovea.ScreenManager.ColorProfile - File we tried to read was :C:\Documents and Settings\wfig7057\Application Data\Kinovea\ColorProfiles\current.xml
2010-11-30 12:07:36,877 - DEBUG - Kinovea.VideoFiles.VideoFile - ---------------------------------------------------
2010-11-30 12:07:36,877 - DEBUG - Kinovea.VideoFiles.VideoFile - Entering : LoadMovie()
2010-11-30 12:07:36,877 - DEBUG - Kinovea.VideoFiles.VideoFile - Input File                        : 17deg_burstswimHMB2_20100601.MTS
2010-11-30 12:07:36,877 - DEBUG - Kinovea.VideoFiles.VideoFile - File Size:101548032.
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Total Streams                    : 2
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Stream #0
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -     Type                        : CODEC_TYPE_VIDEO
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -     Language                    :
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -     NbFrames                    : 0
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Stream #1
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -     Type                        : CODEC_TYPE_AUDIO
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -     Language                    :
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -     NbFrames                    : 0
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Codec                            : (28)
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Duration (frames) if available    : 0
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Duration (µs)                    : 53024000
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Format[Stream] timeBase            : 90000:1
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Codec timeBase                    : 50:1
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Average timestamps per seconds    : 90000
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Duration in timestamps            : 4772160
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Duration in seconds    (computed)    : 53.024
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Average Fps estimation method    : Codec context timebase.
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Average Fps                        : 50
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Average Frame Interval (ms)        : 20
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Start time (µs)                    : 378156
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - First timestamp                    : 34034
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Width (pixels)                    : 1280
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Height (pixels)                    : 720
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Display Aspect Ratio type        : Square Pixels
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Image aspect ratio is on : AutoDetect.
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile -
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - Exiting LoadMovie
2010-11-30 12:07:37,096 - DEBUG - Kinovea.VideoFiles.VideoFile - ---------------------------------------------------
2010-11-30 12:07:37,143 - DEBUG - Kinovea.ScreenManager.FrameServerPlayer - Setup metadata.
2010-11-30 12:07:37,143 - DEBUG - Kinovea.ScreenManager.Metadata - Metadata hash reset. New reference hash is: 0
2010-11-30 12:07:37,159 - DEBUG - Kinovea.ScreenManager.Metadata - Importing Metadata from XML description.
2010-11-30 12:07:37,221 - DEBUG - Kinovea.ScreenManager.TrackerBlock2 - Template matching: Image:1280x720, Template:{Width=64, Height=36}, Search Window:{Width=256, Height=144}, Similarity thr.:0.5, Tpl update thr.:0.8
2010-11-30 12:07:37,237 - DEBUG - Kinovea.ScreenManager.TrackerBlock2 - Template matching: Image:1280x720, Template:{Width=64, Height=36}, Search Window:{Width=256, Height=144}, Similarity thr.:0.5, Tpl update thr.:0.8
2010-11-30 12:07:37,237 - DEBUG - Kinovea.ScreenManager.Metadata - Metadata hash reset. New reference hash is: 699478413
2010-11-30 12:07:37,237 - DEBUG - Kinovea.VideoFiles.VideoFile - Seeking to [1711634]
2010-11-30 12:07:37,315 - DEBUG - Kinovea.VideoFiles.VideoFile - First decoded frame [1747634] already after target. Force seek back 1 second to [1621634]
2010-11-30 12:07:37,737 - DEBUG - Kinovea.VideoFiles.VideoFile - Seeking to [34034]
2010-11-30 12:07:37,752 - DEBUG - Kinovea.VideoFiles.VideoFile - First decoded frame [62834] already after target. Force seek back 1 second to [0]
2010-11-30 12:07:37,768 - DEBUG - Kinovea.ScreenManager.FrameServerPlayer - Setup metadata.
2010-11-30 12:07:37,768 - DEBUG - Kinovea.ScreenManager.Metadata - Metadata hash reset. New reference hash is: -1666653048
2010-11-30 12:07:37,799 - DEBUG - Kinovea.ScreenManager.ScreenManagerUserInterface - Closing thumbnails to display screen.
2010-11-30 12:07:37,893 - DEBUG - Kinovea.ScreenManager.ScreenManagerUserInterface - Closing thumbnails to display screen.
2010-11-30 12:07:43,362 - DEBUG - Kinovea.ScreenManager.PlayerScreenUserInterface - PlayerScreen multimedia timer started.
2010-11-30 12:07:46,002 - DEBUG - Kinovea.ScreenManager.PlayerScreenUserInterface - PlayerScreen multimedia timer stopped.
2010-11-30 12:07:51,190 - DEBUG - Kinovea.Services.PreferencesManager - Exporting preferences.
2010-11-30 12:07:53,674 - DEBUG - Kinovea.Services.PreferencesManager - Exporting preferences.
2010-11-30 12:07:59,627 - DEBUG - Kinovea.Services.PreferencesManager - Exporting preferences.