Skip to content

Commit

Permalink
Merge pull request #8 from tiagofrepereira2012/master
Browse files Browse the repository at this point in the history
Updated the LBP-TOP documentation
  • Loading branch information
tiagofrepereira2012 committed May 24, 2016
2 parents cd07da9 + dbb6a11 commit cd6052d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions doc/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,56 @@ you need to get the required shape of the output image using the :py:class:`bob.
>>> print(bin ( lbp_output_image [ 68, 61 ] ))
0b1111000


LBP-TOP extraction
~~~~~~~~~~~~~~~~~~

LBP-TOP [Zhao2007]_ extraction for temporal texture analysis.

.. doctest:: lbptoptest
:options: +NORMALIZE_WHITESPACE

>>> import bob.ip.base
>>> import numpy
>>> numpy.random.seed(10)
>>> #Defining the lbp operator for each plane
>>> lbp_xy = bob.ip.base.LBP(8,1)
>>> lbp_xt = bob.ip.base.LBP(8,1)
>>> lbp_yt = bob.ip.base.LBP(8,1)
>>> lbptop = bob.ip.base.LBPTop(lbp_xy, lbp_xt, lbp_yt)

Defining the test 3D image and creating the containers for the outputs in each plane

.. doctest:: lbptoptest
:options: +NORMALIZE_WHITESPACE

>>> img3d = (numpy.random.rand(3,5,5)*100).astype('uint16')
>>> t = int(max(lbp_xt.radius, lbp_yt.radius))
>>> w = int(img3d.shape[1] - lbp_xy.radii[0]*2)
>>> h = int(img3d.shape[2] - lbp_xy.radii[1]*2)
>>> output_xy = numpy.zeros((t,w,h),dtype='uint16')
>>> output_xt = numpy.zeros((t,w,h),dtype='uint16')
>>> output_yt = numpy.zeros((t,w,h),dtype='uint16')

Extracting the bins for each plane

.. doctest:: lbptoptest
:options: +NORMALIZE_WHITESPACE

>>> lbptop(img3d,output_xy, output_xt, output_yt)
>>> print(output_xy)
[[[ 89 0 235]
[255 72 255]
[ 40 95 2]]]
>>> print(output_xt)
[[[ 55 2 135]
[223 130 119]
[ 0 253 64]]]
>>> print(output_yt)
[[[ 45 0 173]
[247 1 255]
[130 127 64]]]


.. Place here your external references
.. include:: links.rst
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ References
.. [Dalal2005] *N. Dalal, B. Triggs*. **Histograms of Oriented Gradients for Human Detection,** In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2005.
.. [Haralick1973] *R. M. Haralick, K. Shanmugam, I. Dinstein*. **Textural Features for Image Classification,** In IEEE Transactions on Systems, Man and Cybernetics, vol. SMC-3, No. 6, p. 610-621, 1973.
.. [Szeliski2010] *Richard Szeliski*. **Computer Vision: Algorithms and Applications** (1st ed.). Springer-Verlag New York, USA, 2010.
.. [Zhao2007] *G. Zhao and M. Pietikainen.* **Dynamic Texture Recognition Using Local Binary Patterns with an Application to Facial Expressions,** in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 29, no. 6, pp. 915-928, June 2007. doi: 10.1109/TPAMI.2007.1110
Indices and tables
------------------
Expand Down

0 comments on commit cd6052d

Please sign in to comment.