1
다음 프로그램에서 cvPoint 값에서 좌표의 x 및 y 값을 찾아야합니다.cvPoint에서 x 및 y 좌표를 int로 개별적으로 가져 오는 방법은 무엇입니까?
for(int i=0; i<nomdef; i++)
{
if(defectArray[i].depth > 40)
{
con=con+1;
cvLine(src, *(defectArray[i].start), *(defectArray[i].depth_point),CV_RGB(255,255,0),1, CV_AA, 0);
cvCircle(src, *(defectArray[i].depth_point), 5, CV_RGB(0,0,255), 2, 8,0);
cvCircle(src, *(defectArray[i].start), 5, CV_RGB(0,255,0), 2, 8,0);
cvLine(src, *(defectArray[i].depth_point), *(defectArray[i].end),CV_RGB(0,255,255),1, CV_AA, 0);
cvDrawContours(src,defects,CV_RGB(0,0,0),CV_RGB(255,0,0),-1,CV_FILLED,8);
}
}
원은 점들을 사용하여 그려집니다. 포인트에서 x와 y 좌표를 가져와야합니다. 결함 어레이는 CvConvexityDefect* defectArray
에 의해 생성됩니다.
요청을 쓸 수 있습니다 귀하의 경우
로 '에'X '를 x 및 y 값에 액세스 할 수 있습니다 'CvPoint *'포인터 유형의 (CvConvexityDefect :: start) '(어쩌면 당신은'-> '를 사용하려고 했나요?) int x1 = * (defectArray [1] .start) .x; 나는 그것에 대해 오류가 있었는데 .. 어떻게해야합니까? –