2017. 11. 15. 13:14
fitEllipse
Fits an ellipse around a set of 2D points.
- C++:
fitEllipse
(InputArray points)
- Python:
cv2.
fitEllipse
(points) → retval
- C:
cvFitEllipse2
(const CvArr* points)
- Python:
cv.
FitEllipse2
(points) → Box2D Parameters: points – Input 2D point set, stored in:
std::vector<>
orMat
(C++ interface)CvSeq*
orCvMat*
(C interface)- Nx2 numpy array (Python interface)
The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The algorithm [Fitzgibbon95] is used. Developer should keep in mind that it is possible that the returned ellipse/rotatedRect data contains negative indices, due to the data points being close to the border of the containing Mat element.
Note
- An example using the fitEllipse technique can be found at opencv_source_code/samples/cpp/fitellipse.cpp
'OpenCV' 카테고리의 다른 글
내부 최대 원 찾기 - minEnclosingCircle (0) | 2017.11.15 |
---|---|
적당한 선으로 채우기 fitLine (0) | 2017.11.15 |
형태 볼록함 결점찾기, 구멍찾기 - convexityDefects (0) | 2017.11.15 |
형태 넓이 구하기 - contourArea (0) | 2017.11.15 |
윤곽선 그리기 - DrawContours (0) | 2017.11.15 |