In the opencv github wiki it reads 'IplImage ... are mostly excluded from API and will be completely excluded in further OpenCV 4.x updates'. But in the 4.0.1 version there is still a include\opencv2\core\type_c.h file which contains the structure IplImage. Does it mean we can still use this data structure in opencv 4.0.1 [though it's not recommended to do so]?
Related
I just need to call cv::imread("xxx.jpg"), how can I compile the most simple lib of opencv?
You'd better use other frameworks other than OpenCV. OpenCV is extremely heavy for this kind of job. It's mainly focused on image processing.
Maybe you can use OpenImageIO, freeimage or other libs.
You can refer to these posts:
Reading an image file in C/C++
https://products.fileformat.com/image/cpp/openimageio
I'm trying to get the algorithm provided in this repository to work on windows. After countless issues, I'm only left with one unrecognized function cvLoadImage which is apprently depricated. I was instructed to work with the c++ API instead but the problem is that I will have to rewrite other parts of the code as well and I might end up breaking it.
#include <opencv2/imgcodecs/imgcodecs_c.h>
returned the below error on Visual Studio:
"This header with legacy C API declarations has been removed from OpenCV. Legacy contants are available from legacy/constants_c.h file."
I imported all files provided in the opencv folder named constants_c.h, but none contained the function definition.
Indeed, that is the old OpenCV C API. You will need to port the old C functions to the c++ OpenCV API, e.g.:
cvNamedWindow -> cv::namedWindow
cvRectangle -> cv::rectangle
cvPoint -> cv::Point
etc.
The code you're using is actually a mix of the old C API and the newer c++ API.
It's just a matter of going through all the C API calls in that repo and manually port them to the c++ API. As you can see above, most of the time that is fairly intuitive. When in doubt search the OpenCV documentation.
Additionally you should look into YOLOv2 for Pedestrian detection.
Update:
There are multiple forks of this repository and it looks like Berak already has already removed the C API calls. His changes were merged, so you should to pull the latest changes and rebuild:
cd C4-Real-time-pedestrian-detection
git pull
cmake . -DCMAKE_CXX_FLAGS="-std=c++11"
make -j8
I've tested the above on my machine:
Regarding my setup, I ran into this error first:
cvdef.h:656:4: error: "OpenCV 4.x+ requires enabled C++11 support"
which is why I've passed the -std=c++11 compiler flag to cmake.
This may be because I'm an older version of OSX (10.11.6) with Xcode 7.0 (about 3 years old now). The current machine has 8 cores, hence make -j8.
Feel free to change these two options as necessary on your machine.
In the iOS project (with no cocoaPods), openCV is used.
And the one who create this project can not be contacted because he went to other company.
I realized in the project, openCV framework name is openCV2.framework, so I assume version is 2.x.x.
But I can not find any clue about the version anymore.
In the code, no version is mentioned.
I want to know the version for security reason.
Any way to check opencv version in iOS project ?
If you the framework file in the exact version, it is defined in there.
std::cout << CV_VERSION << std::endl;
(assuming C++)
If you don't have the dependencies, you can only look for strings in the binary or estimate from what features are used.
There is an easier way of checking OpenCV version if you have access to the project's source code. Just take a look to the file opencv2.framework/Versions/Current/Resources/Info.plist. Key CFBundleVersion contains the version number you are looking for. Here you have the contents of said file for version 4.1.0:
So like the title says I've been following this tutorial which seems to be the go to tutorial for how to handle haar feature training using the OpenCV.
Mergevec is a utility that merged together vec files so that you could generate a large number of samples from relatively few images. Anyway, he has an exe but it appears to be for 32-bit OpenCV 2.4.3 while I have 64-bit version 2.4.5. Any help would be appreciated!
My version is built using cmake and Visual Studio 10 as the compiler
Figured it out! Hopefully others can make use of this too!
Basically you want to:
First add mergevec.cpp to the folder \opencv\apps\haartraining then add the following to CMakeLists.txt
# -----------------------------------------------------------
# mergevec
# -----------------------------------------------------------
add_executable(opencv_mergevec mergevec.cpp)
set_target_properties(opencv_performance PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_mergevec")
In freak_demo.cpp, there's this comment:
// MATCHER
// The standard Hamming distance can be used such as
// BruteForceMatcher<Hamming> matcher;
// or the proposed cascade of hamming distance using SSSE3
But how to use SSSE3? It's best if this comment also includes the sample code.
As far as I remember you should be able to set SSE support when generating OpenCV project using CMake and then compiling OpenCV. It is possible that some binary versions of OpenCV which are distributed could have been already compiled with this setting.
This could be also helpful- OpenCV Install Guide.
As far as I know (I didn't write the FREAK code myself but had to work with the fREAK guys a lot) the BruteForceMatcher class from OpenCV was either changed or removed in the latest version. Anyway, this part of the code is broken if you use the latest stable release (2.4.3) and there are some bug requests to update it, but I have no idea wether it's in the pipeline.