Last active
January 30, 2019 05:28
-
-
Save hkhojasteh/259cd19c83e9bb58eb29fb6848841a56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat3b img = imread(argv[1]); //Load image | |
Rect roi(0, 420, img.cols, img.rows - 500); //Setup a rectangle to define region of interest | |
Mat3b img_crop = img(roi); //Crop the full image to rectangle ROI | |
Mat img_gray; | |
cvtColor(img_crop, img_gray, CV_BGR2GRAY); //Convert image to gray | |
//Show results | |
imshow("Original", img); | |
imshow("Crop", img_crop); | |
imshow("Gray", img_gray); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment