【发布时间】:2017-05-08 23:52:58
【问题描述】:
我正在 OpenCv 中进行车牌检测,目前我可以检测到车牌Sample of detected licence plate
但问题是矩形太接近车牌字符,我想我可以将尺寸增加一个给定的偏移量,我做了Sample of increased offset detection
但不幸的是,我对 Rect 的理解与它的工作方式不同,与从中绘制单点的圆不同,矩形使用 2 个点,其中在增加尺寸后,如果转移到对(至少看起来是这样),在增加偏移量后,我需要帮助将矩形置于其原始位置的中心,这是用于增加其尺寸的代码
rect.height = (int) (rect.height * 1.1);
rect.width = (int) (rect.width * 1.5);
Imgproc.rectangle(originalFrame, rect.br(), rect.tl(), new Scalar(0,0,255), 2);
我还没有足够的代表,所以图像不会自动显示。
【问题讨论】:
-
代码已编辑。