๐Ÿ˜Ž ๊ณต๋ถ€ํ•˜๋Š” ์ง•์ง•์•ŒํŒŒ์นด๋Š” ์ฒ˜์Œ์ด์ง€?

[C++ ๋กœ OpenCV ๊ตฌํ˜„ํ•˜๊ธฐ] (2) Basic Functions (cvtColor, GaussianBlur, Edge detection, dilate, erode) ๋ณธ๋ฌธ

๐Ÿ‘ฉ‍๐Ÿ’ป IoT (Embedded)/Image Processing

[C++ ๋กœ OpenCV ๊ตฌํ˜„ํ•˜๊ธฐ] (2) Basic Functions (cvtColor, GaussianBlur, Edge detection, dilate, erode)

์ง•์ง•์•ŒํŒŒ์นด 2023. 6. 12. 00:58
728x90
๋ฐ˜์‘ํ˜•

<๋ณธ ๋ธ”๋กœ๊ทธ๋Š” Murtaza's Workshop ์˜ ์œ ํŠœ๋ธŒ๋ฅผ ์ฐธ๊ณ ํ•ด์„œ ๊ณต๋ถ€ํ•˜๋ฉฐ ์ž‘์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค :-)>

=> LEARN OPENCV C++ in 4 HOURS | Including 3x Projects | Computer Vision

 

๐ŸŒ€ RGB(Red, Green, Blue) 

์ƒ‰์ƒ์„ ํ‘œํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ๋Š” RGB(Red, Green, Blue)

: ๋นจ๊ฐ•, ์ดˆ๋ก, ํŒŒ๋ž‘ ์„ธ ๊ฐ€์ง€ ์ƒ‰์˜ ๋น›์„ ์„ž์–ด์„œ ์›ํ•˜๋Š” ์ƒ‰์„ ๋งŒ๋“ฆ

: ๊ฐ ์ƒ‰์ƒ์€ 0~255 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ํ‘œ์‹œํ•˜๊ณ  ๊ฐ’์ด ์ปค์งˆ์ˆ˜๋ก ํ•ด๋‹น ์ƒ‰์ƒ์˜ ๋น›์ด ๋ฐ์•„์ง€๋Š” ์›๋ฆฌ

: RGB = (255, 255, 255) ์ผ ๋•Œ๋Š” ํฐ์ƒ‰์ด๊ณ , RGB = (0, 0, 0) ์ผ ๋•Œ๋Š” ๊ฒ€์€์ƒ‰

 

OpenCV๋Š” ๊ทธ ๋ฐ˜๋Œ€์˜ ์ˆœ์„œ์ธ BGR

RGBA๋Š” RGB์— A(์•ŒํŒŒ, alpha)๊ฐ€ ์ถ”๊ฐ€๋œ ์ƒ‰์ƒ ํ‘œ๊ธฐ๋ฒ•

: A๋Š” ๋ฐฐ๊ฒฝ์˜ ํˆฌ๋ช…๋„

: A๊ฐ’์ด 255๋ฉด ํฐ์ƒ‰, 0์ด๋ฉด ๊ฒ€์€์ƒ‰

 

๐ŸŒ€ Basic Functions

๐Ÿ’ง cvtColor

cvtColor( input Array,  output Array, flag)

input Array๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ flag ์— ๋Œ€ํ•œ ์˜ต์…˜์œผ๋กœ ์ด๋ฏธ์ง€ ์ƒ‰์ฑ„๋„์„ ๋ณ€๊ฒฝ

 

COLOR_BGR2GRAY: BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋ฅผ ํšŒ์ƒ‰์กฐ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜
COLOR_GRAY2BGR: ํšŒ์ƒ‰์กฐ ์ด๋ฏธ์ง€๋ฅผ BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜
COLOR_BGR2RGB: BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋ฅผ RGB ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜
COLOR_BGR2HSV: BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋ฅผ HSV ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜
COLOR_HSV2BGR: HSV ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋ฅผ BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜
COLOR_BGR2YUV: BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋ฅผ YUV ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜
COLOR_YUV2BGR: YUB ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋ฅผ BGR ์ƒ‰์ƒ ์ด๋ฏธ์ง€๋กœ ๋ณ€ํ™˜

#include <opencv2/opencv.hpp>		// OpenCV์—์„œ ์ง€์›ํ•˜๋Š” ๋ชจ๋“  ๊ธฐ๋Šฅ
#include <opencv2/videoio.hpp>		// ๋น„๋””์˜ค ์ถ”์  ๋ฐ ๋ฐฐ๊ฒฝ segmentation๊ณผ ๊ด€๋ จ๋œ ๋ฃจํ‹ด
#include <opencv2/imgcodecs.hpp>	// ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ์„ ์–ธ (Mat ์ด๋‚˜ Point๊ฐ€ ์„ ์–ธ, ํ–‰๋ ฌ ์—ฐ์‚ฐ ํ˜น์€ ๋ฒกํ„ฐ ์—ฐ์‚ฐ)
#include <opencv2/highgui.hpp>		// ์œˆ๋„์šฐ ํ™”๋ฉด, UI์ฒ˜๋ฆฌ(์Šฌ๋ผ์ด๋”, ๋ฒ„ํŠผ ๋“ฑ) ๋ฐ ๋งˆ์šฐ์Šค ์ œ์–ด ๊ฐ€๋Šฅ
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

// #1. Read Images Videos and Webcams
// 1) Importing Images
void main() {
	// Mat์€ ์ด๋ฏธ์ง€๋ฅผ ๋‹ด์„ ๊ฐ์ฒด์ด๋‹ค. ํ–‰๋ ฌ ๊ตฌ์„ฑ
	string path = "Resources/alpaca.jpg";
	Mat img = imread(path);
	Mat imgGray;
	Mat imgBlur;

	// cvtColor( input Array,  output Array, flag)
	// : input Array๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ flag ์— ๋Œ€ํ•œ ์˜ต์…˜์œผ๋กœ ์ด๋ฏธ์ง€ ์ƒ‰์ฑ„๋„์„ ๋ณ€๊ฒฝ
	cvtColor(img, imgGray, COLOR_BGR2GRAY);

	imshow("img", img);
	imshow("Gray img", imgGray);

	waitKey(0);
}

 

๐Ÿ’ง GaussianBlur

GaussianBlur( src, dst, kernel_size, sigma_x, sigma_y, borderType) 

๊ฐ€์šฐ์‹œ์•ˆ ๋ธ”๋Ÿฌ๋Š” ์ค‘์•™๊ฐ’์— ๊ฐ€์ค‘์น˜๋ฅผ ๋” ์ฃผ๊ณ  ์ฃผ๋ณ€์€ ๋” ํ๋ฆฌ๊ฒŒ ๋งŒ๋“ ๋‹ค

 

src : ์ž…๋ ฅํ•  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜

dst : ํ•„ํ„ฐ๊ฐ€ ์ ์šฉ๋˜์–ด ์ €์žฅ๋  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜

kernel_size : ๊ฐ€์šฐ์‹œ์•ˆ ํ•จ์ˆ˜๊ฐ€ ์ ์šฉ๋œ ์ปค๋„ ๋งˆ์Šคํฌ์˜ ํฌ๊ธฐ

  โ—‹ sigma_x : X ๋ฐฉํ–ฅ ํ‘œ์ค€ํŽธ์ฐจ

  โ—‹ sigma_y : Y ๋ฐฉํ–ฅ ํ‘œ์ค€ํŽธ์ฐจ, sigma_x ๋งŒ ์„ค์ •ํ•˜๋ฉด ์ž๋™์œผ๋กœ ๊ฐ™์€ ๊ฐ’์œผ๋กœ ์ ์šฉ๋จ

      โ€ป simga_x ์™€ sigma_y ๊ฐ’์„ 0์œผ๋กœ ์‚ฌ์šฉํ•˜๋ฉด ์ปค๋„ ํฌ๊ธฐ์—์„œ ์ž๋™์œผ๋กœ ๊ณ„์‚ฐ ๋จ

borderType : ์ด๋ฏธ์ง€์˜ ํ…Œ๋‘๋ฆฌ ๋ฐ”๊นฅ์ชฝ์˜ ๊ฐ€์ƒ์˜ ํ”ฝ์…€๋“ค์„ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ•  ๊ฒƒ์ธ์ง€ ์„ ํƒ

#include <opencv2/opencv.hpp>		// OpenCV์—์„œ ์ง€์›ํ•˜๋Š” ๋ชจ๋“  ๊ธฐ๋Šฅ
#include <opencv2/videoio.hpp>		// ๋น„๋””์˜ค ์ถ”์  ๋ฐ ๋ฐฐ๊ฒฝ segmentation๊ณผ ๊ด€๋ จ๋œ ๋ฃจํ‹ด
#include <opencv2/imgcodecs.hpp>	// ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ์„ ์–ธ (Mat ์ด๋‚˜ Point๊ฐ€ ์„ ์–ธ, ํ–‰๋ ฌ ์—ฐ์‚ฐ ํ˜น์€ ๋ฒกํ„ฐ ์—ฐ์‚ฐ)
#include <opencv2/highgui.hpp>		// ์œˆ๋„์šฐ ํ™”๋ฉด, UI์ฒ˜๋ฆฌ(์Šฌ๋ผ์ด๋”, ๋ฒ„ํŠผ ๋“ฑ) ๋ฐ ๋งˆ์šฐ์Šค ์ œ์–ด ๊ฐ€๋Šฅ
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

// #1. Read Images Videos and Webcams
// 1) Importing Images
void main() {
	// Mat์€ ์ด๋ฏธ์ง€๋ฅผ ๋‹ด์„ ๊ฐ์ฒด์ด๋‹ค. ํ–‰๋ ฌ ๊ตฌ์„ฑ
	string path = "Resources/alpaca.jpg";
	Mat img = imread(path);
	Mat imgGray;
	Mat imgBlur;

	// cvtColor( input Array,  output Array, flag)
	// : input Array๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ flag ์— ๋Œ€ํ•œ ์˜ต์…˜์œผ๋กœ ์ด๋ฏธ์ง€ ์ƒ‰์ฑ„๋„์„ ๋ณ€๊ฒฝ
	cvtColor(img, imgGray, COLOR_BGR2GRAY);
	// GaussianBlur( src, dst, kernel_size, sigma_x, sigma_y, borderType) 
	// ์ค‘์•™๊ฐ’์— ๊ฐ€์ค‘์น˜๋ฅผ ๋” ์ฃผ๊ณ  ์ฃผ๋ณ€์€ ๋” ํ๋ฆฌ๊ฒŒ
	GaussianBlur(img, imgBlur, Size(3, 3), 3, 0);

	imshow("img", img);
	imshow("Gray img", imgGray);
	imshow("Gray Blur", imgBlur);
	waitKey(0);
}

 

๐Ÿ’ง Canny

์˜์ƒ์ธ์‹์—์„œ ๊ฒฝ๊ณ„์„  ๊ฒ€์ถœ์ด ๋˜์–ด์•ผ ์ปดํ“จํ„ฐ๊ฐ€ ๋ฌผ์ฒด๋ฅผ ์ธ์‹ํ•˜๊ณ  ์ฒ˜๋ฆฌ

๊ฒฝ๊ณ„์„  ๊ฒ€์ถœ, ์บ๋‹ˆ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ( Edge_detection, Canny algorithm )

Canny( src, dst, threshold1, threshold2)

 

src : ์ž…๋ ฅํ•  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜ (grayscale ์ด๋ฏธ์ง€๋ฅผ ์ž…๋ ฅํ•ด์•ผํ•จ)

dst : ํ•„ํ„ฐ๊ฐ€ ์ ์šฉ๋˜์–ด ์ €์žฅ๋  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜

threshold1 : ๋‚ฎ์€ ๊ฒฝ๊ณ„ ๊ฐ’ (0~255)

threshold2 : ๋†’์€ ๊ฒฝ๊ณ„ ๊ฐ’ (0~255)

#include <opencv2/opencv.hpp>		// OpenCV์—์„œ ์ง€์›ํ•˜๋Š” ๋ชจ๋“  ๊ธฐ๋Šฅ
#include <opencv2/videoio.hpp>		// ๋น„๋””์˜ค ์ถ”์  ๋ฐ ๋ฐฐ๊ฒฝ segmentation๊ณผ ๊ด€๋ จ๋œ ๋ฃจํ‹ด
#include <opencv2/imgcodecs.hpp>	// ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ์„ ์–ธ (Mat ์ด๋‚˜ Point๊ฐ€ ์„ ์–ธ, ํ–‰๋ ฌ ์—ฐ์‚ฐ ํ˜น์€ ๋ฒกํ„ฐ ์—ฐ์‚ฐ)
#include <opencv2/highgui.hpp>		// ์œˆ๋„์šฐ ํ™”๋ฉด, UI์ฒ˜๋ฆฌ(์Šฌ๋ผ์ด๋”, ๋ฒ„ํŠผ ๋“ฑ) ๋ฐ ๋งˆ์šฐ์Šค ์ œ์–ด ๊ฐ€๋Šฅ
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

// #1. Read Images Videos and Webcams
// 1) Importing Images
void main() {
	// Mat์€ ์ด๋ฏธ์ง€๋ฅผ ๋‹ด์„ ๊ฐ์ฒด์ด๋‹ค. ํ–‰๋ ฌ ๊ตฌ์„ฑ
	string path = "Resources/alpaca.jpg";
	Mat img = imread(path);
	Mat imgGray;
	Mat imgBlur;
	Mat imgCanny;

	// cvtColor( input Array,  output Array, flag)
	// : input Array๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ flag ์— ๋Œ€ํ•œ ์˜ต์…˜์œผ๋กœ ์ด๋ฏธ์ง€ ์ƒ‰์ฑ„๋„์„ ๋ณ€๊ฒฝ
	cvtColor(img, imgGray, COLOR_BGR2GRAY);
	// GaussianBlur( src, dst, kernel_size, sigma_x, sigma_y, borderType) 
	// ์ค‘์•™๊ฐ’์— ๊ฐ€์ค‘์น˜๋ฅผ ๋” ์ฃผ๊ณ  ์ฃผ๋ณ€์€ ๋” ํ๋ฆฌ๊ฒŒ
	GaussianBlur(img, imgBlur, Size(3, 3), 3, 0);
	Canny(imgBlur, imgCanny, 50, 150);

	imshow("img", img);
	imshow("Gray img", imgGray);
	imshow("Gray Blur", imgBlur);
	imshow("Canny", imgCanny);
	waitKey(0);
}

 

๐Ÿ’ง Morphology 

1) ์นจ์‹ (erode)

erode( src, dst, kernel, anchor, iteration, borderType, borderValue)

 

src : ์ž…๋ ฅํ•  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜ (grayscale ์ด๋ฏธ์ง€๋ฅผ ์ž…๋ ฅํ•ด์•ผํ•จ)

dst : ํ•„ํ„ฐ๊ฐ€ ์ ์šฉ๋˜์–ด ์ €์žฅ๋  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜

kernel : ์นจ์‹์—ฐ์‚ฐ์„ ํ•  mask ํฌ๊ธฐ๋ฅผ ํฌํ•จํ•œ ํ•„ํ„ฐ์— ๋Œ€ํ•œ ์ •๋ณด(์ปค๋„) ํ–‰๋ ฌ

anchor : ์ปค๋„์ด ์ ์šฉ๋  ๋•Œ, ๋ณ€๊ฒฝ๋  ํ”ฝ์…€์˜ ์œ„์น˜, ๊ธฐ๋ณธ์œผ๋กœ Point(-1,-1), Point(-1,-1)์€ ์ค‘์•™

iteration : ๋ฐ˜๋ณตํ•  ํšŸ ์ˆ˜, ์นจ์‹์—ฐ์‚ฐ์„ ๋ฐ˜๋ณตํ•ด์„œ ์ ์šฉ. ๋„ˆ๋ฌด ๋งŽ์ด ๋ฐ˜๋ณตํ•˜๋ฉด object๊ฐ€ ๋‹ค ์—†์–ด์ ธ๋ฒ„๋ฆด ์ˆ˜ ์žˆ์Œ

borderType : ์ด๋ฏธ์ง€ ํ…Œ๋‘๋ฆฌ ๋ถ€๋ถ„์—์„œ ๊ฒฝ๊ณ„ ๋ฐ–์˜ ๊ฐ€์ƒ์˜ ํ”ฝ์…€๋“ค์„ ์ฒ˜๋ฆฌํ•  ๋ฐฉ๋ฒ• ์„ ํƒ (๊ธฐ๋ณธ๊ฐ’์€ mirror padding )

 
 

 

2) ํŒฝ์ฐฝ (dilate)

dilate( srcdst, kernel, anchor, iteration, borderType, borderValue)

 

src : ์ž…๋ ฅํ•  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜ (grayscale ์ด๋ฏธ์ง€๋ฅผ ์ž…๋ ฅํ•ด์•ผํ•จ)

dst : ํ•„ํ„ฐ๊ฐ€ ์ ์šฉ๋˜์–ด ์ €์žฅ๋  ์ด๋ฏธ์ง€ ๋ณ€์ˆ˜

kernel : ํŒฝ์ฐฝ์—ฐ์‚ฐ์„ ํ•  mask ํฌ๊ธฐ๋ฅผ ํฌํ•จํ•œ ํ•„ํ„ฐ์— ๋Œ€ํ•œ ์ •๋ณด(์ปค๋„) ํ–‰๋ ฌ

anchor : ์ปค๋„์ด ์ ์šฉ๋  ๋•Œ, ๋ณ€๊ฒฝ๋  ํ”ฝ์…€์˜ ์œ„์น˜, ๊ธฐ๋ณธ์œผ๋กœ Point(-1,-1), Point(-1,-1)์€ ์ค‘์•™

iteration : ๋ฐ˜๋ณตํ•  ํšŸ ์ˆ˜, ์นจ์‹์—ฐ์‚ฐ์„ ๋ฐ˜๋ณตํ•ด์„œ ์ ์šฉ. ๋„ˆ๋ฌด ๋งŽ์ด ๋ฐ˜๋ณตํ•˜๋ฉด object๊ฐ€ ๋‹ค ์—†์–ด์ ธ๋ฒ„๋ฆด ์ˆ˜ ์žˆ์Œ

borderType : ์ด๋ฏธ์ง€ ํ…Œ๋‘๋ฆฌ ๋ถ€๋ถ„์—์„œ ๊ฒฝ๊ณ„ ๋ฐ–์˜ ๊ฐ€์ƒ์˜ ํ”ฝ์…€๋“ค์„ ์ฒ˜๋ฆฌํ•  ๋ฐฉ๋ฒ• ์„ ํƒ (๊ธฐ๋ณธ๊ฐ’์€ mirror padding )

#include <opencv2/opencv.hpp>		// OpenCV์—์„œ ์ง€์›ํ•˜๋Š” ๋ชจ๋“  ๊ธฐ๋Šฅ
#include <opencv2/videoio.hpp>		// ๋น„๋””์˜ค ์ถ”์  ๋ฐ ๋ฐฐ๊ฒฝ segmentation๊ณผ ๊ด€๋ จ๋œ ๋ฃจํ‹ด
#include <opencv2/imgcodecs.hpp>	// ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ์„ ์–ธ (Mat ์ด๋‚˜ Point๊ฐ€ ์„ ์–ธ, ํ–‰๋ ฌ ์—ฐ์‚ฐ ํ˜น์€ ๋ฒกํ„ฐ ์—ฐ์‚ฐ)
#include <opencv2/highgui.hpp>		// ์œˆ๋„์šฐ ํ™”๋ฉด, UI์ฒ˜๋ฆฌ(์Šฌ๋ผ์ด๋”, ๋ฒ„ํŠผ ๋“ฑ) ๋ฐ ๋งˆ์šฐ์Šค ์ œ์–ด ๊ฐ€๋Šฅ
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

// #1. Read Images Videos and Webcams
// 1) Importing Images
void main() {
	// Mat์€ ์ด๋ฏธ์ง€๋ฅผ ๋‹ด์„ ๊ฐ์ฒด์ด๋‹ค. ํ–‰๋ ฌ ๊ตฌ์„ฑ
	string path = "Resources/alpaca.jpg";
	Mat img = imread(path);
	Mat imgGray;
	Mat imgBlur;
	Mat imgCanny;
	Mat imgDil;
	Mat imgErode;

	// cvtColor( input Array,  output Array, flag)
	// : input Array๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ flag ์— ๋Œ€ํ•œ ์˜ต์…˜์œผ๋กœ ์ด๋ฏธ์ง€ ์ƒ‰์ฑ„๋„์„ ๋ณ€๊ฒฝ
	cvtColor(img, imgGray, COLOR_BGR2GRAY);
	// GaussianBlur( src, dst, kernel_size, sigma_x, sigma_y, borderType) 
	// : ์ค‘์•™๊ฐ’์— ๊ฐ€์ค‘์น˜๋ฅผ ๋” ์ฃผ๊ณ  ์ฃผ๋ณ€์€ ๋” ํ๋ฆฌ๊ฒŒ
	GaussianBlur(img, imgBlur, Size(3, 3), 3, 0);
	// Canny( src, dst, threshold1, threshold2)
	// : ๊ฒฝ๊ณ„์„  ๊ฒ€์ถœ
	Canny(imgBlur, imgCanny, 50, 150);
	Mat kernel = getStructuringElement(MORPH_RECT, Size(5, 5));
	// Morphology 
	// For Erosion : erode( src, dst, kernel, anchor, iteration, borderType, borderValue)
	// : ํฐ์ƒ‰ ํ”ฝ์…€์„ ๋Š˜๋ฆฌ๋Š” ์—ญํ• 
	erode(imgCanny, imgErode, kernel, Point(-1, -1), 1);
	// For Dilation : dilate( src, dst, kernel, anchor, iteration, borderType, borderValue)
	// : ํฐ์ƒ‰ ํ”ฝ์…€์„ ์ค„์ด๋Š” ์—ญํ• 
	dilate(imgCanny, imgDil, kernel, Point(-1, -1), 1);

	imshow("img", img);
	imshow("Gray img", imgGray);
	imshow("Gray Blur", imgBlur);
	imshow("Canny", imgCanny);
	imshow("Dilation", imgDil);
	imshow("Erode", imgErode);

	waitKey(0);
}
728x90
๋ฐ˜์‘ํ˜•
Comments