Advertisement
Guest User

Definition reading red pixels from picture

a guest
May 28th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1.     def checkRedPointsToArray(self, img_x, img_y, image,):
  2.         a = np.empty([img_x,img_y])
  3.  
  4.         high_red_px_color=0
  5.         high_red_px_value=0
  6.  
  7.         #check for heigth
  8.         for i in range(1,img_y):
  9.  
  10.         #check for width
  11.             for j in range(1,img_x):
  12.                 px_red = image[i,j,2]
  13.  
  14.                 if (high_red_px_color < px_red and px_red > 60):
  15.                     high_red_px_color = px_red
  16.                     high_red_px_value = j
  17.  
  18.             np.insert(a,high_red_px_value,i)
  19.  
  20.             high_red_px_color = 0
  21.             high_red_px_value = 0
  22.  
  23.         return a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement