OpenCV-Tutorial | sample project demonstrating use of OpenCV library | Computer Vision library
kandi X-RAY | OpenCV-Tutorial Summary
kandi X-RAY | OpenCV-Tutorial Summary
Idea and development by Eugene Khvedchenya . This application is provided via BSD licence, it is free for both academic and commercial use. This application is provided as-is, with no warranty expressed or implied. Use this application at your own risk. The author assumes no liability for any loss associated with the use of this application. If you do not agree with the terms of this license, do not install this application.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of OpenCV-Tutorial
OpenCV-Tutorial Key Features
OpenCV-Tutorial Examples and Code Snippets
Community Discussions
Trending Discussions on OpenCV-Tutorial
QUESTION
I am following Creating your own Haar Cascade OpenCV Python Tutorial But when I get to making the samples I get opencv_createsamples: command not found
I am using this to create the samples opencv_createsample -img img.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 573
but I know the command exists because when I do man opencv_createsamples
it pulls up the man page.
I am using ubuntu 20.04.1
ANSWER
Answered 2020-Aug-07 at 18:13I have also met this same problem while trying to get Haar Cascade. Similar problem also mentioned here.
According to @Alekhin saying here:
To be able to use
opencv_createsamples
command, you should use opencv version 3.x or lower.
This step(creating samples) is only necessary to get our samples. So my suggestions:
Installing supported opencv version in a docker and getting samples
Installing supported opencv in another machine and getting samples
Note: I don't suggest you to install opencv while other one already exist in your machine.
QUESTION
Yesterday I updated my Android Studio included NDK to version 17.0.4754217
and since then I can't run my app anymore. When I tried to rerun the code after the update it gave me the error ABIs [mips64, armeabi, mips] are not supported for platform. Supported ABIs are [armeabi-v7a, arm64-v8a, x86, x86_64]
so I excluded them from the project in my app.gradle
file the following way: abiFilters 'x86', 'x86_64', /*'armeabi',*/ 'armeabi-v7a', 'arm64-v8a'/*, 'mips', 'mips64'*/
.
However, since then I'm having a problem with the C++-file where I use the OpenCV-function cv::CascadeClassifier::detectMultiScale
.
It always displays the error: CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o: In function detectAndDisplay(cv::Mat, double, int, std::__ndk1::basic_string, std::__ndk1::allocator >, cv::CascadeClassifier&)':
D:\Schule\OpenCV\ARcpp\app\src\main\cpp/native-lib.cpp:158: undefined reference to cv::CascadeClassifier::detectMultiScale(cv::_InputArray const&, std::__ndk1::vector, std::__ndk1::allocator > >&, double, int, int, cv::Size_, cv::Size_)'.
I call the function like this: cascadeClassifier.detectMultiScale(frame_gray, sights, scaleFactor, minNeighbours, 0 | CV_HAAR_SCALE_IMAGE, Size(30, 30));
. The rest of the code is pretty much like shown in the OpenCV-tutorial https://docs.opencv.org/2.4/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html.
Additionally to the NDK I use CMake and LLDB and my included OpenCV-library is openCVLibrary320
. Again, all of this worked until I downloaded the mentioned NDK update.
The rest of the error that always appears on building or executing the app is: Build command failed.
Error while executing process C:\Users\chris\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\Schule\OpenCV\ARcpp\app\.externalNativeBuild\cmake\debug\arm64-v8a --target native-lib}
[1/1] Linking CXX shared library ..\..\..\..\build\intermediates\cmake\debug\obj\arm64-v8a\libnative-lib.so
FAILED: cmd.exe /C "cd . && C:\Users\chris\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android --gcc-toolchain=C:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64 --sysroot=C:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/sysroot -fPIC -isystem C:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/aarch64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -std=c++11 -frtti -fexceptions -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot C:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -LC:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ..\..\..\..\build\intermediates\cmake\debug\obj\arm64-v8a\libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -llog ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so -latomic -lm "C:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_static.a" "C:/Users/chris/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++abi.a" && cd ."
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
I`m really lost, hopefully someone knows an answer.
...ANSWER
Answered 2018-May-13 at 17:13When linkin opencv with your project executables, you always have to link with the general library -lopencv_core. But some packages require additional link flags. For example, if you use highgui as in
QUESTION
I am trying to calibrate RaspiCam Fisheye lens camera with OpenCV. I am using Python example code and the cheesboard row and column numbers are also correct but somehow I can not get a successful result. I have tested with a lso much of photos below you can see them. My source code: https://github.com/jagracar/OpenCV-python-tests/blob/master/OpenCV-tutorials/cameraCalibration/cameraCalibration.py
my chess board rows and columns: rows = 9, cols = 6
but does not get a successful result
Edit: my solution
https://gist.github.com/mesutpiskin/0412c44bae399adf1f48007f22bdd22d
...ANSWER
Answered 2018-Jun-15 at 08:19First at all, as far as I can see your camera has fisheye optics, but it doesn't give all the surface of fisheye image (usually it is a circle inside black frame). The second. The code you are using is for usual camera or wide angle (90-110 degrees) It's not for fisheye (~ 180 degrees). Third. You can use source code URL link from HERE
QUESTION
My goal is to write a bot playing minesweeper, but i get stuck at the point, when i want to tell the bot, where the squares are. i tried a lot of different functions. First of all, my tool grabs a screenshot of a predefined area. This picture looks like this:screenshot of game board
after that i want to fill a numpy array in this way:
...ANSWER
Answered 2017-Aug-25 at 09:46I don't know what minesweeper is but from what i understood, you want to know which tiles are blue and then make necessary changes to your numpy array (correct me if its something else, i'll edit or remove the answer).
Here's the output after making four tiles blue:
What i did ?
First i thresholded the blue colour, found contours in the range approximately as that of your tiles.
Found their centers to see what pattern they follow -
They were all separated by some 55-57 pixels (both x,y coordinates). Rest is simple.
QUESTION
I was following this particular tutorial on object detection. He uses this version of detectMultiSacle function in his code, which allows him to adjust threshold for detection or something like that with rejectLevels and levelWeights:
...Python:
ANSWER
Answered 2017-Aug-24 at 16:45It's pretty hard to find python documentation for OpenCV 3.3 but the OpenCV3.0 docs show that detectMultiScale uses ouputRejectLevels
. Try using that argument.
Here's their breakdown:
Python: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) → objects
Python: cv2.CascadeClassifier.detectMultiScale2(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) → objects, numDetections
Python: cv2.CascadeClassifier.detectMultiScale3(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) → objects, rejectLevels, levelWeights
QUESTION
I am working on this code to perform foreground extraction but I don't understand the meaning of mask2 = np.where((mask==2 | (mask == 0), 0, 1).astype('uint8'))
and img = img*mask2[:, :, np.newaxis]
lines. Here is the code
ANSWER
Answered 2017-Jul-24 at 14:03mask2 is the foreground mask. so you only use foreground pixels which is done by setting every pixel 0 that is background, else 1
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OpenCV-Tutorial
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page