Demo entry 6757622



Submitted by anonymous on Aug 09, 2018 at 07:29
Language: Objective-C++. Code size: 921 Bytes.

//tutorial no.3, basic operation
int main()
	cv::Mat img = cv::imread("/home/tw/inform_image/image.jpg");

	cv::Mat img_processed;

	cv::resize(img, img_processed, cv::Size(img.cols/2, img.rows/2));

	cv::imshow("img processed1", img_processed);
	cv::Mat R = cv::getRotationMatrix2D(cv::Point2f(img.cols/2, img.rows/2), 45, 1);

	cv::warpAffine(img, img_processed, R, img.size());

	cv::imshow("img", img);
	cv::imshow("img processed2", img_processed);
	cv::imshow("R", R);

	//cv::Canny(img, img_processed, 100, 150);
	cv::Canny(img, img_processed, 200, 300);

	for(int i=1; i<20; i+=2)
		cv::Mat img_blurred;
		cv::blur(img, img_blurred, cv::Size(i, i));

		cv::Mat blur_img;
		cv::Canny(img_blurred, blur_img, 100, 150);

		cv::imshow("img", img);
		cv::imshow("img processed", img_processed);
		cv::imshow("img_blurred", blur_img);

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).