Skip to content

Commit

Permalink
First upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tbsfchnr committed Oct 7, 2020
0 parents commit 90caddc
Show file tree
Hide file tree
Showing 8 changed files with 538 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.venv/
73 changes: 73 additions & 0 deletions image-enhancement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import numpy as np
from matplotlib import image
from matplotlib import pyplot as plt
import tkinter as tk

FOETUS_PATH_ORIGINAL = ".\\images\\foetus.png"
NZJERS_PATH_ORIGINAL = ".\\images\\NZjers1.png"

def updateImages():
#x = slider1.get()
#y = slider2.get()

# # apply filter to images with new parameters - with applyFilter()
# # save new images to disk
# # load new images into GUI
label1.configure(image=window.nzjers)
label1.photo = window.nzjers
print("image updated")

def applyFilter():
raise NotImplementedError

# Instantiate new TKinter instance - Python's GUI builder
window = tk.Tk()

# Add two sliders to the GUI to interactively experiment with filter parameters
slider1 = tk.Scale(window, from_=0, to=1)
slider1.pack()
slider2 = tk.Scale(window, from_=0, to=1)
slider2.pack()

# Refresh images with new filters
button = tk.Button(window, text="Update", command=updateImages)
button.pack()

window.foetus = tk.PhotoImage(file=FOETUS_PATH_ORIGINAL)
window.nzjers = tk.PhotoImage(file=NZJERS_PATH_ORIGINAL)

# Create a canvas to load the images into
label1 = tk.Label(window, image=window.foetus)
label1.pack()

# Begin GUI loop to enable interaction with GUI window
window.mainloop()

# Think this is broken now
figures = {'foetus': FOETUS_PATH_ORIGINAL,
'NZjers1': NZJERS_PATH_ORIGINAL}


# def plotFigs(figures, nrows=2, ncols=1):
# """
# Function to
#
# :param figures: dictionary of {title, figure} pairs
# :param nrows: number of columns wanted in the display
# :param ncols: number of rows wanted in the display
# :return:
# """
#
# fig, axes = plt.subplots(ncols=ncols, nrows=nrows)
#
# for i, title in enumerate(figures):
# axes.ravel()[i].imshow(figures[title], cmap=plt.gray())
# axes.ravel()[i].set_title(title)
# axes.ravel()[i].set_axis_off()
#
# plt.tight_layout()
# #plt.colorbar()
# #plt.hist()
# plt.show()

# plotFigs(figures, 2, 1)
463 changes: 463 additions & 0 deletions images/NZjers1.pgm

Large diffs are not rendered by default.

Binary file added images/NZjers1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foetus.pgm
Binary file not shown.
Binary file added images/foetus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
numpy==1.19.2
Empty file added techniques.py
Empty file.

0 comments on commit 90caddc

Please sign in to comment.