Skip to content

Commit

Permalink
Update the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Riadh committed Jun 3, 2019
1 parent 4c1c02e commit cf3aaef
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 52 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Pyimof (for **Py**thon **im**age **o**ptical **f**low) is a pure
python package for dense [optical
flow](https://en.wikipedia.org/wiki/Optical_flow) estimation. Please
visit the [documentation](https://pyimof.readthedocs.io/en/latest/)
where some examples are provided in the
and the
[gallery](https://pyimof.readthedocs.io/en/latest/examples/index.html)
for more details.

## Quick Example

Expand Down
49 changes: 22 additions & 27 deletions pyimof/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def flow_to_color(u, v, cmap=None, scale=True):
magnitude.
Any colormap compatible with matplotlib can be applyed but
circuler colormaps are recommanded: 'huv', 'twilight',
'twilight_shifted' and the builtin 'middlebury' colormaps.
circular colormaps are recommanded ( for example 'huv',
'twilight', 'twilight_shifted' and the builtin 'middlebury'
colormaps).
If cmap is None, the HSV image defined using optical flow
orientation (hue) and magnitude (saturation) is returned.
Expand All @@ -66,11 +67,9 @@ def flow_to_color(u, v, cmap=None, scale=True):
v : ~numpy.ndarray
The vertical component of the vector field.
cmap : str (optional)
The colormap used to color code the input vector field
(default: None)
scale : bool
whether to scale output saturation according to magnitude
(default: True).
The colormap used to color code the input vector field.
scale : bool (optional)
whether to scale output saturation according to magnitude.
Returns
-------
Expand Down Expand Up @@ -124,12 +123,10 @@ def color_wheel(u=None, v=None, nr=50, ntheta=1025):
The horizontal component of the vector field (default: None).
v : ~numpy.ndarray (optional)
The vertical component of the vector field (default: None).
nr : int
The number of steps used to discretise the wheel radius
(default: 50).
ntheta : int
The number of steps used to discretise the wheel sectors
(default:1025).
nr : int (optional)
The number of steps used to discretise the wheel radius.
ntheta : int (optional)
The number of steps used to discretise the wheel sectors.
Returns
-------
Expand Down Expand Up @@ -182,16 +179,14 @@ def plot(u, v, ax=None, cmap='middlebury', scale=True, colorwheel=True):
The vertical component of the vector field.
ax : ~matplotlib.pyplot.Axes (optional)
Optional matplotlib axes used to plot the image. If None, the
image is displayed in a tight figure (default: None).
cmap : str
The colormap used to color code the input vector field
(default: 'middlebury')
scale : bool
whether to scale output saturation according to magnitude
(default: True).
colorwheel : bool
image is displayed in a tight figure.
cmap : str (optional)
The colormap used to color code the input vector field.
scale : bool (optional)
whether to scale output saturation according to magnitude.
colorwheel : bool (optional)
whether to display the color wheel describing the images
colors or not (default: True).
colors or not.
Returns
-------
Expand Down Expand Up @@ -240,20 +235,20 @@ def quiver(u, v, c=None, bg=None, ax=None, step=None, nvec=50, bg_cmap=None,
v : ~numpy.ndarray (with shape m×n)
The vertical component of the vector field.
c : ~numpy.ndarray (optional (with shape m×n))
Optional array of values used to color the arrows.
Values used to color the arrows.
bg : ~numpy.ndarray (2D or 3D optional)
Background image.
ax : ~matplotlib.pyplot.Axes (optional)
Axes used to plot the image. If None, the image is displayed
in a tight figure (default: None).
in a tight figure.
step : int (optional)
The grid step used to display the vector field. If None, it is
computed using the nvec parameter (default: None).
computed using the nvec parameter.
nvec : int
The maximum number of vector over all the grid dimentions. It
is ignored if the step parameter is not None (default: 50).
is ignored if the step parameter is not None.
bg_cmap : str (optional)
The colormap used to color the background image (default: None).
The colormap used to color the background image.
Notes
-----
Expand Down
26 changes: 10 additions & 16 deletions pyimof/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,24 @@ def tvl1(I0, I1, dt=0.2, lambda_=15, tau=0.3, nwarp=5, niter=10,
dt : float
Time step of the numerical scheme. Convergence is proved for
values dt < 0.125, but it can be larger for faster
convergence (default: 0.2).
convergence.
lambda_ : float
Attachement parameter. The smaller this parameter is,
the smoother is the solutions (default: 15).
the smoother is the solutions.
tau : float
Tightness parameter. It should have a small value in order to
maintain attachement and regularization parts in
correspondence (default: 0.3).
correspondence.
nwarp : int
Number of times I1 is warped (default: 5).
Number of times I1 is warped.
niter : int
Number of fixed point iteration (default: 10).
Number of fixed point iteration.
tol : float
Tolerance used as stopping criterion based on the L² distance
between two consecutive values of (u, v) (default: 1e-4).
between two consecutive values of (u, v).
prefilter : bool
whether to prefilter the estimated optical flow before each
image warp (default: False).
image warp.
Returns
-------
Expand Down Expand Up @@ -294,19 +294,13 @@ def ilk(I0, I1, rad=7, nwarp=10, prefilter=False):
The first gray scale image of the sequence.
I1 : ~numpy.ndarray
The second gray scale image of the sequence.
u0 : ~numpy.ndarray
Initialization for the horizontal component of the vector
field.
v0 : ~numpy.ndarray
Initialization for the vertical component of the vector
field.
rad : int
Radius of the window considered around each pixel (default: 7).
Radius of the window considered around each pixel.
nwarp : int
Number of times I1 is warped (default: 10).
Number of times I1 is warped.
prefilter : bool
whether to prefilter the estimated optical flow before each
image warp (default: False).
image warp.
Returns
-------
Expand Down
14 changes: 6 additions & 8 deletions pyimof/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,11 @@ def get_pyramid(I, downscale=2.0, nlevel=10, min_size=16):
I : ~numpy.ndarray
The image to be preprocessed (Gray scale or RGB).
downscale : float
The pyramid downscale factor (default: 2)
The pyramid downscale factor.
nlevel : int
The maximum number of pyramid levels (default: 10).
The maximum number of pyramid levels.
min_size : int
The minimum size for any dimension of the pyramid levels
(default: 16).
The minimum size for any dimension of the pyramid levels.
Returns
-------
Expand Down Expand Up @@ -170,12 +169,11 @@ def coarse_to_fine(I0, I1, solver, downscale=2, nlevel=10, min_size=16):
solver : callable
The solver applyed at each pyramid level.
downscale : float
The pyramid downscale factor (default: 2)
The pyramid downscale factor.
nlevel : int
The maximum number of pyramid levels (default: 10).
The maximum number of pyramid levels.
min_size : int
The minimum size for any dimension of the pyramid levels
(default: 16).
The minimum size for any dimension of the pyramid levels.
Returns
-------
Expand Down

0 comments on commit cf3aaef

Please sign in to comment.