Giter Site home page Giter Site logo

geoblend's People

Contributors

kapadia avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

geoblend's Issues

Image resize leaves null boundaries

When ensuring the source and reference images are of equal pixel resolution, scipy's imresize function sometimes leaves null boundaries.

In [3]: source
Out[3]:
array([[    0, 10322, 10690, ...,  6754,  6562,     0],
       [    0, 10594, 10626, ...,  6481,  6273,     0],
       [    0, 10690, 10770, ...,  6786,  6513,  6594],
       ...,
       [    0,  5137,  5057, ...,  7234,  6978,  7218],
       [    0,  5217,  5265, ...,  7250,  6738,  7394],
       [    0,     0,  5137, ...,  7442,  7490,  7218]], dtype=uint16)

Potentially using scipy's zoom function is better, and avoids calling PIL. Other options is to use imageutil's upsample function.

Documentation

  • Get a varied sample set of images for demonstration
  • Write out the math

`matrix_from_mask` should support rectangular images

matrix_from_mask creates a coefficient matrix based on a non-rectangular image with bounds designated by a mask.

Due to array length differences, this fails in the case of an mask representing the entire image. Attention to indexing should provide a fix.

In [1]: import numpy as np

In [2]: from geoblend.coefficient_matrix import *

In [3]: mask = np.ones((5, 5))

In [4]: m1 = create_coefficient_matrix(mask.shape)

In [5]: m2 = matrix_from_mask(mask)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-5-0201c5d24767> in <module>()
----> 1 m2 = matrix_from_mask(mask)

geoblend/geoblend/coefficient_matrix.py in matrix_from_mask(mask)
     73     #
     74     u = np.zeros(n - 1)
---> 75     u[indices] = -1
     76     u[indices[0] - 1] = -1
     77

IndexError: index 24 is out of bounds for axis 1 with size 24

Regularization term

The solution to the poisson equation is second order differentiable. This results in having the blended image (e.g. the solution) be overly smooth in places where discontinuity is desired (e.g. sharp edges around buildings).

A regularization term can help reduce the smoothness based on discontinuities in the gradient.

/cc @dieterichlawson

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.