Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run this repo #34

Open
SHIsue opened this issue Feb 1, 2021 · 17 comments
Open

How to run this repo #34

SHIsue opened this issue Feb 1, 2021 · 17 comments

Comments

@SHIsue
Copy link

SHIsue commented Feb 1, 2021

  1. cd ./vlfeat-0.9.20 ; make
  2. Config the VLFEAT_LIBRARY according to issue [How to config the VLFEAT_LIBRARY] (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).
@li1997522
Copy link

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.

@SHIsue
Copy link
Author

SHIsue commented Apr 16, 2021

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

@Luckykantnayak
Copy link

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 .

@li1997522
Copy link

li1997522 commented Jul 5, 2023

@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.

@Luckykantnayak
Copy link

Luckykantnayak commented Jul 5, 2023

@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.

@li1997522
Copy link

@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.

@Luckykantnayak
Copy link

Luckykantnayak commented Jul 5, 2023

@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.

@Luckykantnayak
Copy link

Luckykantnayak commented Jul 5, 2023

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.

@li1997522
Copy link

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.

@Luckykantnayak
Copy link

Luckykantnayak commented Jul 5, 2023

@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.

@Luckykantnayak
Copy link

Luckykantnayak commented Jul 5, 2023

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 :) .

@Luckykantnayak
Copy link

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

@li1997522
Copy link

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

@Luckykantnayak
Copy link

Luckykantnayak commented Jul 13, 2023

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 .

@li1997522
Copy link

@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.

@Luckykantnayak
Copy link

@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 .

@li1997522
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants