c++ - What's the difference between camShift and cvCamShift? -
the camshift function of opencv c++ interface don't have output parameter cvconnectedcomp* comp , cvbox2d* box=null. can these information if use c++ interface camshift ? can please tell me how ? thanks.
c++: rotatedrect camshift(inputarray probimage, rect& window, termcriteria criteria); c: int cvcamshift(const cvarr* prob_image, cvrect window, cvtermcriteria criteria, cvconnectedcomp* comp, cvbox2d* box=null );
i don't think can retrieve connected component information; however, returns information need rotatedrect. according opencv documentation:
the function implements camshift object tracking algorithm [bradski98]. first, finds object center using meanshift() , adjusts window size , finds optimal rotation. function returns rotated rectangle structure includes object position, size, , orientation. next position of search window can obtained rotatedrect::boundingrect().
rotatedrect object has following structure:
class rotatedrect { public: // constructors rotatedrect(); rotatedrect(const point2f& _center, const size2f& _size, float _angle); rotatedrect(const cvbox2d& box); // returns minimal up-right rectangle contains rotated rectangle rect boundingrect() const; // backward conversion cvbox2d operator cvbox2d() const; // mass center of rectangle point2f center; // size size2f size; // rotation angle in degrees float angle; };
Comments
Post a Comment