I have an image loaded in my code (very long and unnecessary, won't post here) that I need to work on with skimage to detect blobs in the image. However for some reason all of the images and attempts that I have used don't work.
The image is modified by PIL in the code above to make the objects I am trying to find only white (255, 255, 255), and all other pixels black. This code only needs to identify the positions of these. I have tried many different things to get this to work (converting them to a numpy array, not converting them to a numpy array ect.)
I am following these instructions : http://scikit-image.org/docs/dev/auto_examples/plot_blob.html for the basics, but it is not really a tutorial, more an example.
I think that the rgb2gray function is being problematic as it returns nothing but 0, whilst the print(numpy.array(img)) returns values between 0 and 1, suggesting that the loss of information is when the rgb2gray is called.
Here is the code that seems to be problematic:
img_gray = rgb2gray(numpy.array(img)) # Convert to numpy array for skimage
print(img_gray)
print(numpy.array(img))
img_blobs = blob_doh(img_gray, threshold=0.01, max_sigma=500)
print(img_blobs)
How can I fix this?
EDIT:
Here are what each of the images, arrays and lists print:
[[ 0. 0. 0. ..., 0. 0. 0. ] #img_gray
[ 0. 0.00392157 0.01568627 ..., 0. 0. 0. ]
[ 0. 0.01176471 0.05882353 ..., 0. 0. 0. ]
...,
[ 1. 0.99607843 0.96078431 ..., 0. 0. 0. ]
[ 1. 1. 0.98039216 ..., 0. 0. 0. ]
[ 1. 1. 0.99215686 ..., 0. 0. 0. ]]
[[[ 0 0 0] #img
[ 0 0 0]
[ 0 0 0]
...,
[ 0 0 0] #img
[ 0 0 0]
[ 0 0 0]]
[[ 0 0 0] #img
[ 1 1 1]
[ 4 4 4]
...,
[ 0 0 0] #img
[ 0 0 0]
[ 0 0 0]]
[[ 0 0 0] #img
[ 3 3 3]
[ 15 15 15]
...,
[ 0 0 0] #img
[ 0 0 0]
[ 0 0 0]]
...,
[[255 255 255] #img
[254 254 254]
[245 245 245]
...,
[ 0 0 0] #img
[ 0 0 0]
[ 0 0 0]]
[[255 255 255] #img
[255 255 255]
[250 250 250]
...,
[ 0 0 0] #img
[ 0 0 0]
[ 0 0 0]]
[[255 255 255]
[255 255 255]
[253 253 253]
...,
[ 0 0 0]
[ 0 0 0]
[ 0 0 0]]]
[] #img_blobs