I'd like use cv2.imshow("Otsu img", binary) instead of plt.imshow( binary)
I got the error
Full code:
import matplotlib.pyplot as plt
from skimage import io
from skimage.filters.rank import entropy
from skimage.morphology import disk
import numpy as np
from skimage.filters import threshold_otsu
import cv2
img = io.imread("scratch.jpg")
entropy_img = entropy(img, disk(10))
thresh = threshold_otsu(entropy_img)
binary = entropy_img <= thresh
cv2.imshow("Otsu img", binary)
cv2.waitKey(0)
cv2.destroyAllWindows()
How to fix this error?
cv2.imshow("Otsu img", binary)
TypeError: mat data type = 0 is not supported