visual c++ - Converting image from Triclops into opencv RGB image Mat. -
i want use opencv processing on rectified images bumblebee2 camera. using flycapture2 , triclops grab images sensor , rectify them. want convert triclopscolorimage cv::mat use opencv.
from triclopscolorimage object can following:
int nrows; // number of rows in image int ncols; //the number of columns in image int rowinc; //the row increment of image unsigned char * blue; //pixel data blue band of image unsigned char * red; //pixel data red band of image unsigned char * green; //pixel data green band of image
i don't know how convert information cv::mat image can work on it. can please point me in right direction?
i haven't tested , don't know version of opencv you're using, following should point in right direction. so, assuming variable names question:
cv::mat r(nrows, ncols, cv_8uc1, red, rowinc); cv::mat g(nrows, ncols, cv_8uc1, green, rowinc); cv::mat b(nrows, ncols, cv_8uc1, blue, rowinc); std::vector<cv::mat> array_to_merge; array_to_merge.push_back(b); array_to_merge.push_back(g); array_to_merge.push_back(r); cv::mat colour; cv::merge(array_to_merge, colour);
Comments
Post a Comment