MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / ReadImageToCVMat

Function ReadImageToCVMat

rtpose_wrapper/src/caffe/util/io.cpp:73–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72#ifdef USE_OPENCV
73cv::Mat ReadImageToCVMat(const string& filename,
74 const int height, const int width, const bool is_color) {
75 cv::Mat cv_img;
76 int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
77 CV_LOAD_IMAGE_GRAYSCALE);
78 cv::Mat cv_img_origin = cv::imread(filename, cv_read_flag);
79 if (!cv_img_origin.data) {
80 LOG(ERROR) << "Could not open or find file " << filename;
81 return cv_img_origin;
82 }
83 if (height > 0 && width > 0) {
84 cv::resize(cv_img_origin, cv_img, cv::Size(width, height));
85 } else {
86 cv_img = cv_img_origin;
87 }
88 return cv_img;
89}
90
91cv::Mat ReadImageToCVMat(const string& filename,
92 const int height, const int width) {

Callers 4

TEST_FFunction · 0.85
DataLayerSetUpMethod · 0.85
load_batchMethod · 0.85
ReadImageToDatumFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68