Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
aa3e4814
Commit
aa3e4814
authored
Jun 01, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed logging function in opencv_stitching
parent
8191b556
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
75 deletions
+75
-75
util.hpp
modules/stitching/util.hpp
+75
-75
No files found.
modules/stitching/util.hpp
View file @
aa3e4814
...
@@ -38,78 +38,78 @@
...
@@ -38,78 +38,78 @@
// or tort (including negligence or otherwise) arising in any way out of
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
// the use of this software, even if advised of the possibility of such damage.
//
//
//M*/
//M*/
#ifndef __OPENCV_STITCHING_UTIL_HPP__
#ifndef __OPENCV_STITCHING_UTIL_HPP__
#define __OPENCV_STITCHING_UTIL_HPP__
#define __OPENCV_STITCHING_UTIL_HPP__
#include <list>
#include <list>
#include "precomp.hpp"
#include "precomp.hpp"
#define ENABLE_LOG 1
#define ENABLE_LOG 1
#if ENABLE_LOG
#if ENABLE_LOG
#include <iostream>
#include <iostream>
#define LOG(msg)
std::cout << msg;
#define LOG(msg)
{ std::cout << msg; std::cout.flush(); }
#else
#else
#define LOG(msg)
#define LOG(msg)
#endif
#endif
#define LOGLN(msg) LOG(msg << std::endl)
#define LOGLN(msg) LOG(msg << std::endl)
class
DjSets
class
DjSets
{
{
public
:
public
:
DjSets
(
int
n
=
0
)
{
create
(
n
);
}
DjSets
(
int
n
=
0
)
{
create
(
n
);
}
void
create
(
int
n
);
void
create
(
int
n
);
int
find
(
int
elem
);
int
find
(
int
elem
);
int
merge
(
int
set1
,
int
set2
);
int
merge
(
int
set1
,
int
set2
);
std
::
vector
<
int
>
parent
;
std
::
vector
<
int
>
parent
;
std
::
vector
<
int
>
size
;
std
::
vector
<
int
>
size
;
private
:
private
:
std
::
vector
<
int
>
rank_
;
std
::
vector
<
int
>
rank_
;
};
};
struct
GraphEdge
struct
GraphEdge
{
{
GraphEdge
(
int
from
,
int
to
,
float
weight
)
GraphEdge
(
int
from
,
int
to
,
float
weight
)
:
from
(
from
),
to
(
to
),
weight
(
weight
)
{}
:
from
(
from
),
to
(
to
),
weight
(
weight
)
{}
bool
operator
<
(
const
GraphEdge
&
other
)
const
{
return
weight
<
other
.
weight
;
}
bool
operator
<
(
const
GraphEdge
&
other
)
const
{
return
weight
<
other
.
weight
;
}
bool
operator
>
(
const
GraphEdge
&
other
)
const
{
return
weight
>
other
.
weight
;
}
bool
operator
>
(
const
GraphEdge
&
other
)
const
{
return
weight
>
other
.
weight
;
}
int
from
,
to
;
int
from
,
to
;
float
weight
;
float
weight
;
};
};
class
Graph
class
Graph
{
{
public
:
public
:
Graph
(
int
num_vertices
=
0
)
{
create
(
num_vertices
);
}
Graph
(
int
num_vertices
=
0
)
{
create
(
num_vertices
);
}
void
create
(
int
num_vertices
)
{
edges_
.
assign
(
num_vertices
,
std
::
list
<
GraphEdge
>
());
}
void
create
(
int
num_vertices
)
{
edges_
.
assign
(
num_vertices
,
std
::
list
<
GraphEdge
>
());
}
int
numVertices
()
const
{
return
static_cast
<
int
>
(
edges_
.
size
());
}
int
numVertices
()
const
{
return
static_cast
<
int
>
(
edges_
.
size
());
}
void
addEdge
(
int
from
,
int
to
,
float
weight
);
void
addEdge
(
int
from
,
int
to
,
float
weight
);
template
<
typename
B
>
B
forEach
(
B
body
)
const
;
template
<
typename
B
>
B
forEach
(
B
body
)
const
;
template
<
typename
B
>
B
walkBreadthFirst
(
int
from
,
B
body
)
const
;
template
<
typename
B
>
B
walkBreadthFirst
(
int
from
,
B
body
)
const
;
private
:
private
:
std
::
vector
<
std
::
list
<
GraphEdge
>
>
edges_
;
std
::
vector
<
std
::
list
<
GraphEdge
>
>
edges_
;
};
};
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Auxiliary functions
// Auxiliary functions
bool
overlapRoi
(
cv
::
Point
tl1
,
cv
::
Point
tl2
,
cv
::
Size
sz1
,
cv
::
Size
sz2
,
cv
::
Rect
&
roi
);
bool
overlapRoi
(
cv
::
Point
tl1
,
cv
::
Point
tl2
,
cv
::
Size
sz1
,
cv
::
Size
sz2
,
cv
::
Rect
&
roi
);
cv
::
Rect
resultRoi
(
const
std
::
vector
<
cv
::
Point
>
&
corners
,
const
std
::
vector
<
cv
::
Mat
>
&
images
);
cv
::
Rect
resultRoi
(
const
std
::
vector
<
cv
::
Point
>
&
corners
,
const
std
::
vector
<
cv
::
Mat
>
&
images
);
cv
::
Rect
resultRoi
(
const
std
::
vector
<
cv
::
Point
>
&
corners
,
const
std
::
vector
<
cv
::
Size
>
&
sizes
);
cv
::
Rect
resultRoi
(
const
std
::
vector
<
cv
::
Point
>
&
corners
,
const
std
::
vector
<
cv
::
Size
>
&
sizes
);
cv
::
Point
resultTl
(
const
std
::
vector
<
cv
::
Point
>
&
corners
);
cv
::
Point
resultTl
(
const
std
::
vector
<
cv
::
Point
>
&
corners
);
#include "util_inl.hpp"
#include "util_inl.hpp"
#endif // __OPENCV_STITCHING_UTIL_HPP__
#endif // __OPENCV_STITCHING_UTIL_HPP__
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment