-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracking.cpp
More file actions
42 lines (36 loc) · 794 Bytes
/
tracking.cpp
File metadata and controls
42 lines (36 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "tracking.h"
void Tracking::applyImage( cv::Mat im ) {
image = im;
}
void Tracking::openImage( std::string path ) {
applyImage( cv::imread( path ) );
}
void Tracking::showDebugWindows() {
if( debug ) {
for( auto p : debug_win ) {
if( !p.second.empty() ) {
imshow( p.first, p.second );
}
}
}
}
void Tracking::resetDebugWindows() {
debug_num = 0;
}
void Tracking::createDebugWindow( Mat& im ) {
if( debug ) {
auto winname = "Debug " + std::to_string( debug_num );
if( !debug_win.count( winname ) )
namedWindow( winname, CV_WINDOW_AUTOSIZE );
debug_num += 1;
Mat im2;
im.copyTo( im2 );
debug_win[ winname ] = im2;
}
}
void Tracking::convertBGRtoHSV() {
if( !image.empty() ) {
cvtColor( image, hsv, CV_BGR2HSV );
split( hsv, channels );
}
}