Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all 322 articles
Browse latest View live

Error building opencv 3.3.0 Windows 10 Cmake 3.10

$
0
0
I was trying to build opencv to use in Code::Blocks following this guide: link: https://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw. While building, I got the following error. How to proceed? ---------- [ 39%] Building RC object modules/videoio/CMakeFiles/opencv_videoio.dir/vs_version.rc.obj gcc: error: SOFTWARE\opencv\sources\3rdparty\include\ffmpeg_: No such file or directory gcc: error: unrecognized command line option '-\' C:\MinGW\bin\windres.exe: preprocessing failed. modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:236: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/vs_version.rc.obj' failed mingw32-make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/vs_version.rc.obj] Error 1 CMakeFiles\Makefile2:2912: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed mingw32-make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 Makefile:161: recipe for target 'all' failed mingw32-make: *** [all] Error 2 ----------

for below code I'm getting this error: OpenCV(3.4.1) C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\imgproc\src\color.cpp:11147: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor

$
0
0
import cv2 import numpy as np facedetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml'); cam=cv2.VideoCapture(1); while(True): retval,img=cam.read(); gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces=facedetect.detectMultiScale(gray,1.3,5); for(x,y,w,h)in faces: cv2.rectangle(img,(x,y),(x+w,y+h),(0,0,255),2) cv2.imshow("Face",img); if(cv2.waitKey(1)==ord('q')): break; cam.release() cv2.destroyAllWindows()

"opencv\sources\modules\core\src\matrix.cpp:284: error: (-215) 0

$
0
0
Hi, I've faced a problem. Whenever, I let this code be at the end of my program, it executes to the end without any problem. Mat drawing2 = Mat::zeros( drawing.size(), CV_8UC1 ); fill_holes(drawing, drawing2); namedWindow( "drawing2", WINDOW_NORMAL ); imshow( "drawing2", drawing2 ); But, when I delete the code, suprisingly, it terminates before the end and the message is like this: terminate called after throwing an instance of 'cv::Exception' what(): E:\opencv\sources\modules\core\src\matrix.cpp:284: error: (-215) 0 <= _dims && _dims <= 32 in function setSize Thank you for the help

I am getting this error please help and I have all the ways to resolve it

$
0
0
![image description](/upfiles/15339231787408422.png) OpenCV(3.4.1) Error: Unknown error code -49 (Input file is empty) in cvOpenFileStorage, file /Users/travis/build/skvark/opencv-python/opencv/modules/core/src/persistence_c.cpp, line 384 OpenCV(3.4.1) Error: Unknown error code -49 (Input file is empty) in cvOpenFileStorage, file /Users/travis/build/skvark/opencv-python/opencv/modules/core/src/persistence_c.cpp, line 384 Traceback (most recent call last): File "OpenCV10.py", line 30, in faces = face_cascade.detectMultiScale(gray, 1.3, 5) TypeError: Incorrect type of self (must be 'CascadeClassifier' or its derivative)

OpenCV 3.3.0 Build error - AVX2 code throwing assembly messages

$
0
0
I am building a baseline OpenCV 3.3.0 for a CentOS 6.9 x86_64 Intel i5 650 @ 3.2GHz. I am not a sudoer.
After running:cmake -D CMAKE_INSTALL_PREFIX=/home/user/lib/opencv330/build/install -D BUILD_EXAMPLES=ON -D BUILD_JASPER=ON -D BUILD_JPEG=ON -D BUILD_OPENEXR=ON -D BUILD_PNG=ON -D BUILD_TIFF=ON -D BUILD_ZLIB=ON -D BUILD_opencv_world=ON -D WITH_CUBLAS=OFF -D WITH_CUDA=OFF -D WITH_CUFFT=OFF -D WITH_IPP=OFF -D WITH_ITT=OFF -D WITH_OPENCL=OFF -D WITH_OPENCLAMDBLAS=OFF -D WITH_OPENCLAMDFFT=OFF ..
And then: make
It happily builds all the dependencies, but when it reaches the core module, it outputs assembly errors complaining about 'no such instruction' or 'suffix or operands invalid for vpaddq' ... while trying to build modules/core/CMakeFiles/opencv_core.dir/mathfuncs_core.avx2.cpp.o I searched and found a thread from another who had a similar problem, but was building an older version of OpenCV. I checked it anyway: cat /proc/cpuinfo; it did NOT list FP16, SSE3, AVX, and AVX2. His post referred to a missing SSE3 set as well. So, I rm'd the entire build directory and ran a fresh CMake:
cmake -D CMAKE_INSTALL_PREFIX=/home/user/lib/opencv330/build/install -D BUILD_EXAMPLES=ON -D BUILD_JASPER=ON -D BUILD_JPEG=ON -D BUILD_OPENEXR=ON -D BUILD_PNG=ON -D BUILD_TIFF=ON -D BUILD_ZLIB=ON -D BUILD_opencv_world=ON -D WITH_CUBLAS=OFF -D WITH_CUDA=OFF -D WITH_CUFFT=OFF -D WITH_IPP=OFF -D WITH_ITT=OFF -D WITH_OPENCL=OFF -D WITH_OPENCLAMDBLAS=OFF -D WITH_OPENCLAMDFFT=OFF -D CPU_BASELINE_DISABLE=SSE3,AVX2 ..
Again: make This time, it successfully built the core module!
...Only to have remarkably similar errors as before thrown during the imgproc module.
Here's the output:
[ 33%] Built target opencv_core
[ 33%] Generating opencl_kernels_imgproc.cpp, opencl_kernels_imgproc.hpp
Scanning dependencies of target opencv_imgproc
[ 33%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/accum.cpp.o
[ 33%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/accum.dispatch.cpp.o
.
.
[ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/opencl_kernels_imgproc.cpp.o
[ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/accum.sse2.cpp.o
[ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/imgwarp.sse4_1.cpp.o
[ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/corner.avx.cpp.o
[ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/accum.avx.cpp.o
[ 37%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/imgwarp.avx2.cpp.o
/tmp/ccFZNVK2.s: Assembler messages:
/tmp/ccFZNVK2.s:51: Error: suffix or operands invalid for 'vpcmpeqd'
/tmp/ccFZNVK2.s:100: Error: no such instruction: 'vpgatherdd %ymm6,(%rdx,%ymm1,1),%ymm0'
This smells like a bug somewhere, but where? Maybe somehow it ignores the value of CPU_BASELINE_DISABLE=SSE3,AVX2 when it generates the makefile, after it gets to the imgproc module? Where would this be located? It successfully skips building AVX2 in core, too.
Any help would be *greatly* appreciated!

Singular Value Decomposition (SVD) with opencv

$
0
0
Hi, I am using SVD for my algorithm and the decomposition is done by this instruction: const int N= 16; Mat x= (Mat_(N, N)<< 23, 24, 24, 23, 22.5, 21.5, 20, 20, 19, 20, 22, 23, 23, 23.5, 24, 25.5, 23.5, 24, 23, 21, 21, 22, 21, 20, 18.5, 18, 19, 20, 20.5, 23, 24, 24, 24, 24, 22, 21, 21.5, 21.5, 21, 20, 19.5, 20, 21, 21, 22, 23, 24, 24, 24.5, 24, 23, 23, 23, 21, 20, 20, 20, 22, 22, 22, 23, 23, 24, 24, 24, 24, 24, 24, 24, 22, 20, 20, 20, 21, 21, 21, 21, 22, 24, 24, 24, 24.5, 25, 24.5, 24, 22, 20, 21, 21, 21, 22, 22, 22, 23, 24, 24, 24, 24.5, 25, 24.5, 24, 22, 20, 22, 23, 23, 24, 24, 23, 22, 22.5, 23, 24.5, 24.5, 24, 24, 23, 22, 22, 23, 24.5, 24.5, 23, 21.5, 21, 21, 22.5, 22.5, 23.5, 24.5, 25.5, 25, 23.5, 24.5, 26, 25.5, 24, 25, 22.5, 20.5, 20.5, 21, 21, 20.5, 24.5, 25.5, 26, 25.5, 24.5, 25, 25.5, 25, 24, 24, 22, 20.5, 20.5, 19.5, 18.5, 19.5, 25.5, 25.5, 26, 26, 25, 25, 25, 25, 23.5, 24, 22, 20, 20, 19.5, 18.5, 21, 24, 24, 24, 24, 24, 24.5, 23, 22.5, 24, 24.5, 23, 20.5, 20, 20, 20.5, 22.5, 24, 24, 24, 24, 24, 24, 23, 22.5, 24, 23.5, 23, 21.5, 20, 19.5, 22, 24, 22.5, 23, 22.5, 22, 23, 23, 22, 21.5, 23, 22, 22, 22, 20, 20.5, 23, 24, 22.5, 21.5, 21.5, 22, 23, 24, 22.5, 20, 21, 20.5, 20.5, 22, 22, 23, 23.5, 23.5, 22.5, 21, 21, 21, 21, 23, 21.5, 20, 20, 20.5, 20.5, 22, 24, 24, 23.5, 23.5); Mat Sigma= Mat::zeros(N, N, CV_64FC1); Mat S, U, VT, x_hat, err; int minLoc[2], maxLoc[2]; double minVal, maxVal; SVDecomp(x, S, U, VT, cv::SVD::FULL_UV); /*Please note that S is a column vector and S should be a square diagonal matrix, Assigning the components of the S to the diagonal components of Sigma*/ x_hat= U * Sigma* VT; cout<< "U * Sigma* VT= "<< endl<< x_hat<< endl; absdiff(x, x_hat, err); And the error is really huge!!! (Terminal output) Reconstruction err: MIN= 0.00135955, MAX= 2.99473, sum= [176.076, 0, 0, 0] Which is shit! The whole process is done very straight forward with matlab. What's wrong with opencv SVD? Why does the operation loon irreversible?!!!! Your advices are highly appreciated. minMaxIdx(err, &minVal, &maxVal, minLoc, maxLoc); cout<< "Reconstruction err: MIN= "<< minVal<< ", MAX= "<< maxVal<< ", sum= "<< sum(err)<< endl; for (i1= 0; i1< N; i1++) Sigma.at(i1, i1)= S.at(i1, i1);

Error wnen installing OpenCV from source

$
0
0
When I am doing ``make``, I am getting the following error `` /home/srisankethu/Desktop/opencv-3.4.3/modules/videoio/src/cap_dc1394_v2.cpp:58:10: fatal error: dc1394/dc1394.h: No such file or directory #include ^~~~~~~~~~~~~~~~~ compilation terminated. modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:230: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o' failed make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o] Error 1 CMakeFiles/Makefile2:5389: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2 ``

error compilation openCV

$
0
0
[ 0%] Built target gen-pkgconfig [ 2%] Built target zlib [ 6%] Built target libjpeg [ 9%] Built target libtiff [ 19%] Built target libwebp [ 22%] Built target libjasper [ 24%] Built target libpng [ 30%] Built target IlmImf [ 36%] Built target libprotobuf [ 36%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/arithm.cpp.obj In file included from C:\opencv\sources\modules\core\include/opencv2/core/hal/intrin.hpp:316:0, from C:\opencv\sources\modules\core\src\precomp.hpp:85, from C:\opencv\sources\modules\core\src\arithm.cpp:50: C:\opencv\sources\modules\core\include/opencv2/core/hal/intrin_sse.hpp: In function '__m128i cv::hal_baseline::v_select_si128(__m128i, __m128i, __m128i)': C:\opencv\sources\modules\core\include/opencv2/core/hal/intrin_sse.hpp:410:65: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi] inline __m128i v_select_si128(__m128i mask, __m128i a, __m128i b) ^ In file included from C:\opencv\sources\modules\core\include/opencv2/core/cv_cpu_dispatch.h:32:0, from C:\opencv\sources\modules\core\include/opencv2/core/cvdef.h:193, from C:\opencv\sources\modules\core\include/opencv2/core.hpp:52, from C:\opencv\sources\modules\core\include/opencv2/core/utility.hpp:56, from C:\opencv\sources\modules\core\src\precomp.hpp:49, from C:\opencv\sources\modules\core\src\arithm.cpp:50: C:/PROGRA~2/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/emmintrin.h: In function 'int cvRound(double)': C:/PROGRA~2/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/emmintrin.h:825:1: error: inlining failed in call to always_inline 'int _mm_cvtsd_si32(__m128d)': target specific option mismatch _mm_cvtsd_si32 (__m128d __A) ^ In file included from C:\opencv\sources\modules\core\include/opencv2/core/saturate.hpp:49:0, from C:\opencv\sources\modules\core\include/opencv2/core/matx.hpp:54, from C:\opencv\sources\modules\core\include/opencv2/core.hpp:57, from C:\opencv\sources\modules\core\include/opencv2/core/utility.hpp:56, from C:\opencv\sources\modules\core\src\precomp.hpp:49, from C:\opencv\sources\modules\core\src\arithm.cpp:50: C:\opencv\sources\modules\core\include/opencv2/core/fast_math.hpp:106:28: error: called from here return _mm_cvtsd_si32(t); ^ In file included from C:\opencv\sources\modules\core\include/opencv2/core/cv_cpu_dispatch.h:32:0, from C:\opencv\sources\modules\core\include/opencv2/core/cvdef.h:193, from C:\opencv\sources\modules\core\include/opencv2/core.hpp:52, from C:\opencv\sources\modules\core\include/opencv2/core/utility.hpp:56, from C:\opencv\sources\modules\core\src\precomp.hpp:49, from C:\opencv\sources\modules\core\src\arithm.cpp:50: C:/PROGRA~2/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/emmintrin.h:61:1: error: inlining failed in call to always_inline '__m128d _mm_set_sd(double)': target specific option mismatch _mm_set_sd (double __F) ^ In file included from C:\opencv\sources\modules\core\include/opencv2/core/saturate.hpp:49:0, from C:\opencv\sources\modules\core\include/opencv2/core/matx.hpp:54, from C:\opencv\sources\modules\core\include/opencv2/core.hpp:57, from C:\opencv\sources\modules\core\include/opencv2/core/utility.hpp:56, from C:\opencv\sources\modules\core\src\precomp.hpp:49, from C:\opencv\sources\modules\core\src\arithm.cpp:50: C:\opencv\sources\modules\core\include/opencv2/core/fast_math.hpp:105:35: error: called from here __m128d t = _mm_set_sd( value ); ^ modules\core\CMakeFiles\opencv_core.dir\build.make:114: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/arithm.cpp.obj' failed mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/arithm.cpp.obj] Error 1 CMakeFiles\Makefile2:1659: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:161: recipe for target 'all' failed mingw32-make: *** [all] Error 2

Suppress, hide or disable the error/warning messages

$
0
0
I was wondering if there was a way to suppress, hide or disable the error or warning messages outputted to the screen? I think they come from FFMpeg and they either show up as follows: CASE 1: [mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
[mpeg2video @ 0x3430c00] Invalid frame dimensions 0x0.
or CASE 2: ... [h264 @ 0x29e5a40] co located POCs unavailable
[h264 @ 0x2a6c3c0] co located POCs unavailable
[h264 @ 0x29d7b80] reference picture missing during reorder
[h264 @ 0x29d7b80] Missing reference picture, default is 65656
[h264 @ 0x298da80] mmco: unref short failure
[h264 @ 0x298da80] number of reference frames (0+6) exceeds max (5; probably corrupt input), discarding one
[h264 @ 0x29dc700] reference picture missing during reorder
[h264 @ 0x29dc700] Missing reference picture, default is 65672
[h264 @ 0x2a27180] mmco: unref short failure
[h264 @ 0x2af7680] co located POCs unavailable
[h264 @ 0x29e5a40] mmco: unref short failure
[h264 @ 0x29e5a40] number of reference frames (0+6) exceeds max (5; probably corrupt input), discarding one
[h264 @ 0x2af9040] mmco: unref short failure
To my understanding CASE 1, is a known issue, as it is looking for a PES header. There are only a few of these messages until it finds the header. I do not understand CASE 2, I do not know what is happening, but it seems to read the image @ frame. There are many many of these messages which outputs to the console window and adds minutes to the processing time.

installing opencv with visual studio 2017

$
0
0
So, I was attempting to install OpenCV using Pre-built libraries per Bernát Gábor's tutorial. The last step is to set the OpenCV environment variable and add it to the path of the system. I had two issues at this step: *1. What would be the correct command line prompt for Visual Studio 17 (none given in tutorial)* and **2. I get this message(ERROR: Access to the registry path is denied) even when I input the command line for VS 15.**

Error 'module' object has no attribute 'TrackerMIL_create'

$
0
0
OpenCV 3.4 Python 2.7 My code: import cv2 import numpy as np from datetime import datetime import time now = datetime.now() i=0 cap= cv2.VideoCapture(0); fourcc = cv2.VideoWriter_fourcc(*'XVID') out= cv2.VideoWriter('videos/'+str(now)+'.avi', fourcc,20.0,(480,640)) tracker=cv2.TrackerMIL_create() bbox = (100,100,200,200) ret, frame = cap.read() ok=tracker.init(frame,bbox) My error: Traceback (most recent call last): File "test.py", line 17, in tracker=cv2.TrackerMIL_create() AttributeError: 'module' object has no attribute 'TrackerMIL_create' hellp me plese. i'm use python 2.7 because others versions not work in my windows 7

Errors when trying to make Samples

$
0
0
Attempting to install OpenCV 3.4.3 on Linux Ubuntu 16.04. When I go to "make" the samples I get the following: Scanning dependencies of target example_tutorial_how_to_use_OpenCV_parallel_for_ [ 25%] Building CXX object cpp/CMakeFiles/example_tutorial_how_to_use_OpenCV_parallel_for_.dir/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp.o /home/pablocore/Desktop/OpenCV/opencv-3.4.3/samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp:45:50: error: expected ‘;’ at end of member declaration virtual void operator ()(const Range& range) const CV_OVERRIDE ^ /home/pablocore/Desktop/OpenCV/opencv-3.4.3/samples/cpp/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp:45:56: error: ‘CV_OVERRIDE’ does not name a type virtual void operator ()(const Range& range) const CV_OVERRIDE ^ cpp/CMakeFiles/example_tutorial_how_to_use_OpenCV_parallel_for_.dir/build.make:62: recipe for target 'cpp/CMakeFiles/example_tutorial_how_to_use_OpenCV_parallel_for_.dir/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp.o' failed make[2]: *** [cpp/CMakeFiles/example_tutorial_how_to_use_OpenCV_parallel_for_.dir/tutorial_code/core/how_to_use_OpenCV_parallel_for_/how_to_use_OpenCV_parallel_for_.cpp.o] Error 1 CMakeFiles/Makefile2:1843: recipe for target 'cpp/CMakeFiles/example_tutorial_how_to_use_OpenCV_parallel_for_.dir/all' failed make[1]: *** [cpp/CMakeFiles/example_tutorial_how_to_use_OpenCV_parallel_for_.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 I'm really really new to all of this so can anyone point me in the right direction? I've tried clearing it and redownloading but it does the same thing. Please give me baby steps. Thanks

when I run the below code, I take below error. Can you help me ?

$
0
0
import cv2 import numpy as np image = cv2.imread('yüz1.jpg') faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') greyImage = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiScale(image,1.1,4) for(x,y,w,h) in faces : cv2.rectangle(image, (x,y), (x+w,y+h),(0,255,0),3) cv2.imshow('faces', image) cv2.waitKey(0) cv2.destroyAllWindows() The Result : Check image path -- But image and code is the same path then it is writing continuous 'Check image path' when I run the code

libpng warning: Image width is zero in IHDR

$
0
0
Hi, when i run my first OpenCV application in Java i receive that message from compiler: Running DetectFaceDemo Detected 0 faces Writing faceDetection.png *libpng warning: Image width is zero in IHDR libpng warning: Image height is zero in IHDR libpng error: Invalid IHDR data* i try the example from: http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html

Incorrect reading of Jpeg2000 images with unstandard encoding

$
0
0
Hi, I am trying to read Jpeg2000 images with an unstandard 15-bit encoding in Python. More precisely I am trying to read Sentinel-2 L1C satellite images provided by ESA. I am using the following code ```Python import cv2 image = cv2.imread('./B01.jp2', cv2.IMREAD_UNCHANGED) ```` The code works and I don't get any errors or warnings but the obtained image values are 2 times higher that they should be. Looks like the image is read as it would have 16-bit encoding and all values are multiplied by 2. If I read the same image with Glymur package the obtained image values are correct (and not 2 times higher as with OpenCV): ``` import glymur image = glymur.Jp2k('./B01.jp2')[:] ``` I would like to know if there is a bug/error in OpenCV or are these kind of encodings just not supported? Here is link where you can download Sentinel-2 images I am trying to read: http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/22/L/GJ/2018/1/23/0/

Tried to compile tracker from tutorial and got error "‘Tracker’ was not declared in this scope Ptr tracker = TrackerKCF::create();"

$
0
0
Tried to compile tracker https://docs.opencv.org/3.1.0/d2/d0a/tutorial_introduction_to_tracker.html and got error "/home/vioh/tracker2/tracker2.cpp: In function ‘int main(int, char**)’: /home/vioh/tracker2/tracker2.cpp:24:7: error: ‘Tracker’ was not declared in this scope Ptr tracker = TrackerKCF::create(); ^ /home/vioh/tracker2/tracker2.cpp:24:14: error: template argument 1 is invalid Ptr tracker = TrackerKCF::create(); ^ /home/vioh/tracker2/tracker2.cpp:24:26: error: ‘TrackerKCF’ has not been declared Ptr tracker = TrackerKCF::create(); ^ /home/vioh/tracker2/tracker2.cpp:35:10: error: base operand of ‘->’ is not a pointer tracker->init(frame,roi); ^ /home/vioh/tracker2/tracker2.cpp:45:12: error: base operand of ‘->’ is not a pointer tracker->update(frame,roi); ^ CMakeFiles/tracker2.dir/build.make:62: recipe execution error for goal «CMakeFiles/tracker2.dir/tracker2.cpp.o» make[2]: *** [CMakeFiles/tracker2.dir/tracker2.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe execution error for goal «CMakeFiles/tracker2.dir/all» make[1]: *** [CMakeFiles/tracker2.dir/all] Error 2 Makefile:83: recipe execution error for goal «all» make: *** [all] Error 2 "

I got a error "Incorrect type of self (must be 'Feature2D' or its derivative)" from line7(keypoints~~)

$
0
0
import cv2 as cv import numpy as np im = cv.imread("mini.jpg", cv.IMREAD_GRAYSCALE) detector = cv.SimpleBlobDetector() keypoints = detector.detect(im) im_with_keypoints = cv.drawKeypoints(im, keypoints, np.array([]), (0,0,255), cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS) cv.imshow("keypoints", im_with_keypoints) k = cv.waitKey(0) cv.destroyAllWindows()

java.lang.UnsatisfiedLinkError: Cannot find dependent libraries

$
0
0
Some `Windows 7` users cannot use the Java bindings. For more information see the following links: https://github.com/opencv/opencv/issues/13012 https://stackoverflow.com/questions/53100890/ Thank you for helping.

Error loading image 7656x6619

$
0
0
im trying to load 2 images of 150MB and i cant load it someone can helme please? this is my code, i don´t have errors Mat imageRed = imread("images/OrtoImagenTest/band(3).tif", CV_LOAD_IMAGE_GRAYSCALE); Mat imageNir = imread("images/OrtoImagenTest/band(4).tif", CV_LOAD_IMAGE_GRAYSCALE); int rows = imageRed.rows; int cols = imageRed.cols; cout <<"rows " <

Neural Network in OpenCV 3.1.0

$
0
0
Hello everyone! I am currently trying to get OpenCV's neural network module running, unluckily so far with less success. Initialization and training works fine (at least as far as I can verify it) but as soon as I try to do a prediction, I'm receiving segmentation fault errors... I tried training / predicting on both Windows 8 as well as Ubuntu 16.04 on a custom Linux build as well as on a third-party Windows build respectively, as soon as I try a prediction, the same error occurs. I also prepared some usable example code. Of course I know that training on randomly generated data makes not too much sense in practice, I only wanted to keep things simple for a minimum running example: #include using namespace cv; using namespace cv::ml; int main(int argc, char *argv[]) { //create random training data Mat_ data(100, 100); randn(data, Mat::zeros(1, 1, data.type()), Mat::ones(1, 1, data.type())); //half of the samples for each class Mat_ responses(data.rows, 1); for (int i=0; i layerSizes(1, 3); layerSizes(0, 0) = data.cols; layerSizes(0, 1) = 20; layerSizes(0, 2) = 1; Ptr networkPtr = ANN_MLP::create(); ANN_MLP* network = networkPtr.get(); network->setLayerSizes(layerSizes); network->setActivationFunction(0, 0.1, 0.1); network->setTrainMethod(0, 0.1, 0.1); /* //test to change variable type flags -> problem stays the same Mat_ varType = Mat(1, data.cols+1, CV_8U); for (int i = 0; i trainData = TrainData::create(data, ROW_SAMPLE, responses, noArray(), noArray(), noArray(), varType); */ Ptr trainData = TrainData::create(data, ROW_SAMPLE, responses); network->train(trainData); if (network->isTrained()) { printf("Predict:\n"); network->predict(Mat::ones(1, data.cols, data.type())); //SEGMENTATION FAULT printf("Prediction done!\n"); } return 0; } Does anyone got the Neural Network running in OpenCV 3.1.0? For me either I'm doing something wrong (in case, please let me know) or this is a bug in OpenCV... I would appreciate any comments :-) edit - updated source code: #include using namespace cv; using namespace cv::ml; int main(int argc, char *argv[]) { //create random training data Mat_ data(100, 100); randn(data, Mat::zeros(1, 1, data.type()), Mat::ones(1, 1, data.type())); //half of the samples for each class Mat_ responses(data.rows, 2); for (int i = 0; i responses(data.rows, 1); //for (int i=0; i layerSizes(1, 3); layerSizes(0, 0) = data.cols; layerSizes(0, 1) = 20; layerSizes(0, 2) = 2; Ptr network = ANN_MLP::create(); network->setLayerSizes(layerSizes); network->setActivationFunction(0, 0.1, 0.1); network->setTrainMethod(0, 0.1, 0.1); Mat_ varType = Mat(1, data.cols+2, CV_8U); for (int i = 0; i trainData = TrainData::create(data, ROW_SAMPLE, responses, noArray(), noArray(), noArray(), varType); network->train(trainData); if (network->isTrained()) { printf("Predict:\n"); network->predict(Mat::ones(1, data.cols, data.type())); printf("Prediction done!\n"); for (int i=0; ipredict(data.row(i)); } return 0; }
Viewing all 322 articles
Browse latest View live