Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

first: bookmark this ! , and, ofc. this, too !

then we have:

  1. yes, but you'd rather just skip the assignment, std::vector< int > x; is all you need.
  2. yes ;)
  3. similar to 1., just use: std::vector<cv::Mat> m(mCount);
  4. see 3.
  5. now here it gets difficult. if you need a single pixel: float v = A.at< float >(row,col); note that is this is only valid IF the type of the Mat is float, you have to carefully adjust the type in the brackets (and the return value) to that. all in all, code that uses this for the whole image should be avoided !
  6. well that's plain wrong. luckily, cv::Mat has an overloaded () operator, that can be used quite similar to your java code: cv::Mat cropped = rotated(yoffset, yoffset + cropSize, xoffset, xoffset + cropSize);

first: bookmark this ! , and, ofc. this, too !

then we have:

  1. yes, but you'd rather just skip the assignment, std::vector< int > x; is all you need.
  2. yes ;)
  3. similar to 1., just use: std::vector<cv::Mat> m(mCount);
  4. see 3.
  5. now here it gets difficult. if you need a single pixel: float v = A.at< float >(row,col); note that is this is only valid IF the type of the Mat is float, usually, for a bgr image it would look like: Vec3b pixel = A.at<Vec3b>(r,c); you have to carefully adjust the type in the brackets (and the return value) to that. all in all, code that uses this for the whole image should be avoided !
  6. well that's plain wrong. luckily, cv::Mat has an overloaded () operator, that can be used quite similar to your java code: cv::Mat cropped = rotated(yoffset, yoffset + cropSize, xoffset, xoffset + cropSize);