-
Notifications
You must be signed in to change notification settings - Fork 11
Support for the latest OpenCV version #54
base: develop
Are you sure you want to change the base?
Conversation
…ub.com/NervanaSystems/aeon into kbinias/support_opencv_greater_than_v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions and one suggestion.
@@ -141,6 +141,10 @@ find_package(PkgConfig REQUIRED) | |||
|
|||
find_package(OpenCV REQUIRED) | |||
|
|||
if(NOT (${OpenCV_VERSION} VERSION_LESS 3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about that?
if(NOT (${OpenCV_VERSION} VERSION_LESS 3)) | |
if${OpenCV_VERSION} VERSION_GREATER_EQUAL 3) |
@@ -77,6 +77,10 @@ image::extractor::extractor(const image::config& cfg) | |||
{ | |||
_pixel_type = CV_MAKETYPE(CV_8U, cfg.channels); | |||
_color_mode = cfg.channels == 1 ? CV_LOAD_IMAGE_GRAYSCALE : CV_LOAD_IMAGE_COLOR; | |||
#ifdef OPENCV_LEGACY_MODE | |||
// Do not run ApplyExifOrientation as this causes Segmentation faults | |||
_color_mode = _color_mode | CV_LOAD_IMAGE_IGNORE_ORIENTATION; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So with OpenCV>=3 we have to add CV_LOAD_IMAGE_IGNORE_ORIENTATION
to prevent the unexpected orientation change?
@@ -86,7 +90,11 @@ shared_ptr<image::decoded> image::extractor::extract(const void* inbuf, size_t i | |||
|
|||
// It is bad to cast away const, but opencv does not support a const Mat | |||
// The Mat is only used for imdecode on the next line so it is OK here | |||
#ifdef OPENCV_LEGACY_MODE | |||
cv::Mat input_img(insize * CV_MAT_CN(_pixel_type), 1, CV_8UC1, (char*)inbuf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this constructor do?
libs = "" | ||
include_dirs = "" | ||
include_dirs += " -I${CMAKE_PREFIX_PATH}/include " | ||
lib_dirs = "${CMAKE_PREFIX_PATH}/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here to this file?
Added support for the latest OpenCV version (tested with 2.4.x, 3.4.x, 4.2.x)