profile_line

Jaime Lopez Carvajal jalopcar at gmail.com
Thu Apr 14 11:42:00 EDT 2016


HI friends,

I am having problems with *profile_line function*, because I want to get 
gray values following some coordinates, but it is given to me wrong gray 
values
that does not exist in the original image, like 128, 126 or 64.

image = np.array([[170, 170,  70,  70,  70,  70,  70,  70,  70,  70],
       [170, 170,  70,  70,  70,  70,  70,  70,  90,  70],
       [170, 170, 170,  70,  70,  70,  70,  70,  70,  70],
       [170, 170, 170,  70,  70,  70,  70,  70,  70,  70],
       [170, 170, 170,  70,  70,  70,  70,  70,  70,  70],
       [170, 170, 170, 170,  70,  70,  70,  70,  70,  70],
       [110, 170, 170, 170,  70,  70,  70,  70,  70,  70],
       [ 50, 170, 170, 170,  70,  70,  70,  70,  70,  10],
       [ 50,  50, 170, 170,  70,  70,  70,  70,  10,  10],
       [ 50, 110, 110, 110,  70,  70,  70,  70,  10,  10]], dtype=uint8)


coords = np.array([[70,  0],

       [70,  0],
       [71,  1],
       [71,  2],
       [72,  3],
       [72,  4],
       [73,  4],
       [74,  5],
       [74,  6],
       [75,  7],
       [75,  8],
       [76,  8],
       [77,  9]])


gray_values = profile_line(image,(0,0),(7,9)).astype(int)

gray_values

array([170, 170, 128, 126,  70,  70,  70,  70,  70,  70,  70,  64,  10])


but the correct values would be:

gray_values

array([170, 170, 170, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70])


Do you know why this is happening? Any suggestion?


Thanks in advance, Jaime

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160414/9d573f3b/attachment.html>


More information about the scikit-image mailing list