Coder Social home page Coder Social logo

nothinglo / niswgsp Goto Github PK

View Code? Open in Web Editor NEW
328.0 328.0 123.0 85.67 MB

C++ implementation of the ECCV 2016 paper, Natural Image Stitching with the Global Similarity Prior.

C++ 6.91% Makefile 2.91% MATLAB 17.25% HTML 6.73% CSS 1.38% Python 3.25% Clean 0.29% TeX 0.29% Shell 0.07% C 59.25% Roff 0.47% Objective-C 1.20%

niswgsp's People

Contributors

nothinglo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

niswgsp's Issues

How to output the original image size

Hi, I would like to ask which code to change to output the original image size instead of the image size after scaling. For example, I have 6 images of 5472×3078 size, and I want the final stitching to be around 5000×8000 size, not 900×1300.

How to run this repo

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

run error

sorry to bother you again, I found missing constructor function in ImageData.h, and after adding it in this file, there exists an error, I found the error is in the function of doFeatureMatching() which in the file named MultiImages.cpp. And the error is map/set iterator not dereferencable, I am feeling confused. Looking forward to your reply. Thanks!

nan appears in vector b

When I run the program, thear are NANs in the vector b of least square problem Ax=b. How to deal with the problem?

compile issues

I compiled the code in linux system,I follow the Usage , but I met some problem, I want to know your compiler and it's version, I use gcc-4.9, it reports "/projects/NISwGSP_Stitching/Stitching/../Mesh/../Feature/../Mesh/Mesh2D.h:36:17: error: ‘class std::vector’ has no member named ‘emplace_back’",it looks like the compiler issue , would you have linux version or can you tell me you compiler and it's version,Thanks!

No results

My OpenCV version is 3.4.14, because it gives me the "No LineSegmentDetector error" when I execute the exe file, so I use FastLineDetector instead, this time no error accur, but there was no results in "0_results" dir. Just feature_pairs-sRANSAC-09-10-398.jpg type image in "1_debug" dir.

Hey bro~

You are handsome guy, not ugly~

A Problem Occured Whien Compiling

Hi, when I was following the steps from Yannnnnnnnnn, there is an error saying LINE_AA was not declared in this scope. So how should I solve it?

what is the meaning of rect?

image
Like this pic, you can see the rect in the final part. It seems to blend the final result, But what is the meaning of this coordinate? I can't find the corresponding results in the pictures in the debug folder.

run error

Thank you for your great work!
When I tried to run the project, I encountered the porblem

dyld: Library not loaded: @loader_path/libvl.dylib
  Referenced from: /Users/edgar/Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-avkbgtjifaqusvduuahpvnwdybht/Build/Products/Debug/UglyMan_NISwGSP_Stitching
  Reason: image not found```

How to prepare the file of STITCH-GRAPH.txt?

Hello, This is a good work! I am interested in your work.

I have successfully compile your code in Win7 system. But when I run with images you provided, I found there are no "***STITCH-GRAPH.txt" file. Could you give me some examples about STITCH-GRAPH file, or how to prepare this file? Thank you very much.

complie error

CMakeFiles/NISwGSP.dir/Feature/FeatureController.cpp.o:在函数‘FeatureController::detect(cv::Mat const&, std::vector<cv::Point_, std::allocator<cv::Point_ > >&, std::vector<FeatureDescriptor, std::allocator >&)’中:
FeatureController.cpp:(.text+0x483):对‘vl_sift_new’未定义的引用
FeatureController.cpp:(.text+0x4af):对‘vl_sift_process_first_octave’未定义的引用
FeatureController.cpp:(.text+0x4d1):对‘vl_sift_detect’未定义的引用
FeatureController.cpp:(.text+0x548):对‘vl_sift_calc_keypoint_orientations’未定义的引用
FeatureController.cpp:(.text+0x5e9):对‘vl_sift_calc_keypoint_descriptor’未定义的引用
FeatureController.cpp:(.text+0xa58):对‘vl_sift_process_next_octave’未定义的引用
FeatureController.cpp:(.text+0xa69):对‘vl_sift_delete’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/NISwGSP.dir/build.make:553: recipe for target 'NISwGSP' failed
make[2]: *** [NISwGSP] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/NISwGSP.dir/all' failed
make[1]: *** [CMakeFiles/NISwGSP.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

input-42- data.zip

Hello, how can I get input-42- data.zip , web link cannot be accessed.

Test examples bug

I successfully compiled the *.exe file on Windows.When I run the examples you provided,Some of them work properly to get results. But most of examples get bug as following:
image

I'm a new programmer,can't find out where bug is!! Please help me to solve this problem or teach me how to debug! Please!!!

No resulting image is output

Hello! My code compiled successfully, but the program seemed to break before it finished executing. The result is shown in figure. Can you tell me what's wrong? I'd appreciate it!
image

way of collecting the images

Hi, would you mind tell me the way you collected the images? By one camera or a multi-camera integrated device? If one, which kind of camera do you use? Thank you.

compile issues

I met some problems when compiling your code.Can you tell me what is your code compilation environment?

how does it happen?

nThreads = 1
[#Images : 1]
i = 1, [Images : dataset25]
[ERROR] F(getImageFileFullNamesInDir) could not open directory
[ERROR] F(getImagesMatchGraph) image match graph verification [2] didn't be implemented yet
[ERROR] F(getImagesMatchGraph) image match graph verification [2] didn't be implemented yet
[ERROR] F(getImagesMatchGraph) image match graph verification [2] didn't be implemented yet
[ERROR] F(getImagesMatchGraph) image match graph verification [2] didn't be implemented yet
A = [2, 0]
NISwGSP: /usr/include/eigen3/Eigen/src/SparseCore/SparseMatrix.h:916: void Eigen::internal::set_from_triplets(const InputIterator&, const InputIterator&, SparseMatrixType&, DupFunctor) [with InputIterator = __gnu_cxx::__normal_iterator<Eigen::Triplet*, std::vector<Eigen::Triplet > >; SparseMatrixType = Eigen::SparseMatrix; DupFunctor = Eigen::internal::scalar_sum_op]: Assertion `it->row()>=0 && it->row()<mat.rows() && it->col()>=0 && it->col()<mat.cols()' failed.
Aborted (core dumped)

a runtime error

I managed to compile and run on linux with gcc 6 but met a runtime error. The debugging feature pair and line result files were well generated, but not the stitching files. It was nothing wrong when processing some example images like AANAP-skyline and APAP-railtracks. But when I tried some other examples e.g. AANAP-roundabout, an OOM happened in MultiImages::textureMapping, at this line:
Mat polygon_index_mask(rects[i].height + shift.y, rects[i].width + shift.x, CV_32SC1, Scalar::all(NO_GRID));

roundabout0 rect = [1.17309e+06 x 1.58113e+06 from (2.06305e+06, 1.13368e+06)]
roundabout3 rect = [2.15131e+06 x 3.12946e+06 from (765193, 0)]
roundabout1 rect = [1.88212e+06 x 1.3209e+06 from (952085, 1.66553e+06)]
roundabout2 rect = [5.51731e+06 x 3.61797e+06 from (0, 36694.4)]
OpenCV Error: Insufficient memory (Failed to allocate 7419210561064 bytes) in OutOfMemoryError, file /UglyMan_NISwGSP_Stitching/opencv-3.0.0/modules/core/src/alloc.cpp, line 52
OpenCV Error: Assertion failed (u != 0) in create, file /UglyMan_NISwGSP_Stitching/opencv-3.0.0/modules/core/src/matrix.cpp, line 411
terminate called after throwing an instance of 'cv::Exception'
what(): /UglyMan_NISwGSP_Stitching/opencv-3.0.0/modules/core/src/matrix.cpp:411: error: (-215) u != 0 in function create

When processing APAP-garden, the output is:
DSC02931 rect = [9153.74 x 7622.71 from (9500.55, 56574)]
DSC02933 rect = [93026.5 x 130673 from (0, 0)]
DSC02930 rect = [4716.9 x 4616.46 from (7974, 57841.4)]
DSC02932 rect = [4582.3 x 5106.73 from (8343.71, 57186.2)]
DSC02934 rect = [1329.46 x 1211.29 from (11132, 60498.9)]
other errors are the same

I tried to debug and found if I comment these lines in MultiImages::getCameraParams, the program can run without error, but with a wrong result:
if (!(*adjuster)(images_features, pairwise_matches, camera_params)) {
printError("F(getCameraParams) camera parameters adjuster failed");
}
It seems that when these codes executed, the value of one of camera_params's member becomes illegal. I'm not sure about this, but it might be useful.

How to config the VLFEAT_LIBRARY

you've mentioned here like this
use the CMake to configure the project and make sure set the VLFEAT_LIBRARY with the "./vlfeat-0.9.20/bin/(the name depend on you system)/libvl"*
I don't quite understand how to configure,while I change the CMakeLists.txt like this
set(VLFEAT_LIBRARY ./vlfeat-0.9.20/bin/glnxa64/libvl), it turns to be /usr/bin/ld: cannot find -l./vlfeat-0.9.20/bin/glnxa64/libvl

Coud you write a more specify documents about the configures?

I set up the project in xcode. But encounter an error like this "dyld: Library not loaded: /usr/local/opt/libiomp/lib/libiomp5.dylib
Referenced from: /Users/riverhe/Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-bhrpeieucbxnghfxqtdnsahboivz/Build/Products/Debug/UglyMan_NISwGSP_Stitching
"
what's wrong with this?

Runtime error: debug assertion failed map iterator not dereferencable

Hi, i have this error when folder contains more than 2 images. Where could be wrong?

File: C:...\vc\include\xtree
Line"237
Expression: map/set iterator not dereferencable

#if _ITERATOR_DEBUG_LEVEL == 2
if (this->_Getcont() == 0
|| this->_Ptr == 0
|| this->_Ptr == ((_Mytree *)this->_Getcont())->_Myhead)
{ // report error
_DEBUG_ERROR("map/set iterator not dereferencable");
_SCL_SECURE_OUT_OF_RANGE;
}

stitching my own images?

If I want to stitch my own images,what should I do?And how to generate the xxx-STITCH-GRAPH.txt?Your input-42-data contains the xxx-STITCH-GRAPH.txt!

compile issue

I am new to Xcode and C++. I tried to compile this project in Xcode. I am running on macOS 10.13 with Xcode 9.4.1. I installed opencv 3.4.2 through Homebrew. I don't have openmp so I changed the code a little bit. Xcode suggested that there is error during the build process with error message:

ld: library not found for -lopencv_adas.3.0.0
clang: error: linker command failed with exit code 1 (use -v to see invocation).

Ld /Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Products/Debug/UglyMan_NISwGSP_Stitching normal x86_64
cd /Users/
/Downloads/NISwGSP-master/UglyMan_NISwGSP_Stitching
export MACOSX_DEPLOYMENT_TARGET=10.9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Products/Debug -L/usr/local/lib -L/Users//Downloads/NISwGSP-master/UglyMan_NISwGSP_Stitching -L/Users//Downloads/NISwGSP-master/UglyMan_NISwGSP_Stitching/UglyMan_NISwGSP_Stitching/vlfeat-0.9.21/bin/maci64 -L/usr/local/Cellar -F/Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Products/Debug -filelist /Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Intermediates.noindex/UglyMan_NISwGSP_Stitching.build/Debug/UglyMan_NISwGSP_Stitching.build/Objects-normal/x86_64/UglyMan_NISwGSP_Stitching.LinkFileList -mmacosx-version-min=10.9 -Xlinker -object_path_lto -Xlinker /Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Intermediates.noindex/UglyMan_NISwGSP_Stitching.build/Debug/UglyMan_NISwGSP_Stitching.build/Objects-normal/x86_64/UglyMan_NISwGSP_Stitching_lto.o -Xlinker -no_deduplicate -stdlib=libc++ -liomp5 -lopencv_adas.3.0.0 -lopencv_adas.3.0.0 -lopencv_adas.3.0.0 -lopencv_bgsegm.3.0.0 -lopencv_bgsegm.3.0.0 -lopencv_bgsegm.3.0.0 -lopencv_bioinspired.3.0.0 -lopencv_bioinspired.3.0.0 -lopencv_bioinspired.3.0.0 -lopencv_calib3d.3.0.0 -lopencv_calib3d.3.0.0 -lopencv_calib3d.3.0.0 -lopencv_ccalib.3.0.0 -lopencv_ccalib.3.0.0 -lopencv_ccalib.3.0.0 -lopencv_core.3.0.0 -lopencv_core.3.0.0 -lopencv_core.3.0.0 -lopencv_datasets.3.0.0 -lopencv_datasets.3.0.0 -lopencv_datasets.3.0.0 -lopencv_face.3.0.0 -lopencv_face.3.0.0 -lopencv_face.3.0.0 -lopencv_features2d.3.0.0 -lopencv_features2d.3.0.0 -lopencv_features2d.3.0.0 -lopencv_flann.3.0.0 -lopencv_flann.3.0.0 -lopencv_flann.3.0.0 -lopencv_hal -lopencv_highgui.3.0.0 -lopencv_highgui.3.0.0 -lopencv_highgui.3.0.0 -lopencv_imgcodecs.3.0.0 -lopencv_imgcodecs.3.0.0 -lopencv_imgcodecs.3.0.0 -lopencv_imgproc.3.0.0 -lopencv_imgproc.3.0.0 -lopencv_imgproc.3.0.0 -lopencv_latentsvm.3.0.0 -lopencv_latentsvm.3.0.0 -lopencv_latentsvm.3.0.0 -lopencv_line_descriptor.3.0.0 -lopencv_line_descriptor.3.0.0 -lopencv_line_descriptor.3.0.0 -lopencv_ml.3.0.0 -lopencv_ml.3.0.0 -lopencv_ml.3.0.0 -lopencv_objdetect.3.0.0 -lopencv_objdetect.3.0.0 -lopencv_objdetect.3.0.0 -lopencv_optflow.3.0.0 -lopencv_optflow.3.0.0 -lopencv_optflow.3.0.0 -lopencv_photo.3.0.0 -lopencv_photo.3.0.0 -lopencv_photo.3.0.0 -lopencv_reg.3.0.0 -lopencv_reg.3.0.0 -lopencv_reg.3.0.0 -lopencv_rgbd.3.0.0 -lopencv_rgbd.3.0.0 -lopencv_rgbd.3.0.0 -lopencv_saliency.3.0.0 -lopencv_saliency.3.0.0 -lopencv_saliency.3.0.0 -lopencv_shape.3.0.0 -lopencv_shape.3.0.0 -lopencv_shape.3.0.0 -lopencv_stereo.3.0.0 -lopencv_stereo.3.0.0 -lopencv_stereo.3.0.0 -lopencv_stitching.3.0.0 -lopencv_stitching.3.0.0 -lopencv_stitching.3.0.0 -lopencv_superres.3.0.0 -lopencv_superres.3.0.0 -lopencv_superres.3.0.0 -lopencv_surface_matching.3.0.0 -lopencv_surface_matching.3.0.0 -lopencv_surface_matching.3.0.0 -lopencv_text.3.0.0 -lopencv_text.3.0.0 -lopencv_text.3.0.0 -lopencv_tracking.3.0.0 -lopencv_tracking.3.0.0 -lopencv_tracking.3.0.0 -lopencv_ts -lopencv_video.3.0.0 -lopencv_video.3.0.0 -lopencv_video.3.0.0 -lopencv_videoio.3.0.0 -lopencv_videoio.3.0.0 -lopencv_videoio.3.0.0 -lopencv_videostab.3.0.0 -lvl -lopencv_videostab.3.0.0 -lopencv_videostab.3.0.0 -lopencv_xfeatures2d.3.0.0 -lopencv_xfeatures2d.3.0.0 -lopencv_xfeatures2d.3.0.0 -lopencv_ximgproc.3.0.0 -lopencv_ximgproc.3.0.0 -lopencv_ximgproc.3.0.0 -lopencv_xobjdetect.3.0.0 -lopencv_xobjdetect.3.0.0 -lopencv_xobjdetect.3.0.0 -lopencv_xphoto.3.0.0 -lopencv_xphoto.3.0.0 -lopencv_xphoto.3.0.0 -Xlinker -dependency_info -Xlinker /Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Intermediates.noindex/UglyMan_NISwGSP_Stitching.build/Debug/UglyMan_NISwGSP_Stitching.build/Objects-normal/x86_64/UglyMan_NISwGSP_Stitching_dependency_info.dat -o /Users//Library/Developer/Xcode/DerivedData/UglyMan_NISwGSP_Stitching-hhiwctdecvbhimdppxzbugtfuybs/Build/Products/Debug/UglyMan_NISwGSP_Stitching

I am wondering what may be wrong with my setup? Thanks!

Run error--Assertion failed

Dear Author.
Thank you for your great work.
I have complied the repo, however, when I run the exe file, an error occured that "Assertion failed: rgba_img.channels() >= 3, file F:\User\zhouxian\ImageStitching\NISwGSP-master\NISwGSP\Feature\ImageData.cpp, line 68".
I have no idea, could you please help me to fix it?

捕获

Where to get the matching information of apap matching points?

I'm trying to get the information of matching points and their matches, just like the sample image in the paper.
I have tried using pairwise_matches but the matching seemed incorrectly:

    Mat img1 = images_data[m1].img;
    Mat img2 = images_data[m2].img;
    Mat result = Mat::zeros(max(img1.rows, img2.rows),
                            img1.cols + img2.cols,
                            CV_8UC3);
    // 分割矩阵
    Mat left (result, Rect(0, 0, img1.cols, img1.rows));
    Mat right(result, Rect(img1.cols, 0, img2.cols, img2.rows));
    // 复制矩阵
    img1.copyTo(left);
    img2.copyTo(right);
    for (int i = 0; i < pairwise_matches[pm_index].matches.size(); i ++) {
      int src  = pairwise_matches[pm_index].matches[i].queryIdx;
      int dest = pairwise_matches[pm_index].matches[i].trainIdx;

      Point2 src_p  = images_data[m1].mesh_2d->getVertices()[src];
      Point2 dest_p = images_data[m2].mesh_2d->getVertices()[dest];
      Scalar color(rand() % 256, rand() % 256, rand() % 256);
      circle(result, src_p, 3, color, -1);
      line(result, src_p, dest_p + Point2(img1.cols, 0), color, 1, LINE_AA);
      circle(result, dest_p + Point2(img1.cols, 0), 3, color, -1);
    }
    imwrite(parameter.debug_dir + "matching_points" + to_string(i) + ".png", result);

Could you tell me the right way to do this? Besides, how to display only the good matches(how to judge the quality of a match)?

svd matrix assignment bug

in line 201:R.at(j / 3, j % 3) = V(j, V.rows() - 1); should be R.at(j / 3, j % 3) = V(j, V.cols() - 1);

Execution problem

It seems that I can't compile your project with my xcode. It always appears the following sentence: "error: can't exec '/usr/local/bin/clang-omp' (No such file or directory)" when I am trying to compile it. I tried to download clang-omp and llvm via brew. However, it seems both of them didn't work. So could you give me a way to ignore omp in a clear way or just give me the exe file? Thanks a lot.

nThreads=1?

Hello

The log displayed by the running program is nthreads = 1. I need to modify where I can control the number of threads. I hope to be able to implement multi-core CPU to run the program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.