Coding With OpenCV
Coding With OpenCV
Coding With OpenCV
=
(
(
= c c = c
= c
c c + c c = c c
= + + +
y
x
t
y y x
y x x
I
I
I b
I I I
I I I
G y x X
b X G
dt dy y I dt dx x I t I
t y x I dt t dy y dx x I
,
,
,
), , (
,
); / ( / ) / ( / /
); , , ( ) , , (
2
2
Optical flow equations:
Pyramidal Implementation of the
optical flow algorithm
J image I image
Image Pyramid
Representation
Iterative Lucas
Kanade Scheme
Generic Image
(L-1)-th Level
L-th Level
Location of point u on image u
L
=u/2
L
Spatial gradient matrix
Standard Lucas Kanade scheme for
optical flow computation at level L d
L
Guess for next pyramid level L 1
Finally,
Image pyramid building
Optical flow computation
(
(
=
2
2
,
,
y y x
y x x
I I I
I I I
G
) ( 2
1 L L L
d g g + =
+
0 0
g d d + =
d U V + =
Pyramidal Implementation of the
optical flow algorithm
6DOF Algorithm
). (s X t =
= =
V = V V
c c c c = c c = V
N
i ROI
T
i
t
N
i ROI
i
T
i
I I ds I I
s X I s I I
i
1 1
/ / / t
Parametrical optical flow equations:
3D reconstruction
Camera Calibration
View Morphing
POSIT
Camera Calibration
Define intrinsic and extrinsic camera parameters.
Define Distortion parameters
] , [ ], , , [ , , ,
1 0 0
0
0
, ] [
3
2
1
33 32 31
23 22 21
13 12 11
v u p Z Y X P
t
t
t
T
r r r
r r r
r r r
R c f
c f
A
P RT A p
y y
x x
= =
(
(
(
=
(
(
(
=
(
(
(
=
=
.
)], 2 / ( 2 [ ) (
~
)], 2 / ( 2 [ ) (
~
2 2 2
2
1 2
4
2
2
1
2
2 1
4
2
2
1
y x r
y y r p x p r k r k c v v v
x x r p y p r k r k c u u u
y
x
+ =
+ + + + + =
+ + + + + =
Camera Calibration
Now, camera calibration can be done by holding
checkerboard in front of the camera for a few seconds.
And after that youll get:
3D view of etalon
Un-distorted image
View Morphing
POSIT Algorithm
Perspective projection:
Weak-perspective projection:
i i i i i i
Y Z f y X Z f x = = ) / ( , ) / (
. / , , Z f s Y s y X s x
i i i i
= = =
References
M.Hu.Visual Pattern Recognition by Moment Invariants, IRE Transactions
on Information Theory, 8:2, pp. 179-187, 1962.
B. Jahne. Digital Image Processing. Springer, New York, 1997.
M. Kass, A. Witkin, and D. Terzopoulos. Snakes: Active Contour Models,
International Journal of Computer Vision, pp. 321-331, 1988.
J.Matas, C.Galambos, J.Kittler. Progressive Probabilistic Hough
Transform. British Machine Vision Conference, 1998.
A. Rosenfeld and E. Johnston. Angle Detection on Digital Curves. IEEE
Trans. Computers, 22:875-878, 1973.
Y.Rubner.C.Tomasi,L.J.Guibas.Metrics for Distributions with Applications
to Image Databases. Proceedings of the 1998 IEEE International
Conference on Computer Vision, Bombay, India, January 1998, pp. 59-66.
Y. Rubner. C. Tomasi, L.J. Guibas. The Earth Movers Distance as a
Metric for Image Retrieval. Technical Report STAN-CS-TN-98-86,
Department of Computer Science, Stanford University, September, 1998.
Y.Rubner.C.Tomasi.Texture Metrics. Proceeding of the IEEE International
Conference on Systems, Man, and Cybernetics, San-Diego, CA, October
1998, pp. 4601- 4607.
http://robotics.stanford.edu/~rubner/publications.html
References
Gunilla Borgefors. Distance Transformations in Digital Images.Computer
Vision, Graphics and Image Processing 34, 344-371,(1986).
G. Bradski and J. Davis. Motion Segmentation and Pose Recognition with
Motion History Gradients. IEEE WACV'00, 2000.
P. J. Burt, T. H. Hong, A. Rosenfeld. Segmentation and Estimation of
Image Region Properties Through Cooperative Hierarchical Computation.
IEEE Tran. On SMC, Vol. 11, N.12, 1981, pp.802-809.
J.Canny.A Computational Approach to Edge Detection, IEEE Trans. on
Pattern Analysis and Machine Intelligence, 8(6), pp.679-698 (1986).
J. Davis and Bobick. The Representation and Recognition of Action Using
Temporal Templates. MIT Media Lab Technical Report 402,1997.
Daniel F. DeMenthon and Larry S. Davis. Model-Based Object Pose in 25
Lines of Code. In Proceedings of ECCV '92, pp. 335-343, 1992.
Andrew W. Fitzgibbon, R.B.Fisher. A Buyers Guide to Conic Fitting.Proc.5
th British Machine Vision Conference, Birmingham, pp. 513-522, 1995.
Berthold K.P. Horn and Brian G. Schunck. Determining Optical Flow.
Artificial Intelligence, 17, pp. 185-203, 1981.
References
J. Serra. Image Analysis and Mathematical Morphology. Academic Press,
1982.
Bernt Schiele and James L. Crowley. Recognition without Correspondence
Using Multidimensional Receptive Field Histograms. In International
Journal of Computer Vision 36 (1), pp. 31-50, January 2000.
S. Suzuki, K. Abe. Topological Structural Analysis of Digital Binary Images
by Border Following. CVGIP, v.30, n.1. 1985, pp. 32-46.
C.H.Teh, R.T.Chin.On the Detection of Dominant Points on Digital Curves.
- IEEE Tr. PAMI, 1989, v.11, No.8, p. 859-872.
Emanuele Trucco, Alessandro Verri. Introductory Techniques for 3-D
Computer Vision. Prentice Hall, Inc., 1998.
D. J. Williams and M. Shah. A Fast Algorithm for Active Contours and
Curvature Estimation. CVGIP: Image Understanding, Vol. 55, No. 1, pp.
14-26, Jan., 1992.
http://www.cs.ucf.edu/~vision/papers/shah/92/WIS92A.pdf.
A.Y.Yuille, D.S.Cohen, and P.W.Hallinan. Feature Extraction from Faces
Using Deformable Templates in CVPR, pp. 104-109, 1989.
Zhengyou Zhang. Parameter Estimation Techniques: A Tutorial with
Application to Conic Fitting, Image and Vision Computing Journal, 1996.