run ExampleFisheyeToEquirectangular.java

35 views
Skip to first unread message

Tchana Lorna

unread,
Apr 4, 2025, 1:51:33 PMApr 4
to BoofCV
Hello everyone please help me. I'm trying to run ExampleFisheyeToEquirectangular.java , a code I saw on this page https://boofcv.org/index.php?title=Example_Fisheye_To_Equirectangular  but I'm having trouble because of the absence of certain libraries such as boofcv-visualize, boofcv-factory and others, I can't find them anywhere. I've even gone through Maven but nothing. What can I do to solve the library problems and run this code?

Oleg Vakulenko

unread,
Apr 5, 2025, 1:31:39 PMApr 5
to BoofCV
Hello.
I may not be answering your question exactly.
Some time ago I experimented with a similar question and looked at this example. I don't remember what was there with those libraries, but in fact the problem is different.
With all due respect to the author of this really good library, the existing mechanisms will not give you the desired result. I mean you will not get a high-quality stitching of two frames.
There are a lot of subtleties and problems, starting from calibrating your camera, to numerous algorithms that need to be applied to get a truly seamless image.
A couple of years ago I made a special solution for the GoPro Fusion camera, but there is a lot of code.
But I don't know your task, so I don't know if my idea is useful.

Tchana Lorna

unread,
Apr 7, 2025, 7:23:38 AMApr 7
to BoofCV
Thank you very much Oleg for your reply. I have two 180-degree fov images and I want to obtain an equirectangular image from them. Equirectangular, because it will allow me to go from equirectangular to cubic, or other forms of projections. All the code I find on the net uses the equirectangular version of an image to achieve all the other shapes, but I want to understand a little more in depth the different mechanisms for obtaining the equirectangular image. Of course, if there is a code it would be very useful.

Oleg Vakulenko

unread,
Apr 7, 2025, 7:54:24 AMApr 7
to boo...@googlegroups.com
In my development, I also focused on the Equirectangular projection. When there is such an image, then getting others is a very simple and understandable mathematics. I needed to get a solution for independently creating virtual tours from the specified camera. But if these are just two separate images created when rotating the same camera, then everything will become much more complicated, because each time you need to recalibrate the mismatch of the two frames.
And as for the code. I don’t want to scare you, but to implement the necessary it took about 500K characters. That’s where mathematics and converting color models are needed, and including modifying the code of the library itself, which the author approved (you can look at my commit and what problems there were). Moreover, that code was written for a very long time (at least six months). It’s just that the task is really complicated.
So I’m not even ready to assume that it’s easier to understand my code or write it for you again.
We can talk about this, maybe I can give you some advice, even though it wasn't yesterday.

--
You received this message because you are subscribed to the Google Groups "BoofCV" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boofcv+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/boofcv/f886b444-9542-460e-9f0d-ed21a670e14cn%40googlegroups.com.

Oleg Vakulenko

unread,
Apr 7, 2025, 8:16:24 AMApr 7
to boo...@googlegroups.com
If you're interested, here's the result of my solution.
If I'm not mistaken, the tripod in the frame with the bright sun is only slightly retouched.
And in general, this is a completely automatic process.
The stitching location can only be found if you know where to look.
Although I can agree that this result can be improved, if there is a desire.

https://drive.google.com/drive/folders/1i6ZhhswD7sbaC91HFOGezBAdJItvXIas?usp=sharing

Tchana Lorna

unread,
Apr 7, 2025, 11:37:29 AMApr 7
to BoofCV
In fact, it's two fisheye cameras back to back, I get both images at the same time and not one after the other. Thank you very much, I'm interested in your advice and documentation if you have any on the subject; especially concerning the equirectangular image.

Oleg Vakulenko

unread,
Apr 7, 2025, 11:56:45 AMApr 7
to boo...@googlegroups.com
You see, the problem there is not in the projections or their conversion between each other. These are well-known formulas.
You will see the problems when you see how your two real images are aligned in real conditions, especially in the sun. You will see that they simply do not fit together if you do not know absolutely exactly all 6! parameters (displacements and angles). And the greater the distance from the focal point of the image, the greater the differences due to parallax.
By the way, what kind of camera do you have?
Have you already calibrated it using this library, as described, using a checkerboard pattern?

Jessie

unread,
Apr 7, 2025, 5:55:02 PMApr 7
to BoofCV

Hi Oleg, excuse me for interfering in this conversation, it's because I have the same problem. I use a dual fisheyes of Fov 185 degrees and my goal is to obtain an equirectangular image from these two images. I've already calibrated the cameras with boofcv and here are the results:

pinhole:

  fx: 1148.3072510496418

  fy: 1140.8566537477639

  cx: 952.8990928989521

  cy: 536.251359697893

  width: 1920

  height: 1080

  skew: 0.0

model: omnidirectional_universal

radial_tangential:

  radial:

  - -0.3205396576950746

  - 0.019720343341816583

  t1: 0.0

  t2: 0.0

version: 0

mirror_offset: 1.2306787629427736 my aim was to straighten the images, which was done but with a loss of informations.

your advice will be most welcome, as well as documentation if possible, as the calculations that you find trivial were difficult for me to understand 😅.

Oleg Vakulenko

unread,
Apr 7, 2025, 7:01:23 PMApr 7
to boo...@googlegroups.com
Hello.
I said about triviality not in the sense that it is elementary for me or for someone. I meant in comparison of complexity between different components of this problem. For example, conversion between projections is just a few formulas. However, even just docking two opposite images without having exact values of differences (angles and displacements) the problem is much more complicated.

Oleg Vakulenko

unread,
Apr 7, 2025, 7:06:54 PMApr 7
to boo...@googlegroups.com
Check out this site. I found a lot of useful stuff there at one time:
https://paulbourke.net/panorama/

Oleg Vakulenko

unread,
Apr 7, 2025, 7:09:02 PMApr 7
to boo...@googlegroups.com
185 degrees is too small for a fisheye, in my opinion. It will most likely be difficult to find a way to stitch the images together qualitatively.
What kind of camera is this?

Oleg Vakulenko

unread,
Apr 7, 2025, 7:22:48 PMApr 7
to boo...@googlegroups.com
I uploded an example that I experimented with when I was developing my version.
According to the link, there is a Multiplex on the wall.
There you can clearly see what problems there are with trying to combine two opposite images. And no matter how you try to move them relative to each other, it won't get any better. And this is because it is already the most "good" option, when the differences are acceptably minimal.
And then you can see that the two frames are very different in lighting, and this is provided that they were shot indoors. And this is also simply not corrected.
So the task is just to have fun :)

Oleg Vakulenko

unread,
Apr 7, 2025, 7:43:52 PMApr 7
to boo...@googlegroups.com
I also added a few documents that I used as a reference.
But there is no ready-made code there, only theory and formulas.
It can help, although there is quite a lot more there to create a complex solution...

Tchana Lorna

unread,
Apr 8, 2025, 7:45:26 AMApr 8
to BoofCV
Thank you so much for your help. I'm going to go through this documentation in depth.

Oleg Vakulenko

unread,
Apr 8, 2025, 8:11:15 AMApr 8
to boo...@googlegroups.com
Please reach out. Maybe if you are really serious about this development, we can try to find a way to collaborate.

Reply all
Reply to author
Forward
0 new messages