Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks for your reply. Your alternative works. But I thought that the point of using OutputArray is that it can deal with either cv::Mat or std::vectors, that's how it's used in OpenCV modules, and in my case I want corners to be a std::vector. It works well if corners is a vector<Point2f>. So I don't understand the difference, I have added a default constructor and copy constructor to my Corner type and see if it makes any difference but it doesn't.
      singulars
    2. COHi. If you are interested in going deeper into the rabbit hole, you can take a look at matrix.cpp in OpenCV's source where the OutputArray s declared. Also, you can look at how OpenCV's functions such as split(...) which writes out to vector<>... works BUT I suspect that the OutputArray is somehow only intended to work with a restricted set of templated vectors i.e. vector<Mat>, vector<Point> etc. Let me say tt I'm not entire sure about this but this is the sense I get from taking a quick glance at the code. If I have the time I'll look into it further and let you know.
      singulars
    3. COOk, thanks. I've had a look at the InputArray/OutputArray definitions I can see they are templated with parameter _Tp. I haven't been able to see the complete picture but I suspect too that _Tp can be only one of the DataType traits, which are POD types and combinations of them in the form CV_<bit-depth>{U|S|F}C(<number_of_channels>) . So in my case I could use a Vec3f instead of my struct Corner and it would work well. Problem I guess if I wanted two ints and one float type?? It's not obvious from OpenCV documentation that you can't define you own types for this _Tp template parameter.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload