nothinglo/NISwGSP

How to run this repo

Opened this issue · 17 comments

  1. cd ./vlfeat-0.9.20 ; make
  2. Config the VLFEAT_LIBRARY according to issue [How to config the VLFEAT_LIBRARY] (#27)
  3. mv eigen eigen3
  4. vim Configure.h;
    Change #include <eigen3/Eigen/SVD> #include <eigen3/Eigen/IterativeLinearSolvers> to #include "eigen3/Eigen/SVD" #include "eigen3/Eigen/IterativeLinearSolvers"
  5. cd eigen3; mkdir build; cd build; cmake ..; make
  6. cd ./UglyMan_NISwGSP_Stitching; mkdir build; cd build; cmake ..; make
  7. Download input-42-data, you can find it in a link of Baidu cloud according to issue input-42- data.zip.
  8. Move [input-42-data] folder to your working directory.
  9. Run the repo according to readme.md.
  10. If you meet error like "The function/feature is not implemented (Implementation has been removed due original code license issues) in cv::LineSegmentDetectorImpl::LineSegmentDetectorImpl", you can change your opencv to the version of 3.0.0, or recomplie your opencv with opencv-contrib(Attention you should choose enable_nonfree when you compile opencv&opencv-contrib).

Excuse me, how to solve this problem?

OpenCV(3.4.1) Error: Assertion failed (s >= 0) in setSize, file /home/lab316/cmake_libraries/opencv/opencv-3.4.1/modules/core/src/matrix.cpp, line 235
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.1) /home/lab316/cmake_libraries/opencv/opencv-3.4.1/modules/core/src/matrix.cpp:235: error: (-215) s >= 0 in function setSize

I have no idea.

@li1997522 It seems like some error in your matrix, maybe you produce a negative value or out of range when processing data.

Screenshot from 2023-07-01 02-09-40
Screenshot from 2023-07-01 02-09-44

I'm getting the following errors in estimation . I have followed the exact instructions given above to build the project with CMake except i'm using the latest OpenCV 4.8.0 version .

@Luckykantnayak
I will give you some questions that I have encountered, and you can investigate them.

  1. Change your OpenCV version to 3.
  2. In Linux systems, I don't know why the input images won't be concatenated according to the order of their names, so you need to reorder them in the code. The Windows version does not have this issue.
  3. The input image size is inconsistent.

@li1997522 I'm not able to build Opencv 3.x.x versions with Opencv-contrib from source code in ubuntu machine with CMake , getting so many errors with configuration incomplete message nor I can find any pre built binaries . It'll be very helpful if you can share some source on how to do it . I'll definitely try to run windows. For the 3rd point , I'm using the images shared by the authors of GSP and GES-GSP which they themselves tested , so I'm not sure why input image size will be inconsistent.

@Luckykantnayak 1.You can find opencv file in https://opencv.org/releases/.
2.So just use two images to try the project.
3.And don't froget to change the txt file.

@li1997522 I have tried with two images for opencv 4.8.0 version , it is working fine. The problem is more than 3 images . Thanks for sharing . Are you building with CMake ? I can share my CMakeList.txt file.

Screenshot from 2023-07-05 16-55-40
@li1997522 Every time i try to build opencv 3.0.0 version with these steps i get the above error when running cmake command ( Not the case for opencv 4.x.x versions) . Kindly let me know to build opencv 3.0.0 version , it'll be a big help.

image
If you already stitched two images , it means that the project is fine. So opencv4 is ok for this project. So please see the second answer. The problem maybe is the images order.

@li1997522 I'm using same imagename_STITCH-GRAPH.txt file provided in the input-42-data folder by the author . By the way here is my C
MakeList.txt file . Screenshot from 2023-07-05 18-55-30
Let me know if it is correct.

image If you already stitched two images , it means that the project is fine. So opencv4 is ok for this project. So please see the second answer. The problem maybe is the images order.

It is indeed the problem with image filename order , we have to sort it before using in the multi_image class, it works fine now for all the input-42 data sets . Thank you so much for pointing out the problem @li1997522 , you are a life saver :) .

Screenshot from 2023-07-06 05-56-36
I have tried to run on my own dataset of 25 images (they have enough overlap as Autostich can generate the stitched image ) which is part of a 5x5 grid areal images of a field taken from UAV. But i'm getting the above erros of egen library , could you please help !!!! @li1997522

@Luckykantnayak I’m also find this problem too. But I forgot how to solve it.

Hi @li1997522 , have you tried using any MATLAB solver in c++ code for solving the Ax =b instead of LeastSquaresConjugateGradient in the MeshOptimization code ? It is mentioned that MATLAB solvers are signficantly faster , how significant are they ? The LeastSquaresConjugateGradient solver takes around 45 sec for 35 images to solve for Ax = b without multithreading . Hope , you can give some advice on it .

@Luckykantnayak Sorry I also saw this before. But I don't know how to use matlab solver in c++ code project. Maybe you can change c++ code project to matlab? Just try? And I just change the multithread number. I forgot it's help or not.

@li1997522 thanks for your suggestion. Did you set any multithreading in eigen library, so that the LeastSquaresConjugateGradient<SparseMatrix > lscg solver can use it ? I'm not sure how to make it work .
Screenshot from 2023-07-25 11-11-37
Screenshot from 2023-07-25 11-11-45
In the above file i have set the " Eigen::setNbThreads(8) " in main file and made some changes in the CMakeLists.txt file to use OpenMP , but i'm not seeing any reduction in the computation time for the lscg solver . Kindly suggest how to reduce the computation time for the lscg solver .

@Luckykantnayak . I have not set any multithreading in eigen library, I just try to change " Eigen::setNbThreads(8) ", Sorry. Wish you can find a way to make it fast.