kapadia / geoblend Goto Github PK
View Code? Open in Web Editor NEWGeo-aware poisson blending
License: MIT License
Geo-aware poisson blending
License: MIT License
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.
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
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
After running python setup.py to install geoblend, the create_multilevel_solver is not defined and crashes the cli.
https://github.com/kapadia/geoblend/blob/master/geoblend/scripts/cli.py
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.