Author: Not specified | Language: python |
Description: Not specified | Timestamp: 2017-09-19 00:33:41 +0000 |
View raw paste | Reply |
- def bits_plane(image,plane):
- height, width = image.shape
- new_image = image.copy()
- for h in range(0,height):
- for w in range(0,width):
- bin_number = '{0:08b}'.format(image[h,w])
- if int(bin_number[7 - plane]) == 1:
- new_image[h,w] = 255
- else:
- new_image[h,w] = 0
- return new_image
View raw paste | Reply |