Created
January 30, 2019 05:14
-
-
Save hkhojasteh/dbd36d5f806dbd7c31626c1718dff2f5 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
Mat mask_hsv_yellow, mask_white, img_mask; | |
//Make target image by apply yellow and white mask | |
Scalar m = mean(img_gray); | |
cvtColor(img, mask_hsv_yellow, CV_BGR2HSV); | |
inRange(img_crop, Scalar(20, 85, 85), Scalar(30, 255, 255), mask_hsv_yellow); | |
inRange(img_gray, Scalar(m[0] + (255 - m[0]) / 3.5), Scalar(255), mask_white); | |
bitwise_or(mask_white, mask_hsv_yellow, img_mask); | |
GaussianBlur(img_mask, img_mask, cv::Size(5, 5), 0); | |
imshow("Mask", img_mask); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment