georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
857 stars 109 forks source link

Specify focus area #25

Open sxe opened 9 years ago

sxe commented 9 years ago

Hi, i tried vid.stab and it's really cool but i often have one problem. The stabilization focuses on the wrong object. When i have a scene with a person in the foreground and want to remove the shakiness of the background it always makes it worse cause vid.stab tries to stabilize the person and not the background. This makes it look like the camera is attached to the persons head, what is a nice effect but not always wanted. :)

Would be great to be able to define a point, region or maybe even a line vid.stab can take as a reference. Hugin http://hugin.sourceforge.net/ allows this, it's called control points there.

Let me know what you think.

Greetings

georgmartius commented 9 years ago

Hi,

yeah that is would be indeed a useful feature. The question is how to exactly specify the foreground. One option would be to simply restrict the motion detection to the center of the image. A more fancy approach would be to specify certain points, but they may move during the video. So one has to track them. What if these objects go out of the scene? What do you think is required.

Regards, Georg

gabrielstuff commented 9 years ago

Well, first implementation should specify a zone and simply try to adjust the image to make the zone stab. More advanced features would allow tracking the zone, and allow feature tracking algorithm to follow the moving zone, this looks like a far more advanced process.

sxe commented 9 years ago

Sry i have no technical background in video processing, so i cannot really make good suggestions here. I just noticed my problem and saw that you can handle these situations in Hugin. You can for example mark a horizontal edge and hugin tries to keep that specific edge in the same spot.

Here is an awesome hugin tutorial: http://imgur.com/a/3qfWQ . Step 3 describes what i am talking about.

Greetings

gabrielstuff commented 9 years ago

This tutorial is wonderful ! Exactly what i need.

brucechase commented 7 years ago

There is a use case for which a rectangle that describes the boundary of area for which to calculate the translation. That is for 360x180 or 180x180 videos. If one wants the video to deshake relative to a common spot on the video (very center for instance for a 200x100 pixel area).

This raises a question. For the above example, can one crop a larger video to a small centered rectangle, get the transforms with Vid.Stab, and then apply the transforms to the larger original video? I have not tried it.

georgmartius commented 7 years ago

The idea of cropping it and then using the transforms for the original video should work. I have not tried it myself either. For low-res videos, check the size of the detection fields etc (using the show option), I am not sure they are properly put with the default options. Good luck!

brucechase commented 7 years ago

I will give it a shot and let you know. If it does work, it will be very useful for 360 or 180 videos for which there is a central viewpoint for a moving camera. With Google moving to a 180x180 degree format for the YouTube in order to bring down the bandwidth (and thus allow higher quality "360" videos) and since the viewer of these videos is confined 70+ percent of the time to a forward central view, stabilization of the center is more important as compared to stabilization of the outer viewing angles. This is especially true of a faster-than-a-walk moving camera.

On Thu, Jul 13, 2017 at 12:07 PM, Georg Martius notifications@github.com wrote:

The idea of cropping it and then using the transforms for the original video should work. I have not tried it myself either. For low-res videos, check the size of the detection fields etc (using the show option), I am not sure they are properly put with the default options. Good luck!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/georgmartius/vid.stab/issues/25#issuecomment-315125048, or mute the thread https://github.com/notifications/unsubscribe-auth/ACqR9wUqYOKICsFkMcO-wdHeRJvxr_Fhks5sNkDNgaJpZM4DtjYz .

--


Bruce Chase 413 Inglewood Drive Westerville, OH 43081

(614) 638-8094 (cell) (614) 890-0006 (home)