2016-08-30 12:52:10 -0600 | commented answer | chamerMatching malloc error It's good to know about cv::Ptr. However, it seems to be lacking std::enable_shared_from_this, and the std::make_shared has better template support for construction of arbitrary objects. |
2016-08-29 21:55:37 -0600 | received badge | ● Student (source) |
2016-08-29 14:53:47 -0600 | answered a question | Nothrow move constructors for Point, Size, Point3, Rect Not a perfect solution, but I created my own simple geometric types that can be converted to and from the cv types. For example: |
2016-08-29 14:29:34 -0600 | received badge | ● Editor (source) |
2016-08-29 14:27:04 -0600 | answered a question | chamerMatching malloc error I found that the Template ownership and lifetime issues get quite complicated. At the heart of the problem is the ChamferMatcher::Template::rescale function, which can either return "this" or a new-allocated Template object. A template can also hold scaled templates in an internal vector. Template pointers can also be copied to Matching, etc. If one is willing to use the modern C++11 standard library, the problems can be resolved with std::shared_ptr, which does reference counting and only destroys an object when the last pointer to it is destroyed. All uses of Template* should be replaced with |
2015-12-16 12:13:42 -0600 | received badge | ● Enthusiast |
2015-12-10 11:10:34 -0600 | received badge | ● Supporter (source) |
2015-12-08 23:41:19 -0600 | asked a question | Nothrow move constructors for Point, Size, Point3, Rect The static asserts currently fail with opencv-3.0.0 with gcc (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4) The current hand-written copy constructors for these simple classes block the compiler from generating its own move constructors. As the example above shows, this applies to any class that includes them. Such classes will be hard to use in a std::vector, which decides whether to move or copy its contents on reallocation by testing this type trait (using std::move_if_noexcept). If the copy constructors for cv::Point_, cv::Size_, cv::Point3_ and cv::Rect_ are commented out, or set to "= default", then the asserts will not fail. Would it be possible to do this for a future release of openCV? |