samples/cpp/image_alignment.cpp
Примеры с cv2.imshow требуют сборки OpenCV с GUI. В ноутбуке с headless-версией используйте вывод изображений через Matplotlib.
Loading...
Searching...
No Matches
samples/cpp/image_alignment.cpp
An example using the image alignment ECC algorithm
/*
* This sample demonstrates the use of the function
* findTransformECC that implements the image alignment ECC algorithm
*
*
* The demo loads an image (defaults to fruits.jpg) and it artificially creates
* a template image based on the given motion type. When two images are given,
* the first image is the input image and the second one defines the template image.
* In the latter case, you can also parse the warp's initialization.
*
* Input and output warp files consist of the raw warp (transform) elements
*
* Authors: G. Evangelidis, INRIA, Grenoble, France
* M. Asbach, Fraunhofer IAIS, St. Augustin, Germany
*/
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/video.hpp>
#include <opencv2/imgproc.hpp>
# <//.>
# <.>
# <>
# <.>
# <>
# <>
;
;
( ** );
( , & , );
( , & , );
(& , , , & );
# (, , )\
.<>(,) = ()();\
.<>(,) = ()();\
.<>(,) = .;
# (, , )\
() = <> (.<>(,)/.<>(,));\
() = <> (.<>(,)/.<>(,));
:: =
;
( ** )
{
<<
<< ;
<<
<< []
<<
<< ;
<<
<< []
<<
<< ;
}
( , & , ){
(.()==);
;
(==)
=;
=;
;
;
(.());
(.()){
* = .<>();
(=; <; ++){
>> [];
}
= ;
}
{
<< << .() << ;
= ;
}
;
}
( , & , )
{
(.()==);
* = .<>();
;
(.());
( ! ) {
<<
<< << .() << << ;
= ;
}
{
<< [] << << [] << << [] << ;
<< [] << << [] << << [] << ;
(==){
<< [] << << [] << << [] << ;
}
= ;
}
;
}
(& , , , & )
{
, , , ;
= (, , );
= (, , );
= :: (, , );
( = ; < .; ++)
( = ; < .; ++)
.<>(,) = .<>(,);
(, , );
(, , , , , );
(, ., .);
(, , );
(, , , , , );
(, ., .);
(, , );
(, , , , , );
(, ., .);
(, , );
(, , , , , );
(, ., .);
(, , , ());
(, , , ());
(, , , ());
(, , , ());
}
( , * [])
{
(, , );
.();
.();
();
= .<>();
= .<>();
= .<>();
= .<>();
= .<>();
= .<>();
= .<>();
= .<>();
= .<>();
(!.())
{
.();
-;
}
(!( == || ==
|| == || == ))
{
<< << ;
-;
}
;
( == )
= ;
( == )
= ;
( == )
= ;
= ;
= (::(), );
(.())
{
<< << ;
-;
}
;
;
(!=) {
.();
= (::(), );
(.()){
<< << ;
-;
}
}
{
(, , (, ), , , );
;
(());
;
() {
:
= (<>(,) << , , (.(., .)),
, , (.(., .)));
(, , ,
(,), + );
;
:
= / + *.(()-., ().)/;
= (<>(,) << (), -(), (.(., .)),
(), (), (.(., .)));
(, , ,
(,), + );
;
:
= (<>(,) << (-.(-.05f, .05f)),
(.(-.03f, .03f)), (.(., .)),
(.(-.03f, .03f)), (-.(-.05f, .05f)),
(.(., .)));
(, , ,
(,), + );
;
:
= (<>(,) << (-.(-.05f, .05f)),
(.(-.03f, .03f)), (.(., .)),
(.(-.03f, .03f)), (-.(-.05f, .05f)),(.(., .)),
(.(.0001f, .0003f)), (.(.0001f, .0003f)), .);
(, , ,
(,), + );
;
}
}
= ;
;
( == )
= ::(, , );
= ::(, , );
(!=){
= (, , );
((!) || .())
{
<< << << ;
-;
}
}
{
(
);
}
( > )
<< << ;
( != )
. = ;
= () ();
= (, , , ,
(::+::,
, ));
( == -)
{
<< << ;
<< << << ;
}
= () ();
= (-)/(());
(){
<< << <<
<< << << << ;
}
(, , );
(){
<< << << << ;
}
= (., ., );
( != )
(, , , .(),
+ );
(, , , .(),
+ );
(, );
()
{
<< << << << ;
(, );
(, );
(, );
(, );
(, , );
(, , );
(, , );
(, , );
= ::(,,);
(, .-, .-, );
(, .-, .-, );
;
(, , );
;
(, , &);
<< << << ;
(, );
();
(, );
();
(, );
();
(, ()*/);
();
}
;
}