balintlaczko / VideoAnalysis

Non-realtime video analysis, exporting motiongrams and various quantitative features of movement in the video file.
https://www.uio.no/ritmo/english/research/labs/fourms/downloads/software/VideoAnalysis/
1 stars 0 forks source link

Centroid snake is not scaled properly when exporting without cropping #69

Closed balintlaczko closed 4 years ago

balintlaczko commented 4 years ago

This probably has to do with some missing initialization of dim values. Steps to reproduce:

  1. Load bball.mov, play it back, the snake is at the right place.
  2. Load dance.avi, play it back, the snake is also scaled correctly.
  3. Stop playback and start exporting, then you see that the "snake-matrix" suddenly resets its dim and renders on the top left area. (and it is like that in the rendered file too)
  4. If you start real-time playback again after exporting, the snake is still at the wrong place.
  5. If you now switch Cropping on and off, the snake gets scaled properly again.
  6. If you start exporting again, the snake resets to its smaller version again.
balintlaczko commented 4 years ago

OK, looks like when we export, the (last drawn) cropping dim is applied no matter cropping is on or not. UPDATE: The problem occurs at [VA_cropping_data], which sends the stored cropping to the cropping rectangle while exporting even if cropping is not on. Working on it...

balintlaczko commented 4 years ago

OK, finally, it works. While implementing it I actually discovered several bad things happening when cropping is activated or deactivated, and some small structural issues... In the [VA_cropping_data] we are now logging the cropping state and cropping rect (the mouse start-end-diff array) for each item. If we want to extend the per-item-settings-recalling thing it might be wise to do it via extending the [dict VA_items]. So we can just save/recall the contents of the dict to save/recall the "session".