Guest User

Untitled

a guest
Jun 11th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. #we give this array input to rgb2luv(src) in python codes.
  2.  
  3. a2 = N.array([[[0.2, 0.1, 0.2], [0.1, 0.0, 0.1], [0.0, 0.1, 0.2]], [[0.2, 0.1, 0.2], [0.1, 0.0, 0.1], [0.0, 0.1, 0.2]],[[0.2, 0.1, 0.2], [0.1, 0.0, 0.1], [0.0, 0.1, 0.2]]], dtype = N.float64)
  4.  
  5. print rgb2luv(a2)
  6.  
  7. Desired Output:
  8. [[[ 0.1577703   0.39215735  0.41656124]
  9.   [ 0.07318546  0.43150599  0.36919105]
  10.   [ 0.12888619  0.23489428  0.36968172]]
  11.  
  12.  [[ 0.1577703   0.39215735  0.41656124]
  13.   [ 0.07318546  0.43150599  0.36919105]
  14.   [ 0.12888619  0.23489428  0.36968172]]
  15.  
  16.  [[ 0.1577703   0.39215735  0.41656124]
  17.   [ 0.07318546  0.43150599  0.36919105]
  18.   [ 0.12888619  0.23489428  0.36968172]]]
  19.  
  20.  
  21. Our Output:
  22.  
  23. [cube slice 0]
  24.    0.1965   0.1437   0.1965
  25.    0.1437        0   0.1437
  26.         0   0.1437   0.1965
  27.  
  28. [cube slice 1]
  29.    0.3082   0.3130   0.3082
  30.    0.3130   0.3259   0.3130
  31.    0.3259   0.3130   0.3082
  32.  
  33. [cube slice 2]
  34.    0.5215   0.5148   0.5215
  35.    0.5148   0.4963   0.5148
  36.    0.4963   0.5148   0.5215
Add Comment
Please, Sign In to add comment