Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このような輪郭の上にボックスを描きたい
このコードで輪郭を見つけます
vector < vector<Point> > contours; findContours(Iat, contours, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
rectangleそして、命令でボックスを描く方法
rectangle
使い方がわかりません 誰か説明してくれませんvector < vector<Point> > contoursか
vector < vector<Point> > contours
ありがとうございます。
boundingRect メソッドを使用できます。
Rect boundingRect(InputArray points) Parameters: points – Input 2D point set, stored in std::vector or Mat.
この関数は、指定されたポイント セットの最小の右上境界四角形を計算して返します。
これにより、希望する方法を使用できるようになります。