Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Doing an adaptive thresholding to a grayscale image

$
0
0
I have a png image which is in grayscale 'test.png'. I need to do an adaptive thresholding to this image. I am using opencv2. image = cv2.imread('test_big.png') im = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 2) I am not able to do thresholding since the image is not in grayscale. So I tried to read the image as grayscale image = cv2.imread('test_big.png',1) Now I can do the thresholding but the output will be a blue and red image instead of black and white. Can anyone help Plsss

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>