Add Zoom to rectangle
by default
This commit is contained in:
parent
f5c235c3cd
commit
56037b058b
@ -5,6 +5,8 @@ import matplotlib.image as mpimg
|
||||
import os
|
||||
from tqdm import tqdm
|
||||
|
||||
# `Zoom to rectangle` shortcut is `o`.
|
||||
|
||||
os.chdir('flat-field/TIF')
|
||||
|
||||
fileNames = os.listdir()[:3]
|
||||
@ -17,24 +19,26 @@ def displayImage():
|
||||
if len(fileNames) > fileNameIndex:
|
||||
fileName = fileNames[fileNameIndex]
|
||||
image = mpimg.imread(fileName)
|
||||
plt.imshow(image)
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
|
||||
ax.imshow(image)
|
||||
fileNameIndex += 1
|
||||
plt.connect('button_press_event', onClick)
|
||||
|
||||
mng = plt.get_current_fig_manager()
|
||||
mng.full_screen_toggle()
|
||||
|
||||
plt.show()
|
||||
fig.canvas.toolbar.zoom()
|
||||
fig.show()
|
||||
|
||||
def onClick(event):
|
||||
global xys
|
||||
if event.button is MouseButton.RIGHT:
|
||||
xy = [event.x, event.y]
|
||||
xys += [xy]
|
||||
#print(fileNameIndex, xy)
|
||||
plt.close()
|
||||
displayImage()
|
||||
progressBar.update(1)
|
||||
|
||||
#print(fileName)
|
||||
displayImage()
|
Loading…
Reference in New Issue
Block a user