作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我是图像处理的新手。我注意到您可以指定 rectangular region of interest和其他人喜欢 circles等在像opencv这样的图像处理库中。像 ms-paint 这样的基本绘画程序包含自由形式选择,但我似乎找不到关于如何在 opencv 或其他图像处理库中进行自由形式图像选择的功能或教程。关于如何实现这一目标的任何想法?PS:我的首选语言是c/c++。
最佳答案
你可以尝试一件事:
如果选择可以表示为二维 vector 序列,您可以将其视为多边形。分配一个新的 1 channel 图像作为掩码并用 0 填充它。然后使用
void cvFillPoly(CvArr* img, CvPoint** pts, int* npts, int contours, CvScalar color, int lineType=8, int shift=0)
记录在
http://opencv.willowgarage.com/documentation/drawing_functions.html
在蒙版图像上绘制一个非零区域来表示图像的选定部分。
关于c++ - 自由形式的图像选择(最好在 C++ 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8192300/
我是一名优秀的程序员,十分优秀!