1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #include <3vmw9.hpp> #include <opencv2/opencv.hpp> using namespace cv; using namespace rv2; using namespace std; int main(int argc, char** argv) { Mat img_rgb, img_gry, img_cny, img_pry; namedWindow("example pry", 1); img_rgb = imread("c:\\test.jpg"); cvtColor(img_rgb, img_gry, COLOR_BGR2GRAY); pyrDown(img_gry, img_pry); pyrDown(img_pry, img_pry); Canny(img_pry, img_pry, 10, 100, 3, true); imshow("example pry", img_pry); int x = 16, y = 32; Vec3b intensity = img_rgb.at<Vec3b>(x, y); uchar blue = intensity[0]; uchar green = intensity[1]; uchar red = intensity[2]; x /= 4; y /= 4; cout << " pyr pixel" << (unsigned int) img_pry.at<uchar>(x, y) << endl; img_pry.at<uchar>(x, y) = 128; waitKey(0); return 0; } | cs |
opencv 다운 샘플링, 캐니. 픽셀접근
2019. 2. 2. 22:49