비슷한 모양을 가진 모양과 같은 원이있는 이미지가 있습니다. 나는이 두 가지 형태의 영역을 찾으려고 노력하고있다. openCv C++ Hough circle 감지를 사용하고 있지만 모양을 감지하지 못합니다. OpenCV의 다른 기능이 도형을 감지하고 아레스를 찾는 데 사용할 수 있습니까?OpenCV 원형 모양 감지 및 그 지역
[편집] 이미지가 추가되었습니다. 당신은 (완전히 또는 매우 거의 조인 가장자리)는 일반적으로 가장자리로 쉽게 전체 모양이있는 경우
가 여기 내 예제 코드
int main()
{
Mat src, gray;
src = imread("detect_circles_simple.jpg", 1);resize(src,src,Size(640,480));
cvtColor(src, gray, CV_BGR2GRAY);
// Reduce the noise so we avoid false circle detection
GaussianBlur(gray, gray, Size(9, 9), 2, 2);
vector<Vec3f> circles;
// Apply the Hough Transform to find the circles
HoughCircles(gray, circles, CV_HOUGH_GRADIENT, 1, 30, 200, 50, 0, 0);
cout << "No. of circles : " << circles.size()<<endl;
// Draw the circles detected
for(size_t i = 0; i < circles.size(); i++)
{
Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));
int radius = cvRound(circles[i][2]);
circle(src, center, 3, Scalar(0,255,0), -1, 8, 0);// circle center
circle(src, center, radius, Scalar(0,0,255), 3, 8, 0);// circle outline
cout << "center : " << center << "\nradius : " << radius << endl;
}
exit(0);
// Show your results
namedWindow("Hough Circle Transform Demo", CV_WINDOW_AUTOSIZE);
imshow("Hough Circle Transform Demo", src);
waitKey(0);
return 0;
}
예, 천 명이 넘습니다. 특정 답변이 필요한 경우 코드와 이미지를 제공하십시오. – m3h0w
@ m3h0w 내가 작업중인 이미지를 – viz12
@ viz12에 추가했습니다. 민감한 사진을 처리 할 때 화면의 사진을 찍기 위해 휴대 전화 카메라를 사용해서는 안됩니다.이 경우 많은 유물이 있습니다. 원본 이미지를 보내거나 최소한 "스크린 인쇄"버튼을 사용하여 스크린 샷을 찍으십시오. – Liberus