Slexy.org is shutting down and stopped accepting new Pastes on May 4th, 2021.
Existing Pastes will stop being available on or after May 10th, 2021.
Author: Not specified Language: python
Description: Not specified Timestamp: 2017-09-18 18:46:28 +0000
View raw paste Reply
  1. def alargamento_constrate(image,limiar):
  2.   height, width = image.shape
  3.   new_image = image.copy()
  4.   for h in range(0,height):
  5.       for w in range(0,width):
  6.           if image[h, w] < limiar:
  7.               new_image[h,w] = 0
  8.           elif image[h, w]  == limiar:
  9.               new_image[h,w] = 128
  10.           else:
  11.               new_image[h,w] = 255
  12.   return new_image
View raw paste Reply