简体   繁体   English

如何在JavaCV中在轮廓上绘制矩形?

[英]How to draw rectangle over contour in JavaCV?

I found contours in an image by using cvFindContours . 我通过使用cvFindContours在图像中找到了轮廓。 Now I want to draw rectangle over them. 现在,我想在它们上方绘制矩形。 Am I right that I should use the cvBoundingRect method? 我应该使用cvBoundingRect方法吗? The first parameter of this function is a CvArr object, but I found that the contours are CvSeq objects. 该函数的第一个参数是CvArr对象,但我发现轮廓是CvSeq对象。 How can I solve this problem? 我怎么解决这个问题?

Solved. 解决了。

You can cast CvSeq to CvArr 您可以将CvSeqCvArr

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM