OpenCV C++, getting Region Of Interest (ROI) using cv::Mat -


i'm new opencv (started using 2 days ago), i'm trying cut hand image depth image got kinect, need hand image gesture recognition. have image cv::mat type. questions are:

  1. is there way convert cv::mat cvmat can use cvgetsubrect method region of interest?
  2. are there methods in cv::mat can use getting part of image?

i wanted use iplimage read somewhere cv::mat preferred way now.

you can use overloaded function call operator on cv::mat:

cv::mat img = ...; cv::mat subimg = img(cv::range(0, 100), cv::range(0, 100)); 

check opencv documentation more information , overloaded function takes cv::rect. note using form of slicing creates creates new matrix header, not copy data.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -