fourMs / VideoAnalysis

A standalone application for creating visualizations and extract motion features from video files.
https://www.uio.no/ritmo/english/research/labs/fourms/downloads/software/VideoAnalysis/
8 stars 2 forks source link

Box and centroid video has wrong format for inverted colours #9

Open alexarje opened 4 years ago

alexarje commented 4 years ago

When exporting with inverse colours the box video and centroid videos have the wrong format. Looks like they only take up a small part on the left of the screen:

Screen Shot 2020-02-26 at 11 12 17

alexarje commented 4 years ago

This also goes for the motion video exported when using inverted.

aleksati commented 4 years ago

Might have something to do with the [jit. @op absdiff] stuff we added at the very end to the [VA_motion_image] and/or [mgt.toggle.rgb2luma2absdiff] , @balintlaczko . It makes sense that these would affect the motion image, box and centroid processing.

alexarje commented 4 years ago

Looks more like stitching together several images with jit.glue or something like that? But it is only for the inverted video. And it looks nice in the preview.

balintlaczko commented 4 years ago

O-o, that doesn't look good. I have never seen it before though. Yes, it could be the last minute change, which was not tested so thoroughly, but this seems to be a problem with dims and not colors, and that change was (or at least meant to be) a simple color op. Seems like something unintended happens when we switch to inverted colors.

balintlaczko commented 4 years ago

So far I could not manage to reproduce this problem on Windows. Things I have tried include:

@alexarje, can you give some info about what you did when the issue happened?

balintlaczko commented 4 years ago

@AleksanderTidemann can you try reproducing this? Maybe it is an OSX thing? I couldn't manage to get it...

aleksati commented 4 years ago

First off, @balintlaczko , I´m experiencing that the same Bbox threshold generates very different videos when switching from inverted to normal colors in realtime. Like this:

ezgif com-video-to-gif (notice the Bbox display)

I will do some more testing with export.

aleksati commented 4 years ago

Different but related bug can be seen here with the bbox:

ezgif com-resize

So it seems that the scaling (or the "bbox-cropping") depends on the color of the image to a considerable amount. I guess this is kind of related to issue #30 , both dealing with problems with inverted videos.

aleksati commented 4 years ago

My experience is that all of the exported videos correspond to the behavior in the Bbox Display, except for "movie.mp4" in the test_videos folder. This could be related to what I experience in issue #20 , that there are some videos that produce strange behavior in the app.

I tested the inverted dance.mp4 with skipping and trimming in:

In all of these, I was able to reproduce this exact same behavior: (The gif shows how the movie is in realtime, versus the exported version of the same video)

ezgif com-video-to-gif Note: the flickering in the exported video shown is much more intense in real-life but is tuned down by the framerate of the gif.

So the answer is No, I have not yet been able to reproduce what Alexander experienced but did uncover strange behavior with specific videos (f.instance dance.mp4) and Bbox processing when switching from normal to inverted colors.

balintlaczko commented 4 years ago

What Alexander experienced is clearly an inappropriate dim problem, the image is squeezed horizontally. Otherwise, regarding the box image, both the change in behavior due to the color flip and the flickering is normal, if we strictly look at the process behind it. None of that is a bug. If we want to get rid of the flickering I have two suggestions:

I guess this should be an enhancement for the "more functionality" milestone, I will make an issue for that in a moment. The original problem is still a question mark.

aleksati commented 4 years ago

Good point! Sounds like an enhancement for the next version, yes.

balintlaczko commented 4 years ago

I think I finally reproduced the bug, though a bit accidentally while working on another issue. It was something about the greyscale option and changing the matrices' planecount. It was pretty consistent, I could manage to reproduce it several times in a row with the exact same results. (I think I was going from greyscale to non-greyscale and inverted -> render to do it, but not sure...) Also noticed a warning in the help file for [jit.record] that it only handles 4-plane matrices. So I added a conversion to 4-plane before the record (if needed) in [mgt.write-to-file] and the problem disappeared, I think that was it. But let's test some more on both platforms, and if we really don't see it again in a long time we can close this...

alexarje commented 4 years ago

Cool that you found it. I have my macbook in the office, and can test on Monday.

aleksati commented 4 years ago

Woo, nice catch! That makes sense actually, that there could be issues with going from 1 to more planes in an export scenario. We had similar issues in other places.