การบูรณะภาพ

การประมวลผลภาพด้วย Python

Rebeca Gonzalez

Data Engineer

บูรณะภาพ

การประมวลผลภาพด้วย Python

การบูรณะภาพ

  • ซ่อมแซมภาพที่เสียหาย
  • ลบข้อความ
  • ลบโลโก้
  • ลบวัตถุ

การประมวลผลภาพด้วย Python

การบูรณะภาพ

Inpainting
  • สร้างส่วนที่สูญหายของภาพขึ้นใหม่
  • อ้างอิงจากบริเวณที่ไม่เสียหาย

การประมวลผลภาพด้วย Python

การบูรณะภาพ

การประมวลผลภาพด้วย Python

การบูรณะภาพด้วย scikit-image

from skimage.restoration import inpaint

# Obtain the mask mask = get_mask(defect_image)
# Apply inpainting to the damaged image using the mask restored_image = inpaint.inpaint_biharmonic(defect_image, mask, multichannel=True)
# Show the resulting image show_image(restored_image)
การประมวลผลภาพด้วย Python

การบูรณะภาพด้วย scikit-image

# Show the defect and resulting images
show_image(defect_image, 'Image to restore')
show_image(restored_image, 'Image restored')

การประมวลผลภาพด้วย Python

มาสก์

การประมวลผลภาพด้วย Python

มาสก์

def get_mask(image):
    ''' Creates mask with three defect regions '''
    mask = np.zeros(image.shape[:-1])

    mask[101:106, 0:240] = 1

    mask[152:154, 0:60] = 1
    mask[153:155, 60:100] = 1
    mask[154:156, 100:120] = 1
    mask[155:156, 120:140] = 1

    mask[212:217, 0:150] = 1
    mask[217:222, 150:256] = 1
    return mask
การประมวลผลภาพด้วย Python

มาฝึกกันเถอะ!

การประมวลผลภาพด้วย Python

Preparing Video For Download...