@@ -53,7 +53,7 @@ bool ReadProtoFromBinaryFile(const char* filename, Message* proto) {
53
53
int fd = open (filename, O_RDONLY);
54
54
CHECK_NE (fd, -1 ) << " File not found: " << filename;
55
55
ZeroCopyInputStream* raw_input = new FileInputStream (fd);
56
- CodedInputStream* coded_input = new CodedInputStream (raw_input);
56
+ CodedInputStream* coded_input = new CodedInputStream (raw_input);
57
57
#if GOOGLE_PROTOBUF_VERSION >= 3011000
58
58
// Only take one parameter since protobuf 3.11
59
59
coded_input->SetTotalBytesLimit (kProtoReadBytesLimit );
@@ -79,8 +79,8 @@ void WriteProtoToBinaryFile(const Message& proto, const char* filename) {
79
79
cv::Mat ReadImageToCVMat (const string& filename,
80
80
const int height, const int width, const bool is_color) {
81
81
cv::Mat cv_img;
82
- int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
83
- CV_LOAD_IMAGE_GRAYSCALE );
82
+ int cv_read_flag = (is_color ? cv::IMREAD_COLOR :
83
+ cv::IMREAD_GRAYSCALE );
84
84
cv::Mat cv_img_origin = cv::imread (filename, cv_read_flag);
85
85
if (!cv_img_origin.data ) {
86
86
LOG (ERROR) << " Could not open or find file " << filename;
@@ -185,8 +185,8 @@ cv::Mat DecodeDatumToCVMat(const Datum& datum, bool is_color) {
185
185
CHECK (datum.encoded ()) << " Datum not encoded" ;
186
186
const string& data = datum.data ();
187
187
std::vector<char > vec_data (data.c_str (), data.c_str () + data.size ());
188
- int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
189
- CV_LOAD_IMAGE_GRAYSCALE );
188
+ int cv_read_flag = (is_color ? cv::IMREAD_COLOR :
189
+ cv::IMREAD_GRAYSCALE );
190
190
cv_img = cv::imdecode (vec_data, cv_read_flag);
191
191
if (!cv_img.data ) {
192
192
LOG (ERROR) << " Could not decode datum " ;
0 commit comments