มุมมองภาพ
ในแบบฝึกหัดนี้ คุณจะตรวจจับมุมของอาคารโดยใช้ตัวตรวจจับมุม Harris พารามิเตอร์ threshold_rel จะกำหนดความเข้มขั้นต่ำของจุดสูงสุด
building_imageฟังก์ชัน show_image() และ show_image_with_corners() ถูกโหลดไว้ให้แล้ว รวมถึงโมดูล color สำหรับแปลงภาพเป็นระดับสีเทา
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การประมวลผลภาพด้วย Python
คำแนะนำการฝึกหัด
- นำเข้าฟังก์ชัน
corner_harris()จากโมดูล feature - แปลง
building_imageให้เป็นภาพระดับสีเทา - ใช้ตัวตรวจจับ Harris เพื่อสร้างภาพ measure response ที่แสดงมุมที่เป็นไปได้
- ค้นหาจุดสูงสุดของมุม
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Import the corner detector related functions and module
from skimage.____ import ____, corner_peaks
# Convert image from RGB-3 to grayscale
building_image_gray = ____
# Apply the detector to measure the possible corners
measure_image = ____
# Find the peaks of the corners using the Harris detector
coords = ____(____, min_distance=20, threshold_rel=0.02)
# Show original and resulting image with corners detected
show_image(building_image, "Original")
show_image_with_corners(building_image, coords)