Ask Your Question

soulloli's profile - activity

2014-05-29 06:39:35 -0600 commented question i cant write to the file mat

Thank you. It earned awwwww~

2014-05-29 06:31:46 -0600 commented question i cant write to the file mat

No, I call this function once

2014-05-29 06:21:14 -0600 asked a question i cant write to the file mat

here is a function of the cascade Haar. But writer_finished.write writes the file only one image.I do something wrong?

void detect(Mat frame)
{
vector<Rect> faces;
Mat frame_gray;
Mat centers(8, 1, CV_32FC1);
//const char *filename_finished = "capture_обработанное.avi";
double fps = 15;
CvSize size = cvSize(640, 480);
VideoWriter writer_finished("capture_обработанное.avi", CV_FOURCC('X', 'V', 'I', 'D'), fps, size, 1);

cvtColor(frame, frame_gray, CV_BGR2GRAY);
equalizeHist(frame_gray, frame_gray);

//нахождение лица
face_cascade.detectMultiScale(frame_gray, faces, 1.15, 2, 0 | CV_HAAR_SCALE_IMAGE, Size(75, 75));

for (size_t i = 0; i < faces.size(); i++)
{
    Point center(faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5);
    ellipse(frame, center, Size(faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar(0, 0, 255), 4, 8, 0);

    Mat faceROI = frame_gray(faces[i]);
    cout << "x " << faces[i].x << " y " << faces[i].y<< endl;


}
if (!frame.empty()) writer_finished.write(frame);
//показываем
imshow(window_name, frame);

    }

    }
2014-05-13 02:40:44 -0600 commented question problem of application of the algorithm to the video k-means

such person is allocated by color and the center with the help of the center of mass. or something I do not understand?

2014-05-13 01:56:07 -0600 commented question problem of application of the algorithm to the video k-means

I want to write that is auto-detected objects are placed in an arbitrary manner, the area of ​​the center and streaming video. Thank you for responding

2014-05-12 17:33:56 -0600 asked a question problem of application of the algorithm to the video k-means

Hello everybody! Faced with the problem of implementing the algorithm to video k-means .I can not understand how to apply to video. No one has a simple example? thanks in advance