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

OpenCV 3.0 Can't Open Camera in Java Netbean

$
0
0
"Can not open Camera, try it later."

Using opencv with android studio

$
0
0
Hi openCV commutnity, I am trying to make android application using the opencv functionality for edge detection, i have all the functions ready with me in java which i have developed taking cue from [tutorialpoint opencv](https://www.tutorialspoint.com/opencv/). It works fine in my desktop taking about 0.5 seconds to find edge in an image, when i integrate this with android it takes about 10 seconds and gives inaccurate results. Then i see the samples provided by opencv android sdk which also uses java but that is completely different from what i learnt from tutorialpoint.The samples work fine, meaning that it is my code which is bad and i think i need to do the work the same way as the samples show, can anyone please tell me whats the difference between both the codes.

Adding a QR Code to an image?

$
0
0
Hi all, I've got an inspection project that I'm working on. Here's what I'd like to do. (maybe there's a better way to do this, feel free to let me know) 1. acquire the image from a camera. (Done) 2. Inspect the image for for a PASS/FAIL condition. (Done) 3. Create a QR Code containing Image date, filename, and inspection result. (Done) 4. Add the QR Code in the upper left of the image acquired by the camera... (Can't figure that one out) I'm using the Python qrcode module to create the qr code. I can save the qrcode to .png and then imread it with Opencv and do it that way, but I'd like to avoid unnecessarily writing to disk. I should add that the reason I am doing this is so that I can later run a python script that will read these QR Codes. For example, sorting the image files by PASS/FAIL result. If there's a more elegant way to add this data to the image (custom meta-data?) I'm totally open to try it. Any suggestions? import cv2 import qrcode import numpy import scipy.misc image = cv2.imread('0000001.bmp' ) # This is where I would be acquiring image from camera qr = qrcode.QRCode( version=1, error_correction=qrcode.constants.ERROR_CORRECT_L, box_size=10, border=4, ) # These strings will be written by the inspection process i_result = 'Failed' i_timestamp = 'This time yall' i_filename = '00001.bmp' # Add the strings to the QR Code qr.add_data(i_result) qr.add_data(i_timestamp) qr.add_data(i_filename) # Make the QR Code qrcode = qr.make_image(fill_color="black", back_color="white") # How to make the QR code an OpenCV object???

Image transform/warping for ellipsoidal reflector

$
0
0
Hello, I am working with an augmented reality headset ([Leap Motion's Project North Star](http://blog.leapmotion.com/bending-reality-north-stars-calibration-system/)). I would like to be able to display input from cameras etc mounted on the headset with the correct transform to the users perspective. Currently, this would be done through unity using a mesh renderer, but I would like to bypass this for a standalone application. I think the required tasks would be something along 1. Perspective transform from sensor location to user view point 2. Transform from user view point to display using image warp for ellipsoidal reflector model. I have CAD models for the reflectors and complete headset to determine measurements, I'm just unsure how to obtain the image warp from due to the reflector. Could I use a camera to capture a known image on the reflector and use opencv to compute the transform?

How to build OpenCV 4.1.0 on Ubuntu 18.10

$
0
0
Any chance someone has a tutorial newer than the nine year old instructions on Ubuntu 10.0 here: https://docs.opencv.org/4.1.0/d7/d9f/tutorial_linux_install.html I've been attempting to build from source, and while I'm close, there are still some problems I don't know how to solve. For example, once built and installed, I end up with the include files installed in the directory `/usr/include/opencv4/opencv2/...` which obviously is not correct. This is how I've been attempting to build on Ubuntu 18.10: unzip opencv-4.1.0.zip unzip opencv_contrib-4.1.0.zip cd opencv-4.1.0 mkdir build cd build cmake \ -DCPACK_BINARY_DEB=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DOPENCV_GENERATE_PKGCONFIG=ON \ -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.1.0/modules \ -DEXTRA_MODULES_VCSVERSION=4.1.0 \ -DOPENCV_VCSVERSION=4.1.0 \ -DWITH_TBB=ON \ -DWITH_IPP=ON \ -DWITH_CUDA=OFF \ -DWITH_OPENCL=ON \ -DWITH_LIBV4L=ON \ -DWITH_OPENMP=ON \ -DWITH_NVCUVID=OFF \ -DWITH_CSTRIPES=ON \ -DWITH_GSTREAMER=ON \ -DBUILD_opencv_python2=ON \ -DBUILD_opencv_python3=ON \ -DBUILD_PERF_TESTS=OFF \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TESTS=OFF \ -DBUILD_DOCS=ON \ .. make -j16 sudo make install cpack -G DEB sudo make uninstall sudo dpkg -i OpenCV-4.1.0-x86_64-*.deb

putText is displaying text in wrong color

$
0
0
Hello, I am trying to use putText to place text on my webcam video stream. I was able to have the text displayed on the window, but the color is displayed wrong. From my understanding, color is expressed in BGR in OpenCV, hence I expect (255,0,0) should display Blue; (0,255,0) should display Green; (0,0,255) should display Red. In my code, I tried 3 colors as: namedWindow("Live", WINDOW_NORMAL); resizeWindow("Live", 640, 480); putText(frame, "Press 'C' to start calibration", Point(10, 20), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 0, 255)**, 2); putText(frame, "Press 'Q' to quit", Point(10, 40), FONT_HERSHEY_SIMPLEX, 0.6, **(0, 255, 0)**, 2); putText(frame, to_string(num_img) + " Chessboards are detected ", Point(10, 60), FONT_HERSHEY_SIMPLEX, 0.5, **(255, 0, 0)**, 2); imshow("Live", frame); I was expecting the 3 lines of text to be Red, Green, and Blue. But the result is displayed as Blue Black Black![image description](/upfiles/15590828643563371.png) I wonder where did I do wrong. Thanks in advance.

Detect when the imshow window is closed using X by user

$
0
0
I would like to know if the user has closed the imshow window using on `x` on the right top corner on the window **Simple Code** name simplegui.py import cv2 import numpy as np freash_image = np.ones((480,640),np.uint8) cv2.imshow('image',freash_image) cv2.waitKey(0) cv2.destroyAllWindows() On clicking `x` of imshow window the python code doesn't stop as seen in the screens shot ![image description](/upfiles/15590879787477246.png) ![image description](/upfiles/15590877508047176.png) I would like to python code to stop as soon as user closes the imshow using `x` on the right top corner of the window Anyone help would be helpful. Thank you for your time.

Detect when the imshow window is closed using X by user

$
0
0
I would like to know if the user has closed the imshow window using on `x` on the right top corner on the window **Simple Code** name simplegui.py import cv2 import numpy as np fresh_image = np.ones((480,640),np.uint8) cv2.imshow('image',fresh_image) cv2.waitKey(0) cv2.destroyAllWindows() On clicking `x` of imshow window the python code doesn't stop as seen in the screens shot ![image description](/upfiles/15590879787477246.png) ![image description](/upfiles/15590877508047176.png) I would like to python code to stop as soon as user closes the imshow using `x` on the right top corner of the window Anyone help would be helpful. Thank you for your time.

Trouble installing to MSYS2 on Windows 10

$
0
0
I'm having problems with OpenCV with MSYS2 on Windows 10 x64 and Python 3.7. I can get OpenCV to install, but when I run a simple test script, it throws an exception. $ python3 C:\\msys64\\home\\gpraceman\\gtk_test.py C:/msys64/mingw64/lib/python3.7\importlib\_bootstrap.py:219: Warning: Numpy built with MINGW-W64 on Windows 64 bits is experimental, and only available for testing. You are advised not to use it for production. CRASHES ARE TO BE EXPECTED - PLEASE REPORT THEM TO NUMPY DEVELOPERS return f(*args, **kwds) Traceback (most recent call last): File "C:\msys64\home\gpraceman\gtk_test.py", line 1, in import cv2 File "C:/msys64/mingw64/lib\cv2\__init__.py", line 89, in bootstrap() File "C:/msys64/mingw64/lib\cv2\__init__.py", line 79, in bootstrap import cv2 ImportError: DLL load failed: The specified module could not be found. Below is how I installed OpenCV, which installs version 4.0.1. I also tried with PIP, but it wouldn't install at all (Could not find a version that satisfies the requirement opencv-python). pacman -S mingw-w64-x86_64-opencv I found the cv2 folder and OpenCV DLLs under C:\msys64\mingw64\lib. I did add that location to my Windows path. I also tried setting up Anaconda and was able to get OpenCV to work, however, I could not get Gtk3+ to install and that is a requirement for my project. Gtk3+ works on MSYS2. I even tried copying the cv2 and opencv_python folders from site-packages on Anaconda over to MSYS2 but no joy. If I copied over the Gtk3+ files to Anaconda no joy again. So, I cannot get either environment to fully work for my project. EDIT: I've also tried setting up a Python 3.7 x86 environment and get the same error. Here's the output with debug turned on: >>> import cv2 OpenCV loader: os.name="nt" platform.system()="Windows" OpenCV loader: loading config: C:/msys64/mingw32/lib/cv2/config.py OpenCV loader: loading config: C:/msys64/mingw32/lib/cv2/config-3.7.py OpenCV loader: PYTHON_EXTENSIONS_PATHS=['C:/msys64/mingw32/lib/cv2/python-3.7'] OpenCV loader: BINARIES_PATHS=['C:/msys64/mingw32/lib/cv2/../../bin'] OpenCV loader: PATH=C:/msys64/mingw32/lib/cv2/../../bin;C:\msys64\mingw32\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\msys64\usr\bin\site_perl;C:\msys64\usr\bin\vendor_perl;C:\msys64\usr\bin\core_perl;C:\msys64\mingw32\bin\ OpenCV loader: replacing cv2 module Traceback (most recent call last): File "", line 1, in File "C:/msys64/mingw32/lib\cv2\__init__.py", line 90, in bootstrap() File "C:/msys64/mingw32/lib\cv2\__init__.py", line 80, in bootstrap import cv2 ImportError: DLL load failed: The specified module could not be found.

How can I use CNN for algae cell counting?

$
0
0
HI! I'm planning to use image processing through CNN to count the cells of algae, the cells are a straight line, it looks like a hair strand, can you guys help how can I use CNN to count cells that look like hair strand? TIA!!! (attached is the actual image of cells seen from the microscope) [image description](/upfiles/15588702011200559.jpg)

i try to track white pixel in a image, when the pixel moves,it merge with non moving white pixels.. how can i seperate moving and non moving pixel in a image using opencv c++

HOW TO SOLVE THIS ERROR IN A CODE

$
0
0
import numpy as np import matplotlib.pyplot as plt import cv2 img = cv2.imread("foot.jpeg") blur = cv2.blur(img,(5,10)) rows,cols,ch = img.shape point=[[170,270],[480,220],[240, 710],[540,650]] pts1 = np.float32(point) pts2 = np.float32([[0,0],[210,0],[0,297],[210,297]]) M = cv2.getPerspectiveTransform(pts1,pts2) dst = cv2.warpPerspective(img,M,(210,297)) plt.subplot(121),plt.imshow(img),plt.title('Input') plt.plot(*zip(*point), marker='.', color='r', ls='') plt.subplot(122),plt.imshow(dst),plt.title('Output') plt.show() THIS IS MY CODE I WANT TO MAKE A PROGRAM CHECKING MY FOOT-SIZE URL: http://cocoding94.blogspot.com/2017/05/blog-post_7.html I USE RASPBERRY PI this is a error : Traceback (most recent call last): File "foot.py",line 7,in blur = cv2. blur (img,(5,10)) cv2.error:OpenCV(3.4.3) /home/pi/opencv/opencv-3.4.3/modules/core/src/matrix.cpp:756: error: (-215:Assertion failed) dims <=2 && step[0] > 0 in function 'locateROI' Thanks

findCirclesGrid troubles

$
0
0
Dear all, I have problems with the function findCirclesGrid(). I took pictures of a grid of points from various positions, but for some pictures, it doesn't find the grid (return false). I use a blob detector with custom parameters and the blobs are correctly detected (blue circles). The code I use: img = cv2.imread(fname) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) gray = ~gray # Define blob detector params = cv2.SimpleBlobDetector_Params() params.filterByArea = True params.filterByCircularity = True params.filterByConvexity = False params.filterByInertia = True params.filterByColor = False params.minArea = 200 params.maxArea = 8000 params.minCircularity = 0.3 params.minInertiaRatio = 0.01 params.minRepeatability = 6 params.minDistBetweenBlobs = 1 detector = cv2.SimpleBlobDetector_create(params) keyPoints = detector.detect(gray) for i in range(len(keyPoints)): keypoint = keyPoints[i] x = int(keypoint.pt[0]) y = int(keypoint.pt[1]) s = keypoint.size r = int(math.floor(s / 2)) cv2.circle(img, (x, y), r, (256, 200, 0), 3) ret, corners = cv2.findCirclesGrid(gray, (2, 7), flags=(cv2.CALIB_CB_ASYMMETRIC_GRID + cv2.CALIB_CB_CLUSTERING), blobDetector=detector) Picture of the grid: ![image description](/upfiles/1559121861740941.jpg) Same picture, with blobs detected but grid not found: ![image description](/upfiles/15591221191212116.jpg) Another image, grid detected: ![image description](/upfiles/15591224659064608.jpg) I use OpenCV 4.0 Any suggestions? Thanks!

OpenCV wasm not building

$
0
0
Hi guys, I've been trying to build a piece of code in webassembly that would use OpenCV. I took https://github.com/mpizenberg/emscripten-opencv to start building, this worked well, but when I try adding cv::resize to be able to resize an image, that's when I have some issues: make[1]: Entering directory '/code/build' make[2]: Entering directory '/code/build' make[3]: Entering directory '/code/build' Scanning dependencies of target hello make[3]: Leaving directory '/code/build' make[3]: Entering directory '/code/build' [ 50%] Building CXX object CMakeFiles/hello.dir/source/main.cpp.o [100%] Linking CXX executable hello.js error: undefined symbol: _Z7cvFloorRKN2cv10softdoubleE warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0` error: undefined symbol: _Z7cvRoundRKN2cv10softdoubleE error: undefined symbol: _Z9cvRound64RKN2cv10softdoubleE error: undefined symbol: _ZN2cv10softdoubleC1Ei error: undefined symbol: _ZN2cv10softdoubleC1Ex error: undefined symbol: _ZNK2cv10softdoubledvERKS0_ error: undefined symbol: _ZNK2cv10softdoublemiERKS0_ error: undefined symbol: _ZNK2cv10softdoublemlERKS0_ error: undefined symbol: _ZNK2cv10softdoubleplERKS0_ Error: Aborting compilation due to previous errors shared:ERROR: '/emsdk_portable/node/bin/node /emsdk_portable/sdk/src/compiler.js /tmp/tmpS6bxjF.txt /emsdk_portable/sdk/src/embind/emval.js /emsdk_portable/sdk/src/embind/embind.js /emsdk_portable/sdk/src/library_pthread_stub.js' failed (1) CMakeFiles/hello.dir/build.make:95: recipe for target 'hello.js' failed make[3]: *** [hello.js] Error 1 make[3]: Leaving directory '/code/build' CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/hello.dir/all' failed make[2]: *** [CMakeFiles/hello.dir/all] Error 2 make[2]: Leaving directory '/code/build' Makefile:83: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/code/build' Makefile:5: recipe for target 'build' failed make: *** [build] Error 2 The command '/bin/sh -c make build' returned a non-zero code: 2 make: *** [all] Error 2 I tried wrapping up my problem here https://github.com/jdrouet/opencv-wasm, you can pull it and run make, it'll build with docker. Do you have any idea of how I could fix my issue?

opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:934: error: ‘struct AVFrame’ has no member named ‘pkt_pts’

$
0
0
I'm installing opencv-3.2.0 on ubuntu10.04, and I must use VideoCapture to access an IP camera.And This is the error: [ 33%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o In file included from /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg.cpp:47: /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::grabFrame()’: /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:934: error: ‘struct AVFrame’ has no member named ‘pkt_pts’ /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:934: error: ‘struct AVFrame’ has no member named ‘pkt_pts’ /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:934: error: ‘struct AVFrame’ has no member named ‘pkt_pts’ /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:934: error: ‘struct AVFrame’ has no member named ‘pkt_dts’ In file included from /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg.cpp:47: /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::retrieveFrame(int, unsigned char**, int*, int*, int*, int*)’: /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:999: error: ‘avcodec_align_dimensions2’ was not declared in this scope /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVFrame* icv_alloc_picture_FFMPEG(int, int, int, bool)’: /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1389: error: ‘struct AVFrame’ has no member named ‘format’ /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1390: error: ‘struct AVFrame’ has no member named ‘width’ /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1391: error: ‘struct AVFrame’ has no member named ‘height’ /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void CvVideoWriter_FFMPEG::close()’: /root/opencv3.2/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1803: error: ‘avformat_free_context’ was not declared in this scope make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1 make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: *** [all] Error 2 part of the cmake_build is that: -- General configuration for OpenCV 3.2.0 ===================================== -- Version control: unknown -- -- Platform: -- Timestamp: 2019-05-27T13:59:25Z -- Host: Linux 2.6.32-21-generic i686 -- CMake: 3.6.3 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make -- Configuration: Release -- -- C/C++: -- Built as dynamic libs?: YES -- C++ Compiler: /usr/bin/c++ (ver 4.4.3) -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-comment -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-comment -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG -- C Compiler: /usr/bin/cc -- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-comment -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -O2 -DNDEBUG -DNDEBUG -- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-comment -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release): -- Linker flags (Debug): -- ccache: NO -- Precompiled headers: YES -- Extra dependencies: /usr/lib/libpng.so /usr/lib/libz.so /usr/lib/libtiff.so /usr/lib/libjasper.so /usr/lib/libjpeg.so gtk-x11-2.0 gdk-x11-2.0 atk-1.0 gio-2.0 pangoft2-1.0 gdk_pixbuf-2.0 pangocairo-1.0 cairo pango-1.0 freetype fontconfig gobject-2.0 gmodule-2.0 gthread-2.0 glib-2.0 gstbase-0.10 gstreamer-0.10 xml2 gstvideo-0.10 gstapp-0.10 gstriff-0.10 gstpbutils-0.10 dc1394 avcodec avformat avutil swscale dl m pthread rt -- 3rdparty dependencies: libwebp IlmImf -- -- OpenCV modules: -- To be built: core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab -- Disabled: python2 world -- Disabled by dependency: - -- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz -- -- GUI: -- QT: NO -- GTK+ 2.x: YES (ver 2.20.1) -- GThread : YES (ver 2.24.1) -- GtkGlExt: NO -- OpenGL support: NO -- VTK support: NO -- -- Media I/O: -- ZLib: /usr/lib/libz.so (ver 1.2.3.3) -- JPEG: /usr/lib/libjpeg.so (ver 62) -- WEBP: build (ver 0.3.1) -- PNG: /usr/lib/libpng.so (ver 1.2.42) -- TIFF: /usr/lib/libtiff.so (ver 42 - 3.9.2) -- JPEG 2000: /usr/lib/libjasper.so (ver 1.900.1) -- OpenEXR: build (ver 1.7.1) -- GDAL: NO -- GDCM: NO -- -- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: YES (ver 2.1.2) **-- **FFMPEG: YES -- avcodec: YES (ver 52.20.1) -- avformat: YES (ver 52.31.0) -- avutil: YES (ver 49.15.0) -- swscale: YES (ver 0.7.1) -- avresample: NO -- GStreamer: -- base: YES (ver 0.10.28) -- video: YES (ver 0.10.28) -- app: YES (ver 0.10.28) -- riff: YES (ver 0.10.28) -- pbutils: YES (ver 0.10.28)**** -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- OpenNI2: NO -- PvAPI: NO -- GigEVisionSDK: NO -- Aravis SDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: YES/YES -- XIMEA: NO -- Xine: NO -- gPhoto2: NO -- -- Parallel framework: pthreads -- -- Other third-party libraries: -- Use IPP: IPP not found or implicitly disabled -- Use IPP Async: NO -- Use VA: NO -- Use Intel VA-API/OpenCL: NO -- Use Lapack: NO -- Use Eigen: NO -- Use Cuda: NO -- Use OpenCL: NO -- Use OpenVX: NO -- Use custom HAL: NO -- -- Python 2: -- Interpreter: /usr/bin/python2 (ver 2.6.5) -- -- Python 3: -- Interpreter: NO -- -- Python (for build): /usr/bin/python2 -- -- Java: -- ant: NO -- JNI: NO -- Java wrappers: NO -- Java tests: NO -- -- Matlab: Matlab not found or implicitly disabled -- -- Documentation: -- Doxygen: NO -- -- Tests and samples: -- Tests: YES -- Performance tests: YES -- C/C++ Examples: NO -- -- Install path: /usr/local -- -- cvconfig.h is in: /root/opencv3.2/opencv-3.2.0/build -- ----------------------------------------------------------------- -- -- Configuring done -- Generating done -- Build files have been written to: /root/opencv3.2/opencv-3.2.0/build Any help thanks a lot.

OpencV compilation fails with include error

$
0
0
Hi All, I am building OpenCV3.4 on Jetson Nano $ uname -a Linux paralaxiom-jetson 4.9.140-tegra #1 SMP PREEMPT Wed Mar 13 00:32:22 PDT 2019 aarch64 aarch64 aarch64 GNU/Linux I have followed the steps as indicated here > https://raw.githubusercontent.com/spmallick/learnopencv/master/InstallScripts/installOpenCV-3-on-Ubuntu-18-04.sh with some very minor changes in python only. I have also installed libeigen3-dev and the files are all in right location, as indicated below: $ pkg-config --cflags opencv eigen3 -I/usr/local/include/opencv -I/usr/local/include -I/usr/include/eigen3 At the time of compilation, there is an error and the compilation terminates. In file included from /home/p/kshitij/opencv/modules/core/test/test_precomp.hpp:12:0, from /home/p/kshitij/opencv/build/modules/core/opencv_test_core_pch_dephelp.cxx:1: /home/p/kshitij/opencv/modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory # include ^~~~~~~~~~~~ compilation terminated. modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/build.make:62: recipe for target 'modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o' failed make[2]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o] Error 1 CMakeFiles/Makefile2:2627: recipe for target 'modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all' failed make[1]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all] Error 2 Requesting help from the members of the forum. Thanks, kshitij

Error when build traincascade application

$
0
0
I have used Cmake to generate all source OpenCV. And build some project in applications. Some project such as: opencv_annotation, opencv_createsamples, opencv_visualisation, ... I have build success. **But** only project **opencv_trancascade** failure. I do not edit anything in source code, I meet many syntax error. For example syntax error: identifier 'CvFileStorage' in old_ml.hpp file See at image below. How can I solve this problem?![image description](/upfiles/15591388001744284.jpg) Best regard, Tung

understanding cv2.calibrateCamera in python

$
0
0
Hi All im fairly new to opencv and decided to use it in python. To make it easy as possible. My overall objective is to use a 3d camera to triangulate the 3d position of an object. The camera i bought is two cameras mounted together so I know their orientation will be parallel and that they are 60mm apart im trying to follow https://answers.opencv.org/question/117141/triangulate-3d-points-from-a-stereo-camera-and-chessboard/ so.. first im using https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html to get ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objectPointsArray, imgPointsArray, gray.shape[::-1], None, None) using a chessboard now 1. Im confused about how this calibration works and whats returned? should i be moving the chess board in all dimensions while the camera is still? or just in the x ,y axis while z remains constant? or should i keep the camera and the board still? 2. of ret, mtx, dist, rvecs, tvecs which are returned is mtx == camera matrix i.e. focal lengths and optical centres? how could it know this if it didnt know the z values of the chessboard is dist == distortion coefficients i.e. a matrix describing the fish eye effect of the camera is rvecs == the rotation of the camera? should this be zero if the camera is still and mounted parallel to the ground is tvecs == the location of the camera? i don't understand how it could know this from looking at a chessboard, whic could be anywhere? ant help would greatly appreciated

Error Linking static libraries

$
0
0
Hi, I built opencv from source and I'm trying to make a dll that uses some of the opencv .lib. In visual studio I set the additional directory and dependencies as follows (.lib files are in that folder): [...]\lib;%(AdditionalLibraryDirectories)**opencv_core410.lib;opencv_imgcodecs410.lib;opencv_imgproc410.lib;**%(AdditionalDependencies) When I build it I get these errors: 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "class cv::debug_build_guard::_InputOutputArray const & __cdecl cv::noArray(void)" (?noArray@cv@@YAAEBV_InputOutputArray@debug_build_guard@1@XZ) referenced in function [...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::copyTo(class cv::debug_build_guard::_OutputArray const &)const " (?copyTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@@Z) referenced in function [...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::convertTo(class cv::debug_build_guard::_OutputArray const &,int,double,double)const " (?convertTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@HNN@Z) referenced in function[...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::bitwise_not(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_InputArray const &)" (?bitwise_not@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@0@Z) referenced in function "[...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "bool __cdecl cv::imwrite(class std::basic_string,class std::allocator> const &,class cv::debug_build_guard::_InputArray const &,class std::vector> const &)" (?imwrite@cv@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@AEBV?$vector@HV?$allocator@H@std@@@3@@Z) referenced in function [...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "bool __cdecl cv::imencode(class std::basic_string,class std::allocator> const &,class cv::debug_build_guard::_InputArray const &,class std::vector>&,class std::vector> const &)" (?imencode@cv@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@AEAV?$vector@EV?$allocator@E@std@@@3@AEBV?$vector@HV?$allocator@H@std@@@3@@Z) referenced in function [...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::GaussianBlur(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::Size_,double,double,int)" (?GaussianBlur@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@V?$Size_@H@1@NNH@Z) referenced in function [...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::warpAffine(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::Size_,int,int,class cv::Scalar_ const &)" (?warpAffine@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@0V?$Size_@H@1@HHAEBV?$Scalar_@N@1@@Z) referenced in function [...] 1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::cvtColor(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,int,int)" (?cvtColor@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@HH@Z) referenced in function [...] Am I missing a dependency? Any help is appreciated!

I have trouble in finding the circular grid using the function cv.findCirclesGrid

$
0
0
My link to image is https://drive.google.com/open?id=1Leg6tffN9DJZ-TJJgwoaa-StJktp2x05. My code is ++++++++++++++++++++++++++++++++ I=imread('Pattern4.png'); obj = cv.SimpleBlobDetector('MinThreshold',10,'MaxThreshold',255,'ThresholdStep',10,'FilterByColor',true,'BlobColor',255); keypoints = obj.detect(I2); im_with_keypoints = cv.drawKeypoints(I2, keypoints,'DrawRichKeypoints',true); im_with_keypoints_gray = cv.cvtColor(im_with_keypoints,'RGB2GRAY'); imshow(im_with_keypoints) [ret,corners] = cv.findCirclesGrid(im_with_keypoints,[2,2]); +++++++++++++++++++++++++++++ Please tell me why i cannot detect the circular grid?
Viewing all 41027 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>