ตรวจสอบ version ของ python เพื่อใช้ในการทำ Contours

(version, _, _) = cv2.__version__.split(‘.’)

if version == ‘3’:
image, contours, hierarchy = cv2.findContours(dilation.copy(), \
cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
elif version == ‘4’:
contours, hierarchy = cv2.findContours(dilation.copy(),cv2.RETR_TREE, \
cv2.CHAIN_APPROX_NONE)

หมายเหตุท้าย:
หากคุณชอบบทความนี้อย่าลืมคลิก❤ด้านล่างเพื่อแนะนำและถ้าคุณมีคำถามใด ๆ แสดงความคิดเห็นและฉันจะพยายามอย่างดีที่สุดที่จะตอบ คุณสามารถติดตามฉันบน facebook page (https://www.facebook.com/nextsoftwarehousethailand/) และสามารถส่งอีเมลถึงฉัน

--

--

Dr. Pathasu Doungmala

Founder of Next Software — I am working on image processing, pattern recognition and AI to help reduce working in an industry.