<div>I wouldn't worry too much about the warning. Whenever you convert an image from floating point (64 bits per pixel) to bytes (8 bits per pixel), there may be a loss of precision.</div><div><br></div><div>The lines:</div><div><br></div><div><span style="color: rgb(0, 0, 255);">im = skimage.img_as_ubyte(im)</span><br style="color: rgb(0, 0, 255);"><span style="color: rgb(0, 0, 255);">im /= 32</span><br></div><div><br></div><div>are just a quick way to scale the pixel intensities to have 8 different levels. The first step converts the image from floats to bytes (this is where you get the warning). We now have an image with 256 levels (from 0 to 255). After dividing by 32, there are only 8 possible levels (from 0 to 7). It is likely that matlab use a different procedure for converting from a floating point image to an image with only 8 levels.</div><div><br></div><div>The [0][0] is to specify which offset you want. The first 0 gives the index for the distances, and the second is the index for the angles. In this example, we are only computing one offset (distance=1 and angle=0). However, in many real-life applications you will want to compute the statistics for a number of offsets to capture differences in scale and orientation.</div><div><br></div><div>Neil</div><br>On Monday, 8 July 2013 14:00:11 UTC+1, ely...@mail.com  wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi,<br><br>Thanks a lot for the reply.<br><br>Indeed graycoprops normalizes the gray-level co-occurrence matrix:<br><br>“graycoprops
 normalizes the gray-level co-occurrence matrix (GLCM) so that the sum 
of its elements is equal to 1. Each element (r,c) in the normalized GLCM
 is the joint probability occurrence of pixel pairs with a defined 
spatial relationship having gray level values r and c in the image. 
graycoprops uses the normalized GLCM to calculate properties.” (<a href="http://www.mathworks.co.uk/help/images/ref/graycoprops.html" target="_blank">http://www.mathworks.co.uk/<wbr>help/images/ref/graycoprops.<wbr>html</a>)<br><br>The modified script:<span style="color:rgb(0,0,255)"><br>import skimage<div><br>from <a href="http://skimage.io" target="_blank">skimage.io</a> import imread<br>from skimage.feature import greycomatrix<br></div>from skimage.feature import greycoprops<br><br>im = imread('C:/Users/Asher_dell/<wbr>Desktop/ImgTemp/python.jpg', as_grey=True)<div><br>im = skimage.img_as_ubyte(im)<br>im /= 32<br>g = skimage.feature.greycomatrix(<wbr>im, [1], [0], levels=8, symmetric=False, normed=True)<br><br></div>contrast= skimage.feature.greycoprops(g, 'contrast')[0][0]<br>energy= skimage.feature.greycoprops(g, 'energy')[0][0]<br>homogeneity= skimage.feature.greycoprops(g, 'homogeneity')[0][0]<br>correlation=skimage.feature.<wbr>greycoprops(g, 'correlation')[0][0]<br>dissimilarity=skimage.feature.<wbr>greycoprops(g, 'dissimilarity')[0][0]<br>ASM=skimage.feature.<wbr>greycoprops(g, 'ASM')[0][0]<div><br><br>print('contrast is: ', contrast)<br></div><div>print('energy is: ', energy)<br></div><div>print('homogeneity is: ', homogeneity)<br></div><div>print('correlation is: ', correlation)<br></div><div>print('dissimilarity is: ', dissimilarity)<br></div><div>print('ASM is: ', ASM)</div></span><br><br>Output:<br><span style="color:rgb(0,0,255)">skimage.dtype_converter: WARNING: Possible precision loss when converting from float64 to uint8<br>contrast is:  0.301542207792<br>energy is:  0.29069020973<br>homogeneity is:  0.883463991917<br>correlation is:  0.971624675221<br>dissimilarity is:  0.243464091878<br>ASM is:  0.0845007980331</span><br><br>Based on the output I have few more questions on the modified script:<br>-
 Does the "skimage.dtype_converter: WARNING: Possible precision loss 
when converting from float64 to uint8" means that the output values are 
wrong?<br>- Can you please explain me why you use these lines:<div><br><span style="color:rgb(0,0,255)">im = skimage.img_as_ubyte(im)<br>im /= 32</span><br></div>- Why do you use the [0][0] when you call skimage.feature.greycoprops (e.g.,<span style="color:rgb(0,0,255)">skimage.feature.<wbr>greycoprops(g, 'contrast')[0][0]</span>)?<br><br>Thanks a lot again.</blockquote>