Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harusametime/generalnormapproximation
Fast General Norm Approximation via IRLS
https://github.com/harusametime/generalnormapproximation
Last synced: 9 days ago
JSON representation
Fast General Norm Approximation via IRLS
- Host: GitHub
- URL: https://github.com/harusametime/generalnormapproximation
- Owner: harusametime
- Created: 2017-08-04T01:18:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-20T06:47:55.000Z (about 7 years ago)
- Last Synced: 2024-11-15T22:59:37.249Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Fast General Norm Approximation
====## Description
This is a Python implementation of a solver for the following minimization problem:
based on my work on "Fast General Norm Approximation via Iteratively Reweighted Least Squares" presented in The 4th ACCV workshop on e-Heritage 2016.
## Installation
Put *general_norm.py* in your directory. This program requires
- Python 3.5
- Numpy
- Scipy
- opencv (for reading images in photometric_stereo.py)## Usage
```python
from general_norm import GeneralNorm
m = GeneralNorm(list_A, list_b, w, p)
x = m.solve()
````list_A` is a list of scipy sparse matrices *A*, `list_b` is a list of numpy ndarray *b*, `w` is a numpy array of weights on norms, and `p` is a numpy array of p values in l_p norms. We can get *x* as solution of the minimization problem.
## Example
### *random_norm.py*
Design matrices *A* and solution *x* are randomly determined, and *b* is calculated by *A* *x*. Then the problem to minimize the sum of norms ||*A* *x* - *b*||_p^p is solved with respect to *x*.
### *photometric_stereo.py*
Normal map *N* of an object is estimated from measurement *M* and light direction *L* based on Lambert's law. This program can receive either point cloud with normals or measurement images of an object under different light directions.
### *sfn.py*
Surface represented by a set of depth is estimated from normal map *N* based on the fact that differentiation of the surface is corresponding to gradient, which can be calculated from normal.