반응형
Notice
Recent Posts
Recent Comments
Link
관리 메뉴

bro's coding

affine_transform in C++ 본문

[AI]/openCV

affine_transform in C++

givemebro 2020. 6. 22. 17:35
반응형
void affine_transform() {
	Mat src = loadim();


	Point2f srcPts[3], dstPts[3];
	srcPts[0] = Point2f(0, 0);
	srcPts[1] = Point2f(src.cols - 1, 0);
	srcPts[2] = Point2f(src.cols - 1, src.rows - 1);
	dstPts[0] = Point2f(50, 50);
	dstPts[1] = Point2f(src.cols - 100, 100);
	dstPts[2] = Point2f(src.cols - 50, src.rows - 50);

	Mat M = getAffineTransform(srcPts, dstPts);

	Mat dst;
	warpAffine(src, dst, M, Size());

	imshow("src", src);
	imshow("dst", dst);

	waitKey();
	destroyAllWindows();
}
int main() {

	affine_transform();
	return 0;
}

반응형

'[AI] > openCV' 카테고리의 다른 글

binarization  (0) 2020.06.23
Canny_edge  (0) 2020.06.23
sobel_edge  (0) 2020.06.23
setMouseCallback  (0) 2020.06.23
medianBlur in C++  (0) 2020.06.22
Gaussian(양방향 필터) in C++  (0) 2020.06.22
Gaussian(잡음 추가) in C++  (0) 2020.06.22
GaussianBlur(unsharp) in C++  (0) 2020.06.22
Comments