File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ int main()
45
45
Controller controller = Controller ();
46
46
while (cap.read (frame)) {
47
47
controller.Process (frame);
48
+ cv::imshow (" frame" , frame);
48
49
int key = cv::waitKey (1 );
49
50
if (key == 27 )
50
51
return 0 ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ void Controller::Process(cv::Mat frame)
33
33
return ;
34
34
35
35
if (threshold == 0 ) {
36
- threshold = static_cast <int >(frame.rows * frame.cols * 0.1 );
36
+ threshold = static_cast <int >(frame.rows * frame.cols * 0.05 );
37
37
std::cout << " Threshold = " << threshold << std::endl;
38
38
}
39
39
if (topthreshold == 0 ) {
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ ViBe::ViBe(int width, int height)
12
12
13
13
void ViBe::Initialize (cv::Mat firstframe)
14
14
{
15
- N = 10 ;
16
- R = 20 ;
15
+ N = 2 ;
16
+ R = 40 ;
17
17
smin = 1 ;
18
18
r_s = 20 ;
19
19
samples = std::vector<cv::Mat>(N);
@@ -25,6 +25,7 @@ void ViBe::Initialize(cv::Mat firstframe)
25
25
26
26
void ViBe::Process (cv::Mat image, cv::Mat& segMap)
27
27
{
28
+ segMap = cv::Mat (image.size (), CV_8UC1);
28
29
for (int x = 0 ; x < image.cols ; x++){
29
30
for (int y = 0 ; y < image.rows ; y++) {
30
31
int count = 0 , index = 0 , dist = 0 ;
You can’t perform that action at this time.
0 commit comments