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

TypeError: only size -1 arrays can be converted to python scalar

$
0
0
i am facing this error and am new to python. not sure how am not supposed to enter a matrix as the input ( image) this is the code : import cv2 import matplotlib.pyplot as plt image = cv2.imread('sample.jpg') def show_rgb_hist(image): colours = ('r','g','b') for i, c in enumerate(colours): plt.figure(figsize=(20, 4)) histr = cv2.calcHist([image], [i], None, [256], [0, 256]) if c == 'r': colours = [((i/256, 0, 0)) for i in range(0, 256)] if c == 'g': colours = [((0, i/256, 0)) for i in range(0, 256)] if c == 'b': colours = [((0, 0, i/256)) for i in range(0, 256)] plt.bar(range(0, 256), histr, color=colours, edgecolor=colours, width=1) plt.show() x=show_rgb_hist(image) cv2.imshow('img', x)

where is the position in aruco_ros marker detector

$
0
0
Using aruco_ros libray,I can detect and recognize a aruco marker with a specific marker ID. Further more,I can get the pose information including position and orientation. **So,I want to ask where is the position pointing at? The left corner or the center of the marker?** ![image description](/upfiles/15963451342790084.jpg)

Coordinate frame transformation from NED to OpenCV convention, and the Pinhole Camera Model

$
0
0
Hello, I'm working on an SFM module where I have camera coordinates wrt a world coordinate system (in NED). I have the calibrated camera intrinsics matrix, and with the R,T of the camera wrt world, I compute the Projection matrix (intrinscs matrix * R|T) for each image, and camera position. However, I'm not sure if this Projection matrix is right since the R|T is in NED, and openCV uses a different convention.I'm trying to use the CV::SFM::triangulatePoints, but I'm not getting consistent results. How will this affect the projection matrix, and is the conversion of the poses to the OpenCV frame necessary?

deblur image in java,what is the value of snr?

$
0
0
![image description](/upfiles/15935053292924093.png) According to the out-of-focus deblue filter on your official website that I was written in java. I have tried many times of values for SNR but still not get the clear picture.Pls find attached pic with i processed. Would you kindly help me how to improved it ? [image description](/upfiles/1593505484410358.jpg)

How to have the camera 'desynchronized' with Illumination changes?

$
0
0
For my current project, I have to record a video stream from a USB camera connected to Raspberry-Pi. While recording the videos if there are any illumination changes the camera should not synchronize it's preview/recording to the light change. Instead it should only record what it sees without any changes from camera input(for ex: exposure, contrast or brightness). I tried making changes in FFMPEG config and reinstalled it but it doesn't seem to work. I turned off auto_exposure with opencv but that wasn't useful either. I am using OpenCV for recording the videos later from which face recognition and skin-type classification will be done. So it is important that the Face color is not altered by the camera automatically with external illumination change. Can someone please help me with this? Thanks.

Rectified Images Show unwanted results, OpenCV with Stereo Vision

$
0
0
I am having trouble when trying to create depth map using OpenCV on Python. The problem is that the rectified images appears to be wrapped, or distorted. Here is the code. https://pastebin.com/embed_js/1DHpCPgv Long story short, the code performs a series of program begin with: Reading image file captured from two cameras Calibrate each cameras separately Using instrict matrices and distortion values to be parameters when i call StereoCalibrate() The images folders I used contains 68 different images for each camera (136 in total). The results from calibrateCamera() are 0.77 and 0.94 for each cameras. The retVal I collected from StereoCalibrate() was huge, 39.0. So I guessed there is problem in the codes. The images of camera frame captured before and after rectification are shown here: original image rectified image ![Original](https://i.stack.imgur.com/QN85U.jpg) ![Rectified Image](https://i.stack.imgur.com/nXonn.png) Now, I truly frustrated as I don't know what I have done wrong? I also tried to search this problem in Google but it's seem that the solution is to calibrate cameras more to get better instrict matrices and distortions values. Personally, I don't believe this is the core issues and think that I did choose wrong parameters for method instead. What do you think? Please gives me some advices ... ~

Problem in ORB feature matching

$
0
0
Hi I am not able to do feature matching with the below images. Please help me. ![image description](/upfiles/159646643542791.png) ![image description](/upfiles/15964664532531367.png) Regards, Prabhakar M

Specify CUDA stream for DNN evaluation

$
0
0
I have a CUDA-accelerated pipeline for processing an image. At the end of the pipeline I have to download the processed image from the GPU, then use the `cv.dnn.blobFromImage` API and send it back to the CUDA DNN backend. Can I connect these so that the image never leaves the GPU? Can I specify that it use the same stream?

cv2.error: assertion failed imshow

$
0
0
hey all, I've been struggling for weeks on numerous forums trying to understand what I'm still guessing requires only a simple fix. I'm using python in ubuntu through a terminal. I've installed the opencv package without any issue. I've been following along with an online tutorial and the first example has me downloading a zip file from a repo on github. I extracted the zip and then have tried to simply read and display the image through inputting various commands within my cmd line. This is what I get: "img = cv2.imread('lena.jpg', 0) print(img) None" then I get this: "Traceback (most recent call last): File "", line 1, in cv2.error: OpenCV(4.2.0) ../modules/highgui/src/window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'" Any ideas as to how I can troubleshoot this? Additionally I should also mention I tried using os.path.isfile and it returned "False" for the file in question. I also downloaded a random image from a google search and the same errors resulted. Is there another step that I haven't been shown that is required of me to setup how and where files/images are sent? I'm a newb to linux. Thanks for your help!

How to generate libopencv_javaxxx.so files instead of dylibs on a mac?

$
0
0
I am using opencv in my java app. I was able to build opencv native libs using `-DCMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_java=ON` but it ended up generating .dylibs on my mac. That works great locally but doesn't work in production. The prod system is looking for a `.so` instead I tried turning shared libs off `-DBUILD_SHARED_LIBS=OFF` but that doesn't seem to generate a .so Renaming .dylib to .so doesn't work. Anyone know how I can generate a .so instead? Would using docker linux image to build opencv instead of my mac generate `.so` instead?

white angle and black angle in chessboard

$
0
0
Hi, I am reading the source code about two classes: Chessboard and Chessboard::Board. I am confusing about the white_angle and black_angle in the Board class. I would like to know the details of these two classes and can anybody point me to some related references? Thanks a lot. YL

How to detect a color and then draw a line on it?

$
0
0
I need to detect pink line on a image and then draw a line on it. Can someone help? (I am using Python 3)

Memory leak in RGB2Lab

$
0
0
There is a memory leak when using RBG2Lab. Is this an issue with OpenCV? The version is 3.4.11. // lab.cpp #include int main() { cv::Mat in = cv::Mat::zeros(1, 1, CV_8UC3); cv::Mat lab; cv::cvtColor(in, lab, CV_RGB2Lab); } Compile: g++ \`pkg-config --libs --cflags opencv\` lab.cpp Run: valgrind --leak-check=full a.out Output: ==2689== Memcheck, a memory error detector ==2689== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==2689== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info ==2689== Command: lab ==2689== ==2689== ==2689== HEAP SUMMARY: ==2689== in use at exit: 4,716,918 bytes in 321 blocks ==2689== total heap usage: 5,506 allocs, 5,185 frees, 5,396,766 bytes allocated ==2689== ==2689== 16,456 bytes in 1 blocks are possibly lost in loss record 101 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x76678CE: allocSingleton (private.hpp:153) ==2689== by 0x76678CE: splineBuild(cv::softfloat const*, unsigned long) [clone .constprop.37] (color_lab.cpp:22) ==2689== by 0x7669300: cv::initLabTabs() (color_lab.cpp:1221) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 16,456 bytes in 1 blocks are possibly lost in loss record 102 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x76678CE: allocSingleton (private.hpp:153) ==2689== by 0x76678CE: splineBuild(cv::softfloat const*, unsigned long) [clone .constprop.37] (color_lab.cpp:22) ==2689== by 0x76695D4: cv::initLabTabs() (color_lab.cpp:1231) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 16,456 bytes in 1 blocks are possibly lost in loss record 103 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x76678CE: allocSingleton (private.hpp:153) ==2689== by 0x76678CE: splineBuild(cv::softfloat const*, unsigned long) [clone .constprop.37] (color_lab.cpp:22) ==2689== by 0x76695E5: cv::initLabTabs() (color_lab.cpp:1232) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 147,528 bytes in 1 blocks are possibly lost in loss record 104 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x7669DDD: allocSingleton (private.hpp:153) ==2689== by 0x7669DDD: initLUTforABXZ (color_lab.cpp:1062) ==2689== by 0x7669DDD: cv::initLabTabs() (color_lab.cpp:1285) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 262,216 bytes in 1 blocks are possibly lost in loss record 105 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x766A001: allocSingleton (private.hpp:153) ==2689== by 0x766A001: initLUTforLUV (color_lab.cpp:1028) ==2689== by 0x766A001: cv::initLabTabs() (color_lab.cpp:1293) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 262,216 bytes in 1 blocks are possibly lost in loss record 106 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x766A010: allocSingleton (private.hpp:153) ==2689== by 0x766A010: initLUTforLUV (color_lab.cpp:1029) ==2689== by 0x766A010: cv::initLabTabs() (color_lab.cpp:1293) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 524,360 bytes in 1 blocks are possibly lost in loss record 107 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x766A022: allocSingleton (private.hpp:153) ==2689== by 0x766A022: initLUTforLUV (color_lab.cpp:1030) ==2689== by 0x766A022: cv::initLabTabs() (color_lab.cpp:1293) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 1,725,048 bytes in 1 blocks are possibly lost in loss record 108 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x7668F04: allocSingleton (private.hpp:153) ==2689== by 0x7668F04: initLUTforLABLUVs16 (color_lab.cpp:1192) ==2689== by 0x7668F04: cv::initLabTabs() (color_lab.cpp:1300) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== 1,725,048 bytes in 1 blocks are possibly lost in loss record 109 of 109 ==2689== at 0x4A08178: malloc (vg_replace_malloc.c:298) ==2689== by 0x93164D0: cv::fastMalloc(unsigned long) (alloc.cpp:150) ==2689== by 0x7668F11: allocSingleton (private.hpp:153) ==2689== by 0x7668F11: initLUTforLABLUVs16 (color_lab.cpp:1193) ==2689== by 0x7668F11: cv::initLabTabs() (color_lab.cpp:1300) ==2689== by 0x7679DD4: RGB2Lab_b (color_lab.cpp:1547) ==2689== by 0x7679DD4: cv::hal::cvtBGRtoLab(unsigned char const*, unsigned long, unsigned char*, unsigned long, int, int, int, int, bool, bool, bool) (color_lab.cpp:4176) ==2689== by 0x767F4AC: cv::cvtColorBGR2Lab(cv::_InputArray const&, cv::_OutputArray const&, bool, bool) (color_lab.cpp:4668) ==2689== by 0x76DDE71: cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int) (color.cpp:270) ==2689== by 0x400B5C: main (in a.out) ==2689== ==2689== LEAK SUMMARY: ==2689== definitely lost: 0 bytes in 0 blocks ==2689== indirectly lost: 0 bytes in 0 blocks ==2689== possibly lost: 4,695,784 bytes in 9 blocks ==2689== still reachable: 0 bytes in 0 blocks ==2689== of which reachable via heuristic: ==2689== stdstring : 8,662 bytes in 135 blocks ==2689== suppressed: 21,134 bytes in 312 blocks ==2689== ==2689== For counts of detected and suppressed errors, rerun with: -v ==2689== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 4 from 4) The output of cv::getBuildInformation(): General configuration for OpenCV 3.4.11 ===================================== Version control: unknown Platform: Timestamp: 2020-07-29T07:23:02Z Host: Linux 2.6.32-754.10.1.el6.x86_64 x86_64 CMake: 2.8.12.2 CMake generator: Unix Makefiles CMake build tool: /opt/rh/devtoolset-6/root/usr/bin/gmake Configuration: Release CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX SSE4_1 (16 files): + SSSE3 SSE4_1 SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (6 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (30 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX512_SKX (7 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX C/C++: Built as dynamic libs?: YES C++11: YES C++ Compiler: /opt/rh/devtoolset-6/root/usr/bin/c++ (ver 6.3.1) 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 -Wuninitialized -Winit-self -Wno-psabi -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -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 -Wuninitialized -Winit-self -Wno-psabi -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG C Compiler: /opt/rh/devtoolset-6/root/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 -Wuninitialized -Winit-self -Wno-psabi -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -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 -Wuninitialized -Winit-self -Wno-psabi -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG Linker flags (Release): -Wl,--gc-sections -Wl,--as-needed Linker flags (Debug): -Wl,--gc-sections -Wl,--as-needed ccache: NO Precompiled headers: NO Extra dependencies: dl m pthread rt 3rdparty dependencies: OpenCV modules: To be built: calib3d core dnn features2d flann highgui imgcodecs imgproc ml objdetect photo python2 shape stitching superres ts video videoio videostab Disabled: java_bindings_generator world Disabled by dependency: - Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java js python3 viz Applications: tests perf_tests apps Documentation: doxygen Non-free algorithms: NO GUI: Media I/O: ZLib: /usr/lib64/libz.so (ver 1.2.3) JPEG: build-libjpeg-turbo (ver 2.0.5-62) PNG: build (ver 1.6.37) TIFF: build (ver 42 - 4.0.10) HDR: YES SUNRASTER: YES PXM: YES Video I/O: Parallel framework: pthreads Trace: YES (built-in) Other third-party libraries: Intel IPP: 2018.0.2 [2018.0.2] at: /opt/intel/compilers_and_libraries_2018.2.199/linux/ipp linked: static Intel IPP IW: sources (2020.0.0) at: /localhome/[user]/rpmbuild/BUILD/opencv-3.4.11/build/3rdparty/ippicv/ippicv_lnx/iw/ Lapack: NO Eigen: NO Custom HAL: NO Protobuf: build (3.5.1) OpenCL: YES (no extra features) Include path: /localhome/[user]/rpmbuild/BUILD/opencv-3.4.11/3rdparty/include/opencl/1.2 Link libraries: Dynamic load Python 2: Interpreter: /opt/python27/bin/python2.7 (ver 2.7.12) Libraries: /opt/python27/lib/libpython2.7.so (ver 2.7.12) numpy: /opt/python27/lib/python2.7/site-packages/numpy/core/include (ver 1.14.2) install path: lib/python2.7/site-packages/cv2/python-2.7 Python (for build): /opt/python27/bin/python2.7 Install to: /usr -----------------------------------------------------------------

TermCriteria in LogisticRegression

$
0
0
TermCriteria is not stored in the model file But, when using miniBatch, its member maxCount is used in a loop Mat LogisticRegressionImpl::mini_batch_gradient_descent(const Mat& _data, const Mat& _labels, const Mat& _init_theta) ... for(int i = 0;iparams.term_crit.maxCount;i++) (instead, the loop in batch_gradient_descent uses the variable >params.num_iters) isn't this an error?

AruCo improve tracking a single marker

$
0
0
I am trying to track an object in space. For the same, I have stuck an AruCo marker on the object. Due to the dimensions of the object, the marker is fairly small, with a size of 4.5cm x 4.5 cm. The camera is roughly about 50cm away from the marker on an average. Here is the issue that I am facing. When the marker is stationary, the markers are detected properly. However, during motion, the marker is not detected at all. I understand that motion blur may cause this issue, however that is definitely not the only factor. How can I improve the detection of marker under motion conditions. What values can I change in the ```DetectorParams()``` of the ```detectMarkers()``` of aruco. I have gone through the documentation where each parameter is explained, however I have not understood which parameters to change. Can I tune the parameters for this. Additionally, can I take advantage of the fact that I have to detect only 1 marker always? (I am already using a small dictionary) Thanks!

Drawing borders to any borderless tables using openCV

$
0
0
Hello Detect the space in consequent records in the table and draw the horizontal lines. Thanks, jaiswati

I’m using raspberry pi with python3. I don’t have the raspo camera. So how would make the videocapture(0) go to a web page? I have seen very complicated ways that I don’t understand yet. Are there basic ways to do this?

$
0
0
Raspberry pi 4 Python 3.7 ish Usb camera I’ve seen forums that have server client and very complicated code. I’m trying to teach my kids some robotics and basics and I just can’t find a solution. Thanks

Aruco markers - how to keep a constant object size

$
0
0
Hello all, I have a problem which I have been struggling on since last week and I would need some idea to solve it. I am currently programming a failure pattern recognition tool for an aerospace company, another version is already completed. The goal is to recognise the LED position and flashing frequencies on an avionics panel. I now try to detect the LED position on the panel no matter of the position of the camera. For this, I put an Aruco marker on the panel to detect the camera position. This is basically done with: # detect markers corners, ids, rejectedImgPoints = aruco.detectMarkers(frame, d) aruco.drawDetectedMarkers(frame, corners, ids) # use camera matrix to find markers locations rvecs, tvecs, _objPoints = aruco.estimatePoseSingleMarkers(corners, markers_size, mtx, dist) My camera has been calibrated with the chessboard method, giving mtx and dist. I also succeeded to compute a bird-eye view of the global image with pts = np.float32(rect.tolist()) dst_pts = np.float32(dst_pts.tolist()) M = cv2.getPerspectiveTransform(rect, dst_pts) warped = cv2.warpPerspective(frame, M, (3000, 3000)) I also tried point to point transform and it seems to work. Now, I would like to have a constant object size, in such a way that the panel and the Aruco marker stay with a constant size on the image, no matter of the displacement on the camera on the 3 axis (x,y,z). For the moment, as I know the exact size of my Aruco marker, I define an arbitrary number of pixel for the marker in this image and I resize the image on x and y with a different ratio at each frame to keep the Aruco marker with the same size. But, this method is not good as in the neighborhood of the image this rule is not true due to perspective. Do you have an idea of how it is possible to solve the problem? I think there is something to do with tvecs but I don't find how I can perform a resizement with a displacement on 3 dimensions. If you need further information, do not hesitate to ask me. I would be very happy if someone can help me a little bit. Thank you all! **EDIT** As asked, a quick scheme of the system (I am not allowed to show the real system) ![Quick scheme of the system](/upfiles/15965772625216918.png)

Can we use .raw image format directly in CV functions?

$
0
0
Hi, Normally CV functions converts .raw image files to .jpg /.png formats. Is there any way to directly use the .raw file format. Will it give a better result?

build opencv for ios failed

$
0
0
Hello, I am working on macos, I followed the instructions to build opencv for ios found here https://docs.opencv.org/2.4/doc/tutorials/introduction/ios_install/ios_install.html The build fails with the following error: ** BUILD FAILED ** The following build commands failed: Check dependencies (1 failure) ============================================================ ERROR: Command '['xcodebuild', 'BITCODE_GENERATION_MODE=bitcode', 'IPHONEOS_DEPLOYMENT_TARGET=8.0', 'ARCHS=armv7', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '4', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65 ============================================================ Traceback (most recent call last): File "opencv/platforms/ios/build_framework.py", line 137, in build self._build(outdir) File "opencv/platforms/ios/build_framework.py", line 123, in _build self.buildOne(t[0], t[1], mainBD, cmake_flags) File "opencv/platforms/ios/build_framework.py", line 256, in buildOne execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build") File "opencv/platforms/ios/build_framework.py", line 40, in execute retcode = check_call(cmd, cwd = cwd) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '['xcodebuild', 'BITCODE_GENERATION_MODE=bitcode', 'IPHONEOS_DEPLOYMENT_TARGET=8.0', 'ARCHS=armv7', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '4', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65 If I give that xcodebuild command manually from terminal with the arguments above, it does complain the syntax is wrong. I somehow doubt the syntax error is just a bug in the installer or there would be a lot more complaints, so I assume something's wrong on my side, but I can't think what. Any ideas? Thank you.
Viewing all 41027 articles
Browse latest View live


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