opencv Android图片处理并显示在原图上

yhjhaha 2019-03-25 02:18:51

得到第二张图片的效果后,怎么让这两个框显示在原来的图片上,在安卓上怎么写呢,谢谢dalao


画框的代码在这里
Mat drawing = Mat.zeros(src.size(), CvType.CV_8UC3);
List<MatOfPoint> contoursPolyList = new ArrayList<>(contoursPoly.length);
for (MatOfPoint2f poly : contoursPoly) {
contoursPolyList.add(new MatOfPoint(poly.toArray()));
}
for (int i = 0; i < contours.size(); i++) {
Scalar color = new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256));
Imgproc.drawContours(drawing, contoursPolyList, i, color);


Imgproc.rectangle(drawing,boundRect[i].tl(), boundRect[i].br(), color, 2);

}
...全文
232 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧