本文整理汇总了C++中cv::OutputArray::copyTo方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputArray::copyTo方法的具体用法?C++ OutputArray::copyTo怎么用?C++ OutputArray::copyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cv::OutputArray
的用法示例。
在下文中一共展示了OutputArray::copyTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessFrame
void FaceDetectorModule::ProcessFrame(cv::InputArray in, cv::OutputArray out){
if(IsEnabled()){
float scale = imageScale;
float unscale = 1.0/scale;
cv::UMat latestStep;
in.copyTo(latestStep);
cv::resize(latestStep, latestStep, cv::Size(), scale, scale, INTER_NEAREST);
cvtColor( latestStep, latestStep, CV_BGR2GRAY );
equalizeHist( latestStep, latestStep );
cv::UMat outCopy;
//outCopy = cv::Mat(in.cols(), in.rows(), in.type());
out.copyTo(outCopy);
std::vector<cv::Rect> faces;
//-- Detect faces
face_cascade.detectMultiScale( latestStep, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, cv::Size(30, 30) );
//http://docs.opencv.org/3.0.0/db/d28/tutorial_cascade_classifier.html
for( size_t i = 0; i < faces.size(); i++ )
{
cv::Point center( (faces[i].x + faces[i].width*0.5) * unscale, (faces[i].y + faces[i].height*0.5) * unscale);
ellipse( outCopy, center, cv::Size( (faces[i].width*0.5) * unscale, (faces[i].height*0.5) * unscale), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );
/*
cv::UMat faceROI = latestStep( faces[i] );
std::vector<cv::Rect> eyes;
//-- In each face, detect eyes
eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CASCADE_SCALE_IMAGE, cv::Size(30, 30) );
for( size_t j = 0; j < eyes.size(); j++ )
{
cv::Point eye_center( (faces[i].x + eyes[j].x + eyes[j].width/2) * unscale, (faces[i].y + eyes[j].y + eyes[j].height/2) * unscale );
int radius = cvRound( (eyes[j].width + eyes[j].height) * 0.25 * unscale );
circle( outCopy, eye_center, radius, Scalar( 255, 0, 0 ), 4, 8, 0 );
}
*/
}
outCopy.copyTo(out);
}
else{
//in.copyTo(out);
}
}