Code Monkey home page Code Monkey logo

latsic / imgalign Goto Github PK

View Code? Open in Web Editor NEW
292.0 9.0 44.0 233.27 MB

Webapplication for image stitching and aligning

Home Page: https://latsic.com/imgalign/info

JavaScript 0.86% Shell 0.07% CMake 2.54% C++ 83.91% Cuda 0.35% HTML 0.67% CSS 0.01% TeX 0.12% Python 3.39% Java 3.14% C 4.24% Perl 0.05% Batchfile 0.03% Objective-C 0.03% Objective-C++ 0.52% Prolog 0.01% PowerShell 0.04% Makefile 0.01% Clojure 0.01% Scala 0.02%
vue vuetify opencv webassembly spa feature-detection template-matching orb kaze sift

imgalign's Introduction

ImgAlign

A webapplication to join, stitch or align overlapping images. It can be used to create panoramas or to align images, for example forms which have not been scanned properly.

Features: Surface projection, feature detection, feature matching, bundle adjustement, wave correction, color transfer, seam detection and multiband blending.

The core algorithms are taken from OpenCV (modules Feature2D and Stitching mainly) and have been adjusted where needed. A customized version of OpenCV has then been compiled to wasm. To ensure a non blocking UI, all OpenCV related functions run via a webworker.

Pros and cons: As image stitching can be quite memory and cpu intensive, there are some limitations on the amount or size of images which can be stitched together, especially on mobile devices. On the plus side, basic stitching functionality is available on almost any device which can run a browser. There is no need to download a professional stitching software. The application is fully functional offline as well.

Built With

  • Vue - The web framework used
  • Vuex - Vue store
  • Vuetify - Vue Material Design Component Framework
  • OpenCV - Open Source Computer Vision Library
  • WebAssembly - Binary instruction format for a stack-based virtual machine

Getting Started

Prerequisites

Build instructions

  • npm run build / npm run serve

Optionally opencv can be built:

  • Install emsdk and make it available on the command line.
  • Install python and make it available on the command line.
  • Run build_opencv.sh, this will create an opencv wasm version and copies it to the public folder of the spa.

Deployment

Contributing

Versioning

Authors

License

MIT if not otherwise noted in the source files. Be aware that Surf and Sift are patented algorithms (at least in some regions of the world).

Acknowledgments

Images and Screenshots

imgalign's People

Contributors

latsic 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

imgalign's Issues

Failing to compile

Hello,

I am trying to compile the opencv_src with your modifications to use it with python but unfortunately I can't. I first tried to build opencv from source but got an error then I also try to use the build_opencv.sh file you provide to see if I could build the wasm version but also got an error.

Compiling imgalign/opencv_src:

I followed the basic flow for building opencv from source (creating empty build folder in opencv_src, getting into it, running cmake .. and running make -j 4 ). At the cmake .. step I got a loop dependency error

CMake Error at cmake/OpenCVModule.cmake:432 (message):
  FATAL: Unresolved dependencies or loop in dependency graph (2)

  Processed OPENCV_MODULE_opencv_calib3d_DEPS:
  opencv_calib3d;opencv_core;opencv_features2d;opencv_flann;opencv_imgproc

  Good modules: opencv_core;opencv_flann;opencv_imgproc

  Bad modules: opencv_calib3d;opencv_features2d
Call Stack (most recent call first):
  cmake/OpenCVModule.cmake:601 (__ocv_sort_modules_by_deps)
  cmake/OpenCVModule.cmake:368 (__ocv_resolve_dependencies)
  modules/CMakeLists.txt:7 (ocv_glob_modules)

After looking at imgalign/opencv_src/modules/calib3d/CMakeLists.txt and imgalign/opencv_src/modules/features2d/CMakeLists.txt it looks like they both depend on each other.

I looked at the official opencv github repository and saw that the features2d module does not depend from calib3d module so I removed the dependency from your code and the cmake command ran but the make command is failing

...
In file included from /imgalign/opencv_src/modules/features2d/src/img_align/Display.cpp:2:
/imgalign/opencv_src/modules/features2d/src/img_align/Display.h:45:19: note: shadowed declaration is here
   45 |   TConstImages&   images;
      |                   ^~~~~~
In file included from /usr/include/c++/9/vector:67,
                 from /imgalign/opencv_src/modules/core/include/opencv2/core/types.hpp:53,
                 from /imgalign/opencv_src/modules/core/include/opencv2/core.hpp:58,
                 from /imgalign/opencv_src/modules/features2d/include/opencv2/features2d.hpp:47,
                 from /imgalign/opencv_src/build/modules/features2d/precomp.hpp:46:
/usr/include/c++/9/bits/stl_vector.h: In instantiation of 'class std::vector<const cv::Mat>':
/imgalign/opencv_src/modules/features2d/src/img_align/Display.cpp:46:29:   required from here
/usr/include/c++/9/bits/stl_vector.h:398:66: error: static assertion failed: std::vector must have a non-const, non-volatile value_type
  398 |       static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
      |                                                                  ^~~~~
/usr/include/c++/9/bits/stl_vector.h:401:64: error: static assertion failed: std::vector must have the same value_type as its allocator
  401 |       static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
      |                                                                ^~~~~
...

2. Building with build_opencv.sh

To build the wasm version I install emscripten following the instructions here https://emscripten.org/docs/getting_started/downloads.html. After I had to define the environment variable export EMSCRIPTEN=imgalign/emsdk/upstream/emscripten and by running bash build_opencv.sh I get the following error:

...
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Failed
CMake Error at cmake/OpenCVCompilerOptimizations.cmake:507 (message):
  Compiler doesn't support baseline optimization flags:
Call Stack (most recent call first):
  cmake/OpenCVCompilerOptions.cmake:270 (ocv_compiler_optimization_options)
  CMakeLists.txt:555 (include)

Can you help me understand why I can't build your opencv version please?

Here is my configuration :
Ubuntu 20.04
cmake version 3.16.3
gcc 9.4.0
emsdk 3.1.7
(I succeed to build the opecnv from source on branch 3.4 with this config)

安装步骤

建议在docker环境下安装,因为不会干扰已有的环境.

  1. sudo apt-get install npm
  2. npm install
  3. npm run build &
  4. npm run serve &

注意:
在docker容器内开启的时候,实例化时需要指定端口.

例如:
docker run -p 8082 --name test_http -it docker_images_name:v1.0 /bin/bash

图片

参考链接:

  1. https://www.jianshu.com/p/9bc970082020

Multistitcher

@latsic, multi-stitcher fails with in some instances when given more 4-5 images, and the output stitches only 3 images. Just wondering, is there anything I need to look into? Thanks!

preventing poor match - questions

Great app! I have a question around how to set params.

  1. I understand that Matcher tries to accommodate distortions, but only some distortions are realistic. If the second image is low res, or the target is small, the algorithm returns a very distorted aligned image, when a simple rotated and scaled image would be a better fit. Is there a param setting that would prevent matches from returning a distorted image? Maybe a limit on the transform matrix? Or a switch to return "0" for success when the transform is deemed unlikely (as per the verbose logging)?

Multistitcher not recognizing images

Hello,

If I try to create a panorama of my room and of my friend's room, it seems that the algorithm doesn't recognise a lot of the photographs giving the error "No match found for images with index: [list]" .

Is there a specific way required to take the photos?

Thanks,

Image Size Adjustments?

Currently using the multistitcher in browser. Works very well.

Question about the resolution though. Are my input images being downsampled, or is the final image being reduced to less than its full potential resolution? Any way to change the settings to maximize the size of the final render?

Modifications to OpenCV

Hey,
Thank you for creating this awesome repo!
As I would like to compile with the current version of OpenCV I would like to understand what modifications where necessary - could you elaborate on that? Where there any tutorials that you used?

I also have the issue that, when using the build_opencv.sh within a docker image, the resulting script is different and does not contain the ImgStitch function. Did you compile using a docker image? Which version of emscripten did you use?
I used: docker run --rm -v `pwd`:`pwd` -it trzeci/emscripten:sdk-tag-1.38.31-64bit /bin/bash

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.