Git Product home page Git Product logo

depth-mapper's Introduction

Digital and analogue forager + maker ๐Ÿ‘ฉโ€๐ŸŒพ

  • ๐Ÿ”ญ Currently working on Modyfi, Flatbread, Puerh.wtf and a hodgepodge of web projects
  • ๐ŸŒฑ Learnin GraphQL's underbelly, how to maintain and market open source projects, and whatever sidequest I'm on this week
  • ๐Ÿ’ฌ Talk to me about craft tea, JAMstack, UI/UX, rogue gardening, graphic design, photography, 3D printing, and cat
  • ๐Ÿ˜„ Pronouns: he/they

depth-mapper's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar tonyketcham avatar

Stargazers

 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

Forkers

mfkiwl jackzhousz

depth-mapper's Issues

Focus Stacking Algorithm

Uses a Laplace transform on each image in the stack to map the images' second derivatives. The algorithm then iterates through each corresponding pixel of the entire stack to find the image with the highest rate of change at that pixel. This pixel is plotted in the final image. Then the algorithm loops until the entire final image is filled.

Align images in the focal stack

Scaling (lens-breathing) occurs from shifting the focus distance of the lens when recording the image stack. This results in ghosted textures in the final images, among other artifacts by comparing misaligned pixels between images.

Implementing a feature-based alignment algorithm should automatically fix these issues without any extra user input or lens profiles.

Possible solutions:
[1] https://www.learnopencv.com/image-alignment-ecc-in-opencv-c-python/
[2] https://www.learnopencv.com/image-alignment-feature-based-using-opencv-c-python/

findTransformECC() - null pointer exception

Issue

The Video.findTransformECC() method should not require an imageMask arg, so null should be applicable in this case. However a null pointer exception is thrown when using a mask is not desired. Attempting to pass in a zeros matrix does not seem to remedy this issue either.

Potential Solution

Allegedly an issue with OpenCV 4.1. Downgrading to an earlier version may fix this issue, but doing so may have the side effect of worsening the running time of the overall program.

Convert native OpenCV Java methods to JavaCV

JavaCV code proves syntactically cleaner and more true to the native C++/Python style given in the OpenCV documentation. C++ modules that OpenCV has not yet wrapped for Java are also included in JavaCV.

Crucially, JavaCV has gone where stock Java OpenCV hasn't and wrapped Transparent API, which is useful for instantiating UMats through OpenCL that play nicely with OpenCV's Mat methods. This takes advantage of GPU hardware acceleration (as opposed to Mats which are CPU-bound) and can speed up processes by orders of magnitude. In the case of image alignment on a stack of 20MP+ images, this kind of speed is imperative.

ECC alignment is terribly slow

Problem

The ECC image alignment implementation takes ~10 minutes to align a stack of 15 large (20MP) images. Although a noticeable improvement, the results are not perfect either. Some ghosting lines are still present from image misalignment.

Potential Solution

Bitmap alignment may prove much faster than ECC. Perhaps finding a rough homography first may even be faster.

Depth Mapping Algorithm

Each image in the stack is assumed to be ordered: first is closest, last is furthest from the camera. A linear transformation is then done between the number of input images onto the range of 255-0 (white to black), mapping white to the closest image, and so on.

The depth mapping procedure then piggybacks off of the focus stacking algorithm. After the focus stacking decides which pixel to place in a given position of the final focus stacked image, the grayscale value that is mapped to the source image of that respective pixel is grabbed and set to the same pixel position in a depth map image.

The process results in a black and white depth map of the scene.

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.