This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Support for the latest OpenCV version #54
Open
kbinias
wants to merge
11
commits into
develop
Choose a base branch
from
kbinias/support_opencv_greater_than_v2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d7d7a67
Support for CV greather than v2
kbinias 05ab71f
Small improvements in build process
kbinias 33819e1
Support for CV greather than v2
kbinias 7652703
Small improvements in build process
kbinias 2759731
Merge branch 'kbinias/support_opencv_greater_than_v2' of https://gith…
kbinias 681851e
Fix build python setup for CV4
kbinias 9839f12
Add support for pkg_config_path internally
kbinias 24ebeed
Merge branch 'develop' into kbinias/support_opencv_greater_than_v2
kbinias 318c1d0
Fix python build for cv2
kbinias 79473e0
Update readme file with installation process
kbinias 18ca3b7
Remove building zlib, libpng, libjasper, openexr, libtiff libraries f…
kbinias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. So with OpenCV>=3 we have to add |
||
#endif | ||
} | ||
} | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. What does this constructor do? |
||
#else | ||
cv::Mat input_img(1, insize, _pixel_type, (char*)inbuf); | ||
#endif | ||
cv::imdecode(input_img, _color_mode, &output_img); | ||
|
||
if (output_img.empty()) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,19 +26,21 @@ def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=N | |
import distutils.ccompiler | ||
distutils.ccompiler.CCompiler.compile=parallelCCompile | ||
|
||
lib_dirs = "" | ||
lib_dirs += " -L${CMAKE_PREFIX_PATH}/lib " | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. What happened here to this file? |
||
include_dirs = "${OpenCV_INCLUDE_DIRS}".replace(';', ' ') | ||
|
||
status, tmp = getstatusoutput("pkg-config --cflags opencv") | ||
if "${CMAKE_PREFIX_PATH}": | ||
export_cv_pkg_config_path = "export PKG_CONFIG_PATH=${CMAKE_PREFIX_PATH}/lib/pkgconfig;" | ||
else: | ||
export_cv_pkg_config_path = "" | ||
|
||
status, tmp = getstatusoutput(export_cv_pkg_config_path + "pkg-config --cflags opencv") | ||
if status != 0: | ||
print("required package 'opencv' not found") | ||
exit() | ||
include_dirs += tmp | ||
lib_dirs += getoutput("pkg-config --libs-only-L opencv") | ||
libs += getoutput("pkg-config --libs-only-l opencv") | ||
include_dirs += " " + tmp | ||
lib_dirs += " " + getoutput(export_cv_pkg_config_path + "pkg-config --libs-only-L opencv") | ||
libs = getoutput(export_cv_pkg_config_path + "pkg-config --libs-only-l opencv") | ||
|
||
libs += ' -lstdc++fs' | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?