Python: 图片拼接排列 opencv - 图1
© Karobben

由於語法渲染問題而影響閱讀體驗, 請移步博客閱讀~
本文GitPage地址

Align

  1. import cv2
  2. import numpy as np
  3. img1 = cv2.imread('/home/ken/Desktop/test/IMG_20210421_143828.jpg')
  4. img2 = cv2.imread('/home/ken/Desktop/test/IMG_20210421_143832.jpg')
  5. img3 = cv2.imread('/home/ken/Desktop/test/IMG_20210421_143834.jpg')
  6. img4 = cv2.imread('/home/ken/Desktop/test.png')
  7. img_result = cv2.resize(img1, (900,400))
  8. img_1 = cv2.resize(img1, (300,200))
  9. img_2 = cv2.resize(img2, (300,200))
  10. img_3 = cv2.resize(img3, (300,200))
  11. img_4 = cv2.resize(img4, (900,200))
  12. img_result[0:200, 0:300] = img_1
  13. img_result[0:200, 300:600] = img_2
  14. img_result[0:200, 600:900] = img_3
  15. img_result[200:400, 0:900] = img_4
  16. cv2.imwrite('batch.png',img_result)
Python: 图片拼接排列 opencv - 图2

Enjoy~

本文由Python腳本GitHub/語雀自動更新

由於語法渲染問題而影響閱讀體驗, 請移步博客閱讀~
本文GitPage地址

GitHub: Karobben
Blog:Karobben
BiliBili:史上最不正經的生物狗