Created
January 30, 2019 05:33
-
-
Save hkhojasteh/a88e6a14bfd2cd900a4ff85bfb304d1f 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
//Crop image and convert to gray, blur, sharpen, bitwise_not and black-white image | |
Mat img_gray, img_sharp, img_sharp_not, img_zeroone; | |
cvtColor(crop, img_gray, CV_BGR2GRAY); | |
blur(img_gray, img_gray, Size(4, 4)); | |
GaussianBlur(img_gray, img_sharp, cv::Size(0, 0), 6); | |
addWeighted(img_gray, 1.80, img_sharp, -0.55, 0, img_sharp); | |
bitwise_not(img_sharp, img_sharp_not); | |
threshold(img_sharp_not, img_zeroone, 20, 255, THRESH_BINARY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment