我有一个带有带有广角镜头的固定相机和移动物体的系统。当物体匀速移动时,我以 10 毫米间隔和 2064x40 像素拍摄图像。此外,我在没有匀速的情况下拍摄了 2048x40 的图像。我想缝合这些捕获的图像。
\n首先我参考链接尝试了OpenCV的拼接方法。但是,我收到错误代码 1,并且我了解到两个图像之间没有足够的重叠区域来缝合。
\n之后,我想我可以尝试连接恒速物体的图像。我使用了下面的代码,并将 13 px 作为移位参数。
\nimport numpy as np\nimport cv2\nimport os\n\nfrom Stitching.Blending import UVSSBlendingConcate\nfrom Stitching.DistortionCorrection import load_coefficients\n\n\ndef load_images_from_folder(folder):\n print("\\nImages are reading from folder: " + folder)\n images = []\n for filename in os.listdir(folder):\n img = cv2.imread((folder + "/" + filename))\n if img is not None:\n images.append(img)\n return images\n\n\ndef unDistortImages(images):\n mtx, dist = load_coefficients(\'calibration_chessboard.yml\')\n for i in range(len(images)):\n images[i] = cv2.undistort(images[i], mtx, dist, None, None)\n return …Run Code Online (Sandbox Code Playgroud) python opencv image-processing computer-vision image-stitching