# -*- coding: utf-8 -*-
import cv2
import numpy as np
if __name__ == '__main__':
#path1代校准,path2正常图片
path1 = 'img/xuanzhuan.png'
path2 = 'img/yuantu.jpg'
# Read the images to be aligned
im1 = cv2.imread(path1);
im2 = cv2.imread(path2);
# Convert images to grayscale
im1_gray = cv2.cvtColor(im1,cv2.COLOR_BGR2GRAY)
im2_gray = cv2.cvtColor(im2,cv2.COLOR_BGR2GRAY)
# Find size of image1
sz = im1.shape
# Define the motion model
warp_mode = cv2.MOTION_TR
图像校正
最新推荐文章于 2025-07-10 21:53:04 发布