You are on page 1of 18

grabbed, frame = camera.

read()
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

frame = utils.image_resize(frame, height=600)


height, width, channels = frame.shape

if not calibrated:
# Sample hand color
utils.add_text(frame, "Press space after covering rectangle with hand. Hit SPACE when ready")
x, y, w, h = width / 4, height / 2, 50, 50

Pendahuluan
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
cv2.imshow("Calibration", frame)
if cv2.waitKey(2) & 0xFF == ord(' '):
roi = frame[y:y + h, x:x + w, :]
roi_hsv = cv2.cvtColor(roi, cv2.COLOR_BGR2HSV)
min_value = np.amin(roi_hsv, (0, 1))
max_value = np.amax(roi_hsv, (0, 1))
cv2.destroyWindow("Calibration")
calibrated = True

else:
cv2.accumulateWeighted(frame, bg, 0.01) MK: Image Processing

Oleh: Danang Erwanto, ST., MT

010100010010101010000100010100101010010100010001001101010010010101010

010100010010101010000100010101001001101010100100100101010
Pertemuan ke 2
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

konsep Dasar Images Processing


while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• Definisi Pengolahan Citra


• Definisi Citra
• Sumber Citra Digital
• Digitalisasi Citra
• Jenis-Jenis Citra Digital
• Computer Vision & hubungannya dengan Image Procesing
• Contoh Aplikasi Pengolahan Citra Digital

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
grabbed, frame = camera.read()

Pertemuan Ke 3
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

Image Acquisition with OpenCV Python


while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• Load & Save Image


• Load & Show Image
• Capture & Save Image
• Capture Berulang

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
grabbed, frame = camera.read()

Pertemuan Ke 4
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

Drawing and Writing on Image with OpenCV


while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Drawing Line
• Drawing Rectangle
• Drawing Circle
• Drawing Ellipse
• Drawing Poligon
• Adding Text

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan Ke 5
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Geometric Transformations of Images with


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

OpenCV Python
if not grabbed:
print "Camera read failed"
break

• Show image Size


• Image Scaling
• Image Translation
• Image Rotation
• Image Flipping
• Flip Vertikal
• Flip Horizontal
• Flip Vertikal dan Horizontal

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan ke 6
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Image Colorspaces and Image Tresholding


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

with OpenCV Python


if not grabbed:
print "Camera read failed"
break

• Image Colorspaces
• RGB to Gray
• RGB to HSV
• RGB to YUV
• Image Tresholding
• Simple Thresholding
• Adaptive Thresholding
• Otsu’s Binarization
• Image Segmentation
• Detection a specific color
• Image Segmentation with Watershed Algorithm
MK : Image Processing (MKKPC09603)
Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan Ke 7
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Image Blurring with OpenCV


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Averaging
• Gaussian Blur
• Median Blur
• Bilateral Blur

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

PERTEMUAN 8
bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

UTS
MK : Image Processing (MKKPC09603)
Program Studi : Teknik Elektro – Uniska Kediri
PERTEMUAN 9
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Morphological Transformations with OpenCV


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Erosion
• Dilation
• Opening
• Closing
• Morphological Gradient
• Top Hat
• Black Hat

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 10
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Edge and Corner Detection with OpenCV


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Canny Edge Detection


• Tahapan Algoritma Canny Edge Detection
• Penerapan
• Harris Corner Detection
• Tahapan Algoritma Harris Corner Detection
• Penerapan

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 11
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Color Histogram with OpenCV


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Find, Plot, Analyze


• Histogram Equalization
• 2D Histograms
• Histogram Backprojection

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 12
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Images Contour in OpenCV


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Contours : Getting Started


• Find Contour
• Draw Contour
• Contour Approximation Method
• Contour Features
• Moments
• Contour Area
• Contour Approximation
• Convex Hull
• Checking Convexity
• Bounding Rectangle
• Fitting a Line
MK : Image Processing (MKKPC09603)
Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 13
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Hough Methods in OpenCV


bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()

Python
if not grabbed:
print "Camera read failed"
break

• Hough Line Transform


• Hough Cyrcle Transform

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 14
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

Template Matching
while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• Template Matching in OpenCV


• Template Matching with Multiple Objects

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 15
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

Object Detection
while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• Face Detection using Haar Cascades


• Vehicle Detection Model using OpenCV and Python

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

Referensi
bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials
/py_tutorials.html

MK : Image Processing (MKKPC09603)


Program Studi : Teknik Elektro – Uniska Kediri
Pertemuan 16
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")
bg = utils.image_resize(frame, height=600).astype(np.float32)

UAS
while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• Mahasiswa memaparkan dan mendemostrasikan tugas Proyek yang telah dibuat


per kelompok
• Tugas Proyek membuat sistem Klasifikasi berdasarkan hasil ekstraksi.
• Setiap Kelompok diisi oleh 3-4 Mahasiswa
• Pemaparan digunakan sebagai nilai UAS
• Proyek digunakan sebagai nilai Tugas dengan mempertimbangkan
1. Penyusunan Makalah
2. Metode yang digunakan
3. Program yang dipergunakan (Matlab/Python, jika menggunakan Python ada nilai tambah)
• Jika pada saat pemaparan dan demontrasi mahasiswa tidak siap dengan alasan
apapun, maka nilai UAS dan tugas tersebut = NOL (0)
MK : Image Processing (MKKPC09603)
Program Studi : Teknik Elektro – Uniska Kediri
grabbed, frame = camera.read()
if not grabbed:
raise ValueError("Camera read failed!")

PENDAHULUAN
bg = utils.image_resize(frame, height=600).astype(np.float32)

while True:
grabbed, frame = camera.read()
if not grabbed:
print "Camera read failed"
break

• BAHASA PEMROGRAMAN IMAGE PROSESSING


MENGGUNAKAN PYTHON 3
• LIBRARY :
• OPENCV
• NUMPY

• PANDUAN INSTALASI PYTHON DAN IMPORT LIBRARY


DOWNLOAD PADA URL :
http://bit.ly/installpythonuniska
• TUGAS AKHIR MK IMAGE PROSESSING SISTEM
KLASIFIKASI BERDASARKAN HASIL EKSTRAKSI.
MK : Image Processing (MKKPC09603)
Program Studi : Teknik Elektro – Uniska Kediri

You might also like