-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpmProblemImage.py
More file actions
22 lines (19 loc) · 812 Bytes
/
rpmProblemImage.py
File metadata and controls
22 lines (19 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from PIL import Image
import numpy
class rpmProblemImage:
def __init__(self, name, figure):
print ("In rpmProblemImage class init : ", name, "----- ", figure.visualFilename)
self.name = name
self.image_filename = figure.visualFilename
#opens up original image
self.image = Image.open(figure.visualFilename)
# summarize some details about the image
print(self.image.format)
print(self.image.size)
print(self.image.mode)
# asarray() class is used to convert
# PIL images into NumPy arrays
self.numpy_image = numpy.array(self.image)
#self.image_numpy_array = ImageUtil.binarize(self.image)
#print(self.numpy_image)
#self.object_count = len(figure.objects)