SokratG / Surround-View

MIT License
149 stars 48 forks source link

Is it working on Windows ? #2

Closed psykokwak-com closed 2 years ago

psykokwak-com commented 2 years ago

Hi, Your job is amazing. Do you think it could be possible to have your software working on Windows ?

SokratG commented 2 years ago

Hi, Your job is amazing. Do you think it could be possible to have your software working on Windows ?

Hi, thank you. The current solution will not work on Windows. The "SVCamera.cpp" module uses Linux system calls and V4L2 calls. But this is just a module for reading data from cameras. For example, you can use cv::VideoCapture for your cameras and pass the data to the "SVStitcher.cpp" module. But first you must calibrate the intrinsic and extrinsic (relationship between cameras) parameters.

psykokwak-com commented 2 years ago

Hi, Thank you for your answer. So, if I replace SVCamera.cpp by my own, it would be possible to have it working on Windows ? Great, I'll try.

SokratG commented 2 years ago

Hi, Thank you for your answer. So, if I replace SVCamera.cpp by my own, it would be possible to have it working on Windows ? Great, I'll try.

Mmm... That's not enough for build on Windows. So today I have pushed some changes and removed Linux system signals(they were not needed). If you want build this on Windows:

  1. You must change SVCamera (read data from camera) as I mentioned earlier.
  2. You must edit CMakeLists.txt file. I set absolute path for GLFW and GLES libraries in dir("3dparty") of my project. Edit this path to your or just use find_package cmake call. If you have all dependencies after these two steps, it should build.
psykokwak-com commented 2 years ago

OK. I made it working on Windows 10. I had to add glew library to make opengl driver works. Now I will rewrite the SVCamera class. I forked at https://github.com/psykokwak-com/Surround-View

Could you tell me the procedure to generate new camera calibration files ?

SokratG commented 2 years ago

OK. I made it working on Windows 10. I had to add glew library to make opengl driver works. Now I will rewrite the SVCamera class. I forked at https://github.com/psykokwak-com/Surround-View

Could you tell me the procedure to generate new camera calibration files ?

So, the project has two directories with calibration data. First it's just calibration intrinsic parameters of cameras - focal length, optical centers and distortions -> they are stored in calibrationData directory. You do procedure calibration with some tools like OpenCV calib or Matlab calibration toolbox. Some notes about calibration: for different image resolution you will have different parameters that's important. Ok, You calibrate cameras and save them into files.

Then calibrate the extrinsic parameters. These extrinsic parameters relate to the rotation and translation of the cameras with each others. To calculate the parameters, I used the feature matching and bundle adjustment methods. You can find them in SVAutoCalib module. This module have full extrinsic calibration process and saved into files. Files you can find into "camparamters" directory. The files also have another intrinsic parameters, because parameters must recalibrated after distortion correction. These all can be done in SVAutoCalib module. Also method "init" in SVStitcher class can complete full setup process(see code) just pass your data from cameras. One more important note - I have 4 cameras, but I divide last camera image into two. Because good calibration of last with first camera images is pretty hard and the easy way to avoid this and just divide one image into two and align them later :)

P.S. Some notes: If you will use SVAutoCalib module the extrinsic calibration may take some times, because that's depends of feature matching process and therefore your overlapping region of the cameras. In the project I used ORB feature detection, but I don't recommend this algorithm, cause many outliers will be generated. Use better SIFT or BRISK. ORB is good if you wanna use autocalibration cameras on runtime when you want refine camera parameters. Also, you can use Homography matrix computation cameras with each other. And just mutliply them for get parameters, this must work, I guess. But bundle adjustment everything is needed for get good quality stitching images, because other methods give a rough parameters computation. So, I hope that's help you)