OpenCV 그리기 함수

BERT·2023년 4월 19일
0

Computer Vision

목록 보기
12/56

직선 그리기

img 입출력 영상
pt1 시작점 좌표
pt2 끝점 좌표
color 선 색상
thickness 선 두께
lineType 선 타입
shift 그리기 좌표 값의 축소 비율

void line(InputOutputArray img, 
		  Point pt1, Point pt2,
		  const Scalar& color, 
          int thickness = 1, 
          int lineType = LINE_8,
          int shift = 0);

사각형 그리기

img 입출력 영상
rec 사각형 위치 정보
color 선 색상
thickness 선 두께 (-1 : 내부 채움)
lineType 선 타입 (LINE_4, LINE_8, LINE_AA)
shift 그리기 좌표 값의 축소 비율

void rectangle(InputOutputArray img,
			   Rect rec,
               const Scalar& color,
               int thickness = 1,
               int linetype = LINE_8,
               int shift = 0);

원 그리기

img 입출력 영상
center 원 중심 좌표
radius 원 반지름
color 선 색상
thickness 선 두께 (-1 : 내부 채움)
lineType 선 타입 (LINE_4, LINE_8, LINE_AA)
shift 그리기 좌표 값의 축소 비율

void circle(InputOutputArray img, 
            Point center,
            int radius, 
            const Scalar& color, 
            int thickness = 1,
            int lineType = LINE_8,
            int shift = 0);

다각형 그리기

img 입출력 영상
pts 다각형 외곽선 점들의 집합
isClosed true면 시작점과 끝점을 서루 이음(폐곡선)
color 선 색상
thickness 선 두께 (-1 : 내부 채움)
lineType 선 타입 (LINE_4, LINE_8, LINE_AA)
shift 그리기 좌표 값의 축소 비율

void polylines(InputOutputArray img, 
            InputOutputArrays pts,
            bool isClosed, 
            const Scalar& color, 
            int thickness = 1,
            int lineType = LINE_8,
            int shift = 0);

문자열 출력하기

img 입출력 영상
text 출력할 문자열
org 문자열이 출력될 좌측 하단 시작 좌표
fontFace 폰트 종류 (cv:::HershyFonts 참조)
fontScale 폰트 크기 지정
color 문자열 색상
thickness 폰트 두께
lineType 선 타입 (LINE_4, LINE_8, LINE_AA)

void polylines(InputOutputArray img, 
            InputOutputArrays pts,
            bool isClosed, 
            const Scalar& color, 
            int thickness = 1,
            int lineType = LINE_8,
            int shift = 0);

0개의 댓글