Esponilla, Jonnel Lopez, Joshua Albert Templonuevo, Sofia Coleen Valerio, Mark Kenneth
Esponilla, Jonnel Lopez, Joshua Albert Templonuevo, Sofia Coleen Valerio, Mark Kenneth
3
Greyscale
Course Code: CPE102 Program: BSCPE
Course Title: Machine Perception Date Performed:12/18/20
Section: CPE31S3 Date Submitted:12/18/20
Names: Balunes, Prince Patrick Instructor: Engr. Gabriel Sampedro
Esponilla, Jonnel
Lopez, Joshua Albert
Templonuevo, Sofia Coleen
Valerio, Mark Kenneth
Source Code:
import cv2
import numpy as np
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename()
image = cv2.imread(file_path)
if fxn == '1':
cv2.waitKey(0)
cv2.destroyAllWindows()
else:
pass
The code consists of programming that is to be displayed the greyscale of an image and to display a
black and white version of the image using Otsu’s algorithm besides from the original image
Output:
Figure 2.1
This figure shows the user to open an image.
Figure 2.2
This figure shows the user prompt to pick an image.
Figure 2.3
Figure 2.3 shows the selected image and how it transformed in a grayscale image.
Figure 2.4
As you can see on the figure 2.4, the selected image transformed into black and white image in another window