Title: Presenter:
1 Boost CVPR
http//www.boost.org/
2Contents
- Boost Multidimensional Array Library
- by Ronald Garcia
- Open System Lab, Indiana University
- Boost Graph Library
- by Jeremy Siek
- Indiana University
- Boost Lamda Library
- by Jaakko Järvi
- Boost Computer Vision Pattern Recognition
Library - Natl. Lab. of Pattern Recognition, CASIA
- At current, contains contributions from Haifeng,
Hongxia, Xiaoxing. - Under developing, any kind of contributions are
welcome.
3Boost MultiArray Library
- Introduction
- Short Example
- Creating Views
- Facilities for CVPR
4Introduction
- The Boost MultiArray library provides a class
template specifying an interface for
N-dimensional containers. - It includes a general array class template and
array adaptors. - The MultiArray class supports idiomatic array
operations and interoperate with C Standard
Library containers and algorithms.
5Short Example
Instantiate the template
- include "boost/multi_array.hpp"
- using namespace boost
- int main()
- typedef multi_arrayltfloat,3gt MultiArray
- typedef MultiArrayindex index
- MultiArray A(extents343)
- int values 0
- for(index i 0 i lt 3 i )
- for(index j 0 j lt 4 j )
- for(index k 0 k lt 3 k )
- Aijk values
- return 0
-
A signed integral type used for indexing into A
Create a 3D array that is 3 x 4 x 3
Access elements
6Creating Views
- The sub-view supports the similar interface as
the original array. - It can retain the same number of dimensions as
the original. - It can have less dimensions than the original.
7Examples
- typedef MultiArrayarray_viewlt3gt type
view3D - typedef MultiArrayarray_viewlt2gt type
view2D - typedef MultiArrayindex_range r
-
- view3D aView3 A indicesr(0,2)r(0,4,2)r()
- view2D aView2 A indices0r()r()
The view type with Dims dimension template
array_viewltDimsgt type
This type specifies a range of indices over some
dimension of a MultiArray.
from beginning to end
base, stride, bound) 0,2,4) 0, 2
base,bound) 0,2) 0, 1
8Facilities for CVPR
- The MultiArray container perfectly suits
3D-graphics and digital image. - For 3D-grahpics, slices are gained effortlessly
with the tool of creating views. - For digital images, we can easily choose one
color channel similarly.
9More Facilities
- By creating a view type of the same dimensions of
the original, we can easily sample on a multigrid
lattice.
e.g. use MultiArray to contain a color image
(256256) MultiArray A(extents2562563
) create such a view view3D sample
A indicesr(0,256,4)r(0,256,4)r(
)
10More Facilities
- MultiArray provides a flexible process on the
numbers of dimension. -
- e.g.
- If we have a group of images for training,
, with the size of m x n. - The MultiArray of one more dimension than A
can be created to contain this group. It is
convenient to train all these images (2D
(mn)xK), as well as to show the result of just
one image (3D mxnxK).
- More facilities for CVPR are to be developed.
11Boost Graph Library
- Generic Data Structures
- Generic Graph Algorithms
12Generic Data Structures
- adjacency_list
- adjacency_matrix
- edge_list
- Suit directed, undirected, or bidirected graph
when specially parameterized - Provide containers for both node and edge
13Generic Graph Algorithms
- Breadth First Search
- Depth First Search
- Uniform Cost Search
- Build blocks for constructing graph algorithms,
currently including 13 in the BGL, such as
connected components.
14Boost Lambda Library
- Unnamed functions can be created easily with an
intuitive syntax. - e.g. for_each( a.begin(), a.end(), cout ltlt
(1 _1)) - Most of the restrictions in argument binding are
removed, arbitrary arguments of practically any
C function can be bound. - Separate function composition operations are not
needed, as function composition is supported
implicitly.
15Boost CVPR Library
- Introduction
- Commonly Used Components
- Kernels Filters
- Color Space Transformation
- Color Transformation
- Array Utils
- IO Stream
- Read Write QT, ImageMagic
- Statistical Learning
- Plotting
- Poisson Image Editting
16Introduction
- The Boost CVPR library is an specialized
application of Boost MultiArray. - The Boost CVPR library, containing a family of
class and function templates, is intended to
offer basic tools for image processing.
17Kernels Filters
defined in boost_cvpr/filter.hpp
- Providing function templates to generate kernels,
including gaussian, dog (a derivative of
gaussian), disk, disko, sixneighbor. - Providing function templates for filtering and
resizing. - filt
- resize
18Examples
Generate a gaussian kernel
Output a multiarray by overloaded function
coutltlt
- multi_arrayltfloat,2gt gauKernel(extents55)
float sigma 1.5 - gaussian(gauKernel,sigma) coutltlt"gauKernel "lt
ltendlltltgauKernelltlt""ltltendl multi_arrayltfloat,
3gt in multi_arrayltfloat, 3gt out
load_image(in, "in.bmp")
out.resize(extentsin.shape()0 - in.shape()1in.shape()2)
- for(index cc 0 cc lt in.shape()2 cc)
view2D filt_in in indicesr()r()cc
view2D filt_out out indicesr()r()cc
filt(filt_in,gauKernel,filt_out)
save_image(out,"out.bmp")
Specify the extents of out
Read
Smooth filter
Write
19Color Space Transformation
defined in boost_cvpr/color_space.hpp
- This head file provides function templates to
transform RGB to LUV color space and in the
reverse direction.
rgb2luv(rgbImageArray, luvImageArray) luv2rgb(luv
ImageArray, rgbImageArray)
MultiArray
20Color Transformation
defined in boost_cvpr/color_trans.hpp
- This head file provides several components for
color amendments.
nbin is the number of the color scales, and maxv
is the maximal value after process.
- Five useful functions
- saturate (in, lb, ub)
- histogram (in, hist, bin)
- histeq (in, out, nbin, maxv)
- level (in, out, bin, curv)
- autolevel (in, out, lb, ub)
p lt lb, let p lb p gt ub, let p ub.
curv bin are 1D multiarray of the same size,
guiding the leveling process.
hist bin are 1D multiarray of the same size.
histi store the statics data of the pixals
being the color of bini.
out can be omitted.
21Array Utils
defined in boost_cvpr/array_utils.hpp
- Wrapper of multi-folded loops for multiarray
- multi_for_each(_const)
- multi_copy(_const)
- multi_arith(_const)
e.g.multi_arrayltfloat, 3gt a(extents100100)
multi_arrayltfloat, 3gt b(extents100100)
multi_arrayltfloat, 3gt c(extents100100)
multi_for_each(a, _12) multi_copy(a,
b, _22_1) multi_arith(a, b, c, _32_1_2)
22IO Stream
defined in boost_cvpr/cvpr_stream.hpp
- By overloading the operator ltlt, the objects of
multi_array, array_view, and sub_array types can
be output at one time.
- Using the sentences just like (both file and std.
console) - coutltlt A cingtgt A
- fcoutltlt A fingtgt A
23Read Write
defined in boost_cvpr/cvpr_qt.hpp and
boost_cvpr/cvpr_magick.hpp
- Using QT to load and save images
- 3 functions are designed
- load_image() save_image() save_sequence()
- Components defined in cvpr_magick.hpp, using
ImageMagick, have similar usages.
24Statistical Learning
- ISOMAP
- k-nearest neighbor
- eigs
- PCA
- Connected Components
- For both graph and image lattice
- connect_components
25 Plotting - Open Scene Graph
26 Poisson Image Editing
27THE END