2015-07-31 02:51:19 -0600 | asked a question | cv::fitLine doesn't accept cv::Point inherited class Hi, everyone. I'm working on a project which has a 'MyPoint' class inherited from cv::Point. I just want to use cv::fitLine to process a std::vector< MyPoint >. But cv::fitLine simply can't process it. The codes compiles but produces a runtime error: I think it might because of the cv::fitLine used some strange techniques to determine if the real input is 2d or 3d, and whether it's Mat or vector< T >, which can not process my class. But since 'MyPoint' is inherited from cv::Point, and cv::fitLine do accept cv::Point, this problem is really violating the principles of OOP, I think... Do anybody knows how work around this issue? Thank you so much! And my codes: |