废话: 有时候我们是从物品的斜上方拍摄的图片,看起来不直观,需要把视角拉正,这样的一个操作就叫做 梯度矫正,需要用到的技术是 Opencv 的 透视变换。 这个只是一个简单的演示demo,如果完善一下,比如物品检测,可以应用更多的场景,比如常见的:文件、资料上传,软管摄像头的应用等,怎么说也是一个技术点吧 重要代码: /** * @brief hDLL_gradientAuto 梯度矫正 * @param src 输入图像 * @param dst 输出图像 * @param flag 方向,[0(左),1(上),2(右),3(下)] * @param val 矫正度数,像素,[10 ~ 100] * @return 0(成功),-1(失败) */ int MainWindow::hDLL_gradientAuto(Mat &src, Mat &dst, int flag, int val) { if(flag != 0 && flag != 1 && flag != 2 && flag != 3) return -1; if(val < 10 || val > 100)...
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 return
Contact return, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack