fixing other white spaces
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
/**
|
||||
* @file bg_sub.cpp
|
||||
* @brief Background subtraction tutorial sample code
|
||||
* @author Domenico D. Bloisi
|
||||
*/
|
||||
|
||||
//opencv
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/highgui/highgui_c.h>
|
||||
#include <opencv2/video/background_segm.hpp>
|
||||
//C
|
||||
#include <stdio.h>
|
||||
@@ -11,7 +16,7 @@
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
//global variables
|
||||
// Global variables
|
||||
Mat frame; //current frame
|
||||
Mat fgMaskMOG; //fg mask generated by MOG method
|
||||
Mat fgMaskMOG2; //fg mask fg mask generated by MOG2 method
|
||||
@@ -19,7 +24,7 @@ Ptr<BackgroundSubtractor> pMOG; //MOG Background subtractor
|
||||
Ptr<BackgroundSubtractor> pMOG2; //MOG2 Background subtractor
|
||||
int keyboard; //input from keyboard
|
||||
|
||||
//function declarations
|
||||
/** Function Headers */
|
||||
void help();
|
||||
void processVideo(char* videoFilename);
|
||||
void processImages(char* firstFrameFilename);
|
||||
@@ -39,6 +44,9 @@ void help()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function main
|
||||
*/
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
//print help information
|
||||
@@ -79,6 +87,9 @@ int main(int argc, char* argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function processVideo
|
||||
*/
|
||||
void processVideo(char* videoFilename) {
|
||||
//create the capture object
|
||||
VideoCapture capture(videoFilename);
|
||||
@@ -101,11 +112,11 @@ void processVideo(char* videoFilename) {
|
||||
//get the frame number and write it on the current frame
|
||||
stringstream ss;
|
||||
rectangle(frame, cv::Point(10, 2), cv::Point(100,20),
|
||||
cv::Scalar(255,255,255), -1);
|
||||
ss << capture.get(CV_CAP_PROP_POS_FRAMES);
|
||||
string frameNumberString = ss.str();
|
||||
putText(frame, frameNumberString.c_str(), cv::Point(15, 15),
|
||||
CV_FONT_NORMAL, 0.5 , cv::Scalar(0,0,0));
|
||||
cv::Scalar(255,255,255), -1);
|
||||
ss << capture.get(CAP_PROP_POS_FRAMES);
|
||||
string frameNumberString = ss.str();
|
||||
putText(frame, frameNumberString.c_str(), cv::Point(15, 15),
|
||||
FONT_HERSHEY_SIMPLEX, 0.5 , cv::Scalar(0,0,0));
|
||||
//show the current frame and the fg masks
|
||||
imshow("Frame", frame);
|
||||
imshow("FG Mask MOG", fgMaskMOG);
|
||||
@@ -117,6 +128,9 @@ void processVideo(char* videoFilename) {
|
||||
capture.release();
|
||||
}
|
||||
|
||||
/**
|
||||
* @function processImages
|
||||
*/
|
||||
void processImages(char* fistFrameFilename) {
|
||||
//read the first file of the sequence
|
||||
frame = imread(fistFrameFilename);
|
||||
@@ -145,9 +159,9 @@ void processImages(char* fistFrameFilename) {
|
||||
int frameNumber;
|
||||
iss >> frameNumber;
|
||||
rectangle(frame, cv::Point(10, 2), cv::Point(100,20),
|
||||
cv::Scalar(255,255,255), -1);
|
||||
cv::Scalar(255,255,255), -1);
|
||||
putText(frame, frameNumberString.c_str(), cv::Point(15, 15),
|
||||
CV_FONT_NORMAL, 0.5 , cv::Scalar(0,0,0));
|
||||
FONT_HERSHEY_SIMPLEX, 0.5 , cv::Scalar(0,0,0));
|
||||
//show the current frame and the fg masks
|
||||
imshow("Frame", frame);
|
||||
imshow("FG Mask MOG", fgMaskMOG);
|
||||
|
Reference in New Issue
Block a user