Unable to Process an image transformed in OpenCV via scikit-image
<p>I want to skeletonize an image using the scikit-image module for skeletonization. This image is pre processed by OpenCV library. Given an Image 'Feb_16-0.jpg', I convert it to gray scale, perform the morphological transformation of opening the image, then apply the Gaussian Blur and adaptive thresholding using OpenCV and Python:</p>

<pre><code>import cv2
import numpy as np
from matplotlib import pyplot as plt
from skimage.morphology import skeletonize
from skimage.viewer import ImageViewer
img = cv2.imread('Feb_16-0.jpg',0)
kernel = np.ones((1,1),np.uint8)
opening = cv2.morphologyEx(img, cv2.MORPH_OPEN, kernel)
blur = cv2.GaussianBlur(opening,(1,1),0)
ret3,th4 = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
</code></pre>

<p>I now want to skeletonize the image using scikit-image skimage.morphology.skeletonize. I have tried writing code for performing erosion and dilation to manually skeletonize the image using OpenCV and Python. But, this proved to be a highly inefficient processing so i decided to switch to the scikit-image library at this point. However, when I pass the numpy array preprocessed by OpenCV to the scikit-image module using the code:</p>

<pre><code>skel = skeletonize(th4)
</code></pre>

<p>and try to view the results of the same, I end up with the error:</p>

<pre><code>Image contains values other than 0 and 1
</code></pre>

<p>I am unable to interpret the cause for the same. Can anyone kindly help me out in resolving this datatype error? </p>