Skip to content

Commit 5f4ea91

Browse files
committed
controller.cpp modified
1 parent 6b5934b commit 5f4ea91

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ int main()
4545
Controller controller = Controller();
4646
while (cap.read(frame)) {
4747
controller.Process(frame);
48+
cv::imshow("frame", frame);
4849
int key = cv::waitKey(1);
4950
if (key == 27)
5051
return 0;

src/controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void Controller::Process(cv::Mat frame)
3333
return;
3434

3535
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);
3737
std::cout << "Threshold = " << threshold << std::endl;
3838
}
3939
if (topthreshold == 0) {

src/vibe.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ViBe::ViBe(int width, int height)
1212

1313
void ViBe::Initialize(cv::Mat firstframe)
1414
{
15-
N = 10;
16-
R = 20;
15+
N = 2;
16+
R = 40;
1717
smin = 1;
1818
r_s = 20 ;
1919
samples = std::vector<cv::Mat>(N);
@@ -25,6 +25,7 @@ void ViBe::Initialize(cv::Mat firstframe)
2525

2626
void ViBe::Process(cv::Mat image, cv::Mat& segMap)
2727
{
28+
segMap = cv::Mat(image.size(), CV_8UC1);
2829
for (int x = 0; x < image.cols ; x++){
2930
for (int y = 0 ; y < image.rows; y++) {
3031
int count = 0, index = 0 , dist = 0;

0 commit comments

Comments
 (0)