求解圆心怎么输出!求大神指点!
if( cascade )
{
double t = (double)cvGetTickCount();//?? cvGetTickCount ???????????(????? CPU ?ticks ??)??? tics ???
CvSeq* faces = cvHaarDetectObjects( small_img, cascade, storage, //????????(?) CvSeq?????????
1.2, 5, 0
//|CV_HAAR_FIND_BIGGEST_OBJECT
//|CV_HAAR_DO_ROUGH_SEARCH
|CV_HAAR_DO_CANNY_PRUNING
//|CV_HAAR_SCALE_IMAGE
,
cvSize(10, 40) );
t = (double)cvGetTickCount() - t;
printf( "detection time = %gms\n", t/((double)cvGetTickFrequency()*1000.) );//????????????????????
for( i = 0; i < (faces ? faces->total : 0); i++ )//?????????????????
{ //? total ?????????????????????????????i=face->total
CvRect* r = (CvRect*)cvGetSeqElem( faces, i );//CvRect?????????cvGetSeqElem( ??,?? )????????????
//????????????????,??????????r?
CvMat small_img_roi;
CvSeq* nested_objects;
CvPoint center;
CvScalar color = colors[i%8];
int radius;
center.x = cvRound((r->x + r->width*0.5)*scale);
center.y = cvRound((r->y + r->height*0.5)*scale);//center?????????
radius = cvRound((r->width + r->height)*0.25*scale);//?
cvCircle( img, center, radius, color, 3, 8, 0 );//????????
/* cvRectangle( img, cvPoint(r->x*scale,r->y*scale),
cvPoint((r->x+r->width)*scale,
(r->y+r->height)*scale),
CV_RGB(255,0,0), 3 );//??????*/
if( !nested_cascade )//???????????,???,??????
continue;
cvGetSubRect( small_img, &small_img_roi, *r );//??????????????????????
//?samll-img???r?????,??&small_img_roi?,???????????
nested_objects = cvHaarDetectObjects( &small_img_roi, nested_cascade, storage,//?&small_img_roi??nestedcascade????
1.1, 2, 0
//|CV_HAAR_FIND_BIGGEST_OBJECT
//|CV_HAAR_DO_ROUGH_SEARCH
//|CV_HAAR_DO_CANNY_PRUNING
//|CV_HAAR_SCALE_IMAGE
,
cvSize(0, 0)/*????00?*/ );
for( j = 0; j < (nested_objects ? nested_objects->total : 0); j++ )//????????????????????
{
CvRect* nr = (CvRect*)cvGetSeqElem( nested_objects, j );
center.x = cvRound((r->x + nr->x + nr->width*0.5)*scale);
center.y = cvRound((r->y + nr->y + nr->height*0.5)*scale);
radius = cvRound((nr->width + nr->height)*0.25*scale);
cvCircle( img, center, radius, color, 3, 8, 0 );
}
}
}
求解红色处这两个值怎么输出:center.x ,center.y 在控制台或者加一个label输出都行 能输出就行。
{
double t = (double)cvGetTickCount();//?? cvGetTickCount ???????????(????? CPU ?ticks ??)??? tics ???
CvSeq* faces = cvHaarDetectObjects( small_img, cascade, storage, //????????(?) CvSeq?????????
1.2, 5, 0
//|CV_HAAR_FIND_BIGGEST_OBJECT
//|CV_HAAR_DO_ROUGH_SEARCH
|CV_HAAR_DO_CANNY_PRUNING
//|CV_HAAR_SCALE_IMAGE
,
cvSize(10, 40) );
t = (double)cvGetTickCount() - t;
printf( "detection time = %gms\n", t/((double)cvGetTickFrequency()*1000.) );//????????????????????
for( i = 0; i < (faces ? faces->total : 0); i++ )//?????????????????
{ //? total ?????????????????????????????i=face->total
CvRect* r = (CvRect*)cvGetSeqElem( faces, i );//CvRect?????????cvGetSeqElem( ??,?? )????????????
//????????????????,??????????r?
CvMat small_img_roi;
CvSeq* nested_objects;
CvPoint center;
CvScalar color = colors[i%8];
int radius;
center.x = cvRound((r->x + r->width*0.5)*scale);
center.y = cvRound((r->y + r->height*0.5)*scale);//center?????????
radius = cvRound((r->width + r->height)*0.25*scale);//?
cvCircle( img, center, radius, color, 3, 8, 0 );//????????
/* cvRectangle( img, cvPoint(r->x*scale,r->y*scale),
cvPoint((r->x+r->width)*scale,
(r->y+r->height)*scale),
CV_RGB(255,0,0), 3 );//??????*/
if( !nested_cascade )//???????????,???,??????
continue;
cvGetSubRect( small_img, &small_img_roi, *r );//??????????????????????
//?samll-img???r?????,??&small_img_roi?,???????????
nested_objects = cvHaarDetectObjects( &small_img_roi, nested_cascade, storage,//?&small_img_roi??nestedcascade????
1.1, 2, 0
//|CV_HAAR_FIND_BIGGEST_OBJECT
//|CV_HAAR_DO_ROUGH_SEARCH
//|CV_HAAR_DO_CANNY_PRUNING
//|CV_HAAR_SCALE_IMAGE
,
cvSize(0, 0)/*????00?*/ );
for( j = 0; j < (nested_objects ? nested_objects->total : 0); j++ )//????????????????????
{
CvRect* nr = (CvRect*)cvGetSeqElem( nested_objects, j );
center.x = cvRound((r->x + nr->x + nr->width*0.5)*scale);
center.y = cvRound((r->y + nr->y + nr->height*0.5)*scale);
radius = cvRound((nr->width + nr->height)*0.25*scale);
cvCircle( img, center, radius, color, 3, 8, 0 );
}
}
}
求解红色处这两个值怎么输出:center.x ,center.y 在控制台或者加一个label输出都行 能输出就行。
...全文
相关推荐
已知圆上两点坐标及圆心角,求圆心坐标算法
这里给出一个已知两点坐标和圆心角,求圆心坐标的程序源码,供大家参考,代码涉及大量数学推导,求解出唯一的圆心坐标,
如何根据三点求圆心
若三点坐标为(1,2)(1,2)、(3,4)(3,4)、(5,6)(5,6),先求线段AB(1,2-3,4)和AC(1,2-5,6)的垂直平分线方程,联立解得圆心。:两种方法均要求三点不共线,否则无解。垂直平分线法更直观,适合手工绘图;代数方程法适合编程或数值计算。:任意两条弦的垂直平分线交点即为圆心。
三点求圆心_三点求圆心_三个点求圆心_3点求圆心_圆心_求圆心_
通过三个点坐标,求出圆心坐标。C#代码,主要是算法。
用MATLAB求圆心及半径
用MATLAB找一个圆形的圆心并求解其半径
MATLAB拟合求圆心
MATLAB拟合求圆心和半径,利用在excel表中的数据求出圆心坐标和半径大小,并标记显示。已运行成功,无错误。


