AprilTools icon indicating copy to clipboard operation
AprilTools copied to clipboard

estimate-focal-length does not work for 4K video

Open i124q2n8 opened this issue 5 years ago • 7 comments

I read #6 and filmed the footage according to the requirements. (.png, ~500 Frames) Running --estimate-focal-length on the footage yields only one estimate != -1.

Down scaling the sequence to 25% of the original resolution does work and yields useful results. Down scaling to 50% doesn't work either.

What is the optimal resolution to estimate the focal length?

Tracking on 50% with --focal-length-pixels {estimated focal length for 25% * 2} does work.

Maybe adding --focal-length-percent would be a nice addition to be independent from the actual resolution. Not sure whether this will work in general.

i124q2n8 avatar Sep 30 '19 07:09 i124q2n8

...Oh. Right. Of course it does!

I will fix that. That's a bug, which should be easy to fix. The focal length estimation uses vanishing points to estimate the focal length. It extends the sides of the square tag and finds intersection. To combat numerical instabilities, when the intersection is "too far away," it gives up, assuming that the sides are parallel. But the value for "too far away" was determined empirically on a fullHD footage. It should scale with the frame size, which it doesn't (such a dumb oversight :D) .

thegoodhen avatar Sep 30 '19 08:09 thegoodhen

It should be fixed. Can you please confirm it?

thegoodhen avatar Sep 30 '19 09:09 thegoodhen

Now i don't even get results with the down scaled version. I am going to look into this later.

i124q2n8 avatar Sep 30 '19 10:09 i124q2n8

Damnit. That makes no sense. Well, at least it changed, so the problem is somewhere close.

thegoodhen avatar Sep 30 '19 11:09 thegoodhen

Aha! I think I know. Is the tag small, or viewed mostly from the front?

thegoodhen avatar Sep 30 '19 11:09 thegoodhen

@MAP94 poke

thegoodhen avatar Oct 02 '19 21:10 thegoodhen

It is working for me with 4K footage!

Many thanks!

fvlasie avatar Feb 25 '20 19:02 fvlasie