透视矫正,引用文档拍照扫描,相片矫正这块。 读取图像Cv2.ImRead(); 预处理(灰度化,高斯滤波、边缘检测) 轮廓检测(获取到最大轮廓) 获取最大面积轮廓的四个顶点 标识最小矩形坐标 透视矫正显示 完整代码 // 1、读取图像 Mat image = Cv2.ImRead("2.jpg", ImreadModes.Color); //2、预处理(灰度化,高斯滤波、边缘检测) Mat src_gray = new Mat(); Cv2.CvtColor(image, src_gray, ColorConversionCodes.BGR2GRAY); // 转换为灰度图像 Cv2.GaussianBlur(src_gray, src_gray, new Size(5, 5), 0, 0); // 进行高斯模糊 Mat canny_Image = new Mat(); Cv2.Canny(src_gray, canny_Image, 75, 200); //3、轮廓检测 Point[][] contours; HierarchyIndex[] hierarchy;...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Retrieval
Contact Retrieval, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack