-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainImagePlot.py
35 lines (29 loc) · 918 Bytes
/
mainImagePlot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#python3
#Steven 11/03/2020 image plot modoule
import matplotlib.pyplot as plt
from common import getRowAndColumn
def plotImagList(imgList,nameList,gray=False,showticks=True):
nImg = len(imgList)
nRow,nColumn = getRowAndColumn(nImg)
for n in range(nImg):
img = imgList[n]
ax = plt.subplot(nRow, nColumn, n + 1)
ax.title.set_text(nameList[n])
if gray:
plt.imshow(img,cmap="gray")
else:
plt.imshow(img)
if not showticks:
ax.set_yticks([])
ax.set_xticks([])
#plt.grid(True)
plt.tight_layout()
plt.show()
def main():
#file = r'./res/obama.jpg'#'./res/Lenna.png' #
#img = ImageBase(file,mode=cv2.IMREAD_GRAYSCALE) # IMREAD_GRAYSCALE IMREAD_COLOR
#print(img.infoImg())
#showimage(img.binaryImage(thresHMin=50,thresHMax=150))
pass
if __name__=='__main__':
main()