Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Terence Eden
Terence Eden
@Edent@mastodon.social  ·  activity timestamp 2 weeks ago

I've an extremely niche #video question.

I have a 360 / spherical camera. When I grab the videos from its SD card, they come out like this.

Is there an easy way to turn them into #EquiRectanguar format suitable for #photosphere viewing?

If I use the official camera app, it converts them. But the app doesn't work on modern Android phones!

Help, advice, and speculation all welcomed.

Video showing two circular views.
Video showing two circular views.
Video showing two circular views.
  • Copy link
  • Flag this post
  • Block
Tim Hutton
Tim Hutton
@timhutton@mathstodon.xyz replied  ·  activity timestamp last week

@Edent If you enjoy the nerdery and want optimal results, try calibrating it. Take some images of chessboards at different angles and feed into OpenCV or similar.

I'm guessing they do this in the factory and store the calibration in the firmware, to account for manufacturing variation.

  • Copy link
  • Flag this comment
  • Block
Terence Eden
Terence Eden
@Edent@mastodon.social replied  ·  activity timestamp last week

OK! Getting somewhere!

This is the ffmpeg filter which will convert fisheye to equirectangular.

`-vf "v360=input=dfisheye:output=equirect:ih_fov=189:iv_fov=189"`

But there's a slight issue with overlap. If you look closely at the above image, there's some cut-off around the sides.

I wonder if splitting the frames in two, re-paging them, and then combining would make it look better?

Circular image with cut off edges.
Circular image with cut off edges.
Circular image with cut off edges.
  • Copy link
  • Flag this comment
  • Block
Derick Rethans
Derick Rethans
@derickr@phpc.social replied  ·  activity timestamp last week

@Edent I think I'd try messing about with the `189` value.

Usually half a fish eye is 180°, not 189° — but I guess that's where the overlap comes from.

  • Copy link
  • Flag this comment
  • Block
Terence Eden
Terence Eden
@Edent@mastodon.social replied  ·  activity timestamp last week

@derickr Yeah, the vague specs I can find suggest each lens is 200⁰ - the sweet spot for decent enough stitching is around 190ish.

  • Copy link
  • Flag this comment
  • Block
Matt Ellery
Matt Ellery
@matt_ellery@mastodon.social replied  ·  activity timestamp 2 weeks ago

@Edent
Matt Parker @standupmaths made a video donkeys years ago messing about with spherical cameras. https://www.youtube.com/watch?v=x0gRcRd_rHs

Link to Henry's github: https://github.com/henryseg/spherical_image_editing

GitHub

GitHub - henryseg/spherical_image_editing: Editing spherical images/video using Möbius transformations

Editing spherical images/video using Möbius transformations - henryseg/spherical_image_editing
  • Copy link
  • Flag this comment
  • Block
Paul
Paul
@threedaymonk@sonomu.club replied  ·  activity timestamp 2 weeks ago

@Edent I think you can do it in ffmpeg with the v360 filter. Something like this, but you'll need to tweak the parameters a bit:

https://video.stackexchange.com/questions/37100/how-do-i-use-ffmpeg-to-stitch-220-degree-fisheyes-into-a-360-equirectangular-vid

Video Production Stack Exchange

how do i use ffmpeg to stitch 220-degree fisheyes into a 360 equirectangular video?

Quite a while back, I used a now-discontinued 360-degree camera called the YI 360 camera to record some videos. The software that came with the camera is no longer available, and to my knowledge, i...
  • Copy link
  • Flag this comment
  • Block
Mike Sheldon
Mike Sheldon
@mike@hendike.co.uk replied  ·  activity timestamp 2 weeks ago

@Edent Speculation: Might take some experimentation to get the right parameters, but ffmpeg's v360 filter will probably do what you want: https://ayosec.github.io/ffmpeg-filters-docs/7.1/Filters/Video/v360.html

v360 - FFmpeg 7.1.1 / Filters / Video

  • Copy link
  • Flag this comment
  • Block
Mike Sheldon
Mike Sheldon
@mike@hendike.co.uk replied  ·  activity timestamp 2 weeks ago

@Edent I'm guessing an input of dfisheye and output of equirect, might need some fiddling with the fov parameters too though

  • Copy link
  • Flag this comment
  • Block
Terence Eden
Terence Eden
@Edent@mastodon.social replied  ·  activity timestamp 2 weeks ago

@mike Cheers. Gives me something to go on. Mostly making noise right now - but I'm getting somewhere!

  • Copy link
  • Flag this comment
  • Block
Mike Sheldon
Mike Sheldon
@mike@hendike.co.uk replied  ·  activity timestamp 2 weeks ago

@Edent Best I've managed so far is simply: ffmpeg -i wrap.webp -vf v360=dfisheye:equirect -frames:v 1 unwrap.jpg

Was trying to see if there's a way to compensate for the duplication at the edges of the images, but haven't figured anything out yet

Sorry, no caption provided by author
Sorry, no caption provided by author
Sorry, no caption provided by author
  • Copy link
  • Flag this comment
  • Block
Terence Eden
Terence Eden
@Edent@mastodon.social replied  ·  activity timestamp last week

@mike ah, I need to tweak the horizontal and vertical field of view. Got it working now, thanks!

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.5 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct