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

Rust detection

$
0
0
Hey guys so I am working on a project whereby I have to detect any form of rust on an object. Our professor ask us to use opencv. However, we have no knowledge on opencv so would anyone like to point us to the right direction on where to start?

Dynamic gesture recognition

$
0
0
Hi there ! As my Master thesis project I have to design a dynamic recognition system using OpenCV. Could you please give me some piece of advice how to realise such a system in a quite robust way. - ----This is done----- - So first of all I want to detect the hand using haar caascades. - Hand tracking region using Kalman Filter. - Hand Segmentation. - ----This is done----- - (Dynamic) Hand gesture recognition - this is my problem. How to do it ? Could I ask you to tell me how to realise this part. I've hard about HMM and neural networks. Are you able to give me some tutorials about this topic, maybe some pieces of code ? Generally plase give me some suggestions what is you impression about such a system. Thanks in advance.

TIOCL WARNING: Opening Linux shared memory

$
0
0
TIOCL FATAL: The TI Multicore Tools daemon (/usr/bin/ti-mctd) is not running. To start daemon, rm /dev/shm/HeapManager (if exists); ti-mctd. Re-run application. Refer User Guide for details.

ANDROID Open FFmpeg frames

$
0
0
Hello, I have used OpenCV in Android to display frames from the camera. Now, I can receive frames from an url, in Android with FFmpeg (thank to FFmpeg Android library): Can I display that frames using OpenCV? Thank You Very much!! Best Regards

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor,

$
0
0
I'm trying to run a code that does template matching. I'm getting assertion failed error on cvtColor function. Here is the error. OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/travis/miniconda/conda- bld/conda_1485299292920/work/opencv-3.2.0/modules/imgproc/src/color.cpp, line 9748 Traceback (most recent call last): File "opencv_basics.py", line 60, in img_gray = cv2.cvtColor(img_rgb,cv2.COLOR_BGR2GRAY) cv2.error: /home/travis/miniconda/conda-bld/conda_1485299292920/work/opencv- 3.2.0/modules/imgproc/src/color.cpp:9748: error: (-215) scn == 3 || scn == 4 in function cvtColor Here is the code I'm trying to run. import cv2 import numpy as np img_rgb = cv2.imread('template.jpg') img_gray = cv2.cvtColor(img_rgb,cv2.COLOR_BGR2GRAY) template = cv2.imread('opencv-template-for-matching.jpg',0) w, h = template.shape[::-1] res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED) threshold = 0.8 loc = np.where( res >= threshold) for pt in zip(*loc[::-1]): cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0,255,255), 2) cv2.imshow('Detected',img_rgb)

OpenCV 2.4.13 not compiling on Suse Linux 11 SP1 64 bit

$
0
0
I'm trying to compile, getting the following error. [ 52%] Generating opencl_kernels.cpp, opencl_kernels.hpp CMake Error at /root/itanyplace/opencv-2.4.13/cmake/cl2cpp.cmake:50 (string): string does not recognize sub-command MD5 make[2]: *** [modules/ocl/opencl_kernels.cpp] Error 1 make[1]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 52%] Built target opencv_ts [ 60%] Built target opencv_legacy make: *** [all] Error 2 It is failing to recognize the MD5 command as attached. Can you please help? [C:\fakepath\Screen Shot 2017-09-30 at 6.39.12 PM.png](/upfiles/15068148227294626.png)

Error en OpenCV 3.1.0 java/math/BigInteger modules/java/CMakeFiles/opencv_java.dir/build.make:12619:

$
0
0
[ 59%] Built target example_datasets_or_mnist make[2]: Warning: File 'modules/java/core+Algorithm.java' has modification time 134 s in the future [ 59%] Generating opencv-310.jar /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/rt.jar: inflateFully: Unexpected end o f stream BUILD FAILED java.lang.NoClassDefFoundError: java/math/BigInteger at org.apache.tools.ant.types.Resource.getMagicNumber(Resource.java:58) at org.apache.tools.ant.types.Resource.(Resource.java:48) at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav a:90) at org.apache.tools.ant.Main.runBuild(Main.java:826) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.lang.ClassNotFoundException: java.math.BigInteger at java.net.URLClassLoader$1.run(URLClassLoader.java:359) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 7 more Total time: 0 seconds java.lang.NoClassDefFoundError: java/math/BigInteger at org.apache.tools.ant.types.Resource.getMagicNumber(Resource.java:58) at org.apache.tools.ant.types.Resource.(Resource.java:48) at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav a:90) at org.apache.tools.ant.Main.runBuild(Main.java:826) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.lang.ClassNotFoundException: java.math.BigInteger at java.net.URLClassLoader$1.run(URLClassLoader.java:359) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 7 more java/math/BigInteger modules/java/CMakeFiles/opencv_java.dir/build.make:12619: recipe for target 'bin /opencv-310.jar' failed make[2]: *** [bin/opencv-310.jar] Error 1 CMakeFiles/Makefile2:14666: recipe for target 'modules/java/CMakeFiles/opencv_ja va.dir/all' failed make[1]: *** [modules/java/CMakeFiles/opencv_java.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2 Espero que me puedan ayudar, muchas gracias. Estaré atento a cualquier novedad ^_^ ![image description](http://)

Remove the floor noise from the mask.

$
0
0
Hi all, I am making the mask for background subtraction for depth data. i performed following thing to get the mask. 1) Apply the range on depth data. 2) Convert the image into the binary 3) Apply erosion and dilation operation on the mask. 4) Search the maximum contour. Still, I am getting some noise of the floor(refer output image). It will be great , if you suggest the way. I have attached input and output images. 1) Input ![image description](/upfiles/15069403961173375.png) 2) Output image. ![image description](/upfiles/15069404123593911.png)

How to properly convert Mat to Bitmap C++

$
0
0
Hello, I'm a student and I'm learning OpenCV (C++) and I'm having a weird question. I'm using OpenCV in C++/CLI and a C# Windows Form to show the output. This is my plan on how to do this: 1. Load Mat Image in C++ 2. 2. Convert Mat to Bitmap 3. Return the Bitmap from C++ to C# 4. 4. Show the Bitmap on Windows Form. Now I thought this was a good strategy but I got an error saying: 'Access Violation Exception'. So I tried to look for an answer but couldn't find it on the Web. I have all my projects in x64. The weird thing is that if I put 'imshow()' function in this method, I get a weird looking picture, but no errors. This is the .cpp file: Bitmap^ OpenCvWrapper::ApplyFilter() { Mat image = imread("C:/Users/Andries/Pictures/colored_squares.png"); returnImg = ConvertMatToBitmap(image) return returnImg; } Bitmap^ OpenCvWrapper::ConvertMatToBitmap(cv::Mat matToConvert) { imshow("Window", matToConvert); Bitmap^ test = gcnew Bitmap(matToConvert.rows, matToConvert.cols, 4 * matToConvert.rows, System::Drawing::Imaging::PixelFormat::Format4bppIndexed, IntPtr(matToConvert.data)); return test; } And this is my .cs file: public partial class Form1 : Form { private Bitmap f; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { OpencvDotNet.OpenCvWrapper obj = new OpencvDotNet.OpenCvWrapper(); f = obj.ApplyFilter(); pictureBox1.Image = f; } I can provide the header but I think that's not necessary as of now. Now with this code I get the following output: ![image description](/upfiles/1506943346205725.png) Please help. Andries

projectPoints() Wrong results??

$
0
0
Why is my code snippet giving me weird results for projected points? //Generate the one 3D Point which i want to project onto 2D plane vector points_3d; points_3d.push_back(Point3d(10, 10, 100)); Mat points3d = Mat(points_3d); //Generate the identity matrix and zero vector for rotation matrix and translation vector Mat rvec = (Mat_(3, 3) << (1, 0, 0, 0, 1, 0, 0, 0, 1)); Mat tvec = (Mat_(3, 1) << (0, 0, 0)); //Generate a camera intrinsic matrix Mat K = (Mat_(3,3) << (1000, 0, 50, 0, 1000, 50, 0, 0, 1)); //Project the 3D Point onto 2D plane Mat points_2d; projectPoints(points_3d, rvec, tvec, K, Mat(), points_2d); //Output cout << points_2d; I get as projected 2D Point points_2d = (-1.708699427820658e+024, -9.673395654445999e-026) If i calculate it on a paper on my own, i'm expecting a point points_2d = (150, 150) with that formula: ![image description](/upfiles/15069441372411866.png)

How do I follow the detected line and find more points connected to it?

$
0
0
So I have create a code to find the edge of a wall, through finding the intersect of the lines from the edges detected within a ROI. I have the coordinates of the lines in (x1,y1,x2,y2) form, for this case, I would have 3 lines from that point. [https://i.imgur.com/Vm0JWE4.png] What I would like to do, is follow the lines along the edges and find another intersection. How do I go about doing this search? I would like to do this with limited regions of interest, whereby I perform canny only on the initial ROI, and also run canny on a certain ROI around the line.

Opencv in android

$
0
0
Below is my jni source. Mat* diff; absdiff(*dilate, *gray, *diff); image = 255 - diff; And it's throw error invalid operands to binary expression ('int' and 'cv::Mat*') Can anyone help me resolve it.

Track ring pull Python

$
0
0
Hello, i want recognize ring pull and detect position angle... I think that is effective a haar cascade but i want ideas to do that in Python. ![image description](http://i.imgur.com/SNojsZ7.jpg) Only want detect ring pull. ![image description](http://i.imgur.com/lRnhxLT.png)

Stereo - Depth Range Calculation

$
0
0
How to know the depth range of the Stereo camera? **Camera Specifications** Baseline : 6 cm. FOV : 120°(D) Focal Length: 2.8 mm **Calibration procedure:** * Fisheye module of OpenCV3.1 to calibrate both the camera's individually. * Proceeded by Stereo Calibration. * Matching Algorithm Used: StereoBM **Observations:** * Depth Range - 30 cm to 100 cm. * The RMS error for the individual camera calibration and stereo calibration is less than 0.5. * The depth value in the range (30 cm - 100 cm) is pretty good, i.e i don't get much deviation in the depth. **Question:** Is this is the maximum range for the above specifications.

Is there any option to find the which part of the images are different from other?

$
0
0
I'm new to OpenCV, I want to develop the app that needs to find the which part of the images are different from other images. For example, I have 4 four images, in it small part of the images are different in all images in same co-ordinate. So we need to find the exact co-ordinate. Thanks in advance.

How to include and link Pylon library with OpenCV project

$
0
0
I am trying to access images from a Basler camera interfaced with a Jetson TX1. I am using `OpenCV-C++` along with `Pylon` library to do so. I am trying to link the `Pylon` using `cmake`. I have the following CMakeLists.txt file: cmake_minimum_required(VERSION 3.5.1) project(basler_test) set(CMAKE_CXX_STANDARD 14) #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl, -E") find_package(OpenCV REQUIRED) include_directories(/opt/pylon5/include) link_directories(/opt/pylon5/lib64) add_executable(basler_test basler_test.cpp) target_link_libraries(basler_test ${OpenCV_LIBS} /opt/pylon5/include/pylon/PylonIncludes.h) The `cmake .` command works fine but when I do `make`, it gives: `fatal error: pylon/Platform.h: No such file or directory compilation terminated` I checked for the above file and it does exist in the same directory as `PylonIncludes.h`. So, I believe this error is because something has not been set properly in the `CMakeLists.txt`. I don't have enough experience creating them to identify what's wrong. Kindly help. **Edit:** Here is the relevant part of the source file: `basler_test.cpp` //This is a test program to check the functionality of Basler dart daA2500-14uc Camera. #define saveImages 0 #define recordVideo 1 #include #include #include #include #include #ifdef PYLON_WIN_BUILD #include #endif static const uint32_t c_countOfImagesToGrab = 10; int main(int argc, char* argv[]) { ................................... .................................. }

Real-time stitching of videos from two IP connected camera

$
0
0
Hello guys, i am trying to stitch video feed of two camera connected through IP in an indoor office arrangement. I am using the opencv stitcher class for this purpose with optimization of different features, however video is not stitched instead output shows only the video from camera on left and ignores the video of camera on right. In my point of view this is mainly because 1. in this indoor situation which involves tables, chairs, cabins and etc made of same material and identical in look and hence, features are matched wrong by feature matching algorithm. 2. Furthermore, although there is lot of overlapping region between both images but most of it is plain tile floor and hence there are very few features available to match. I have couple of more question related to this task in case if above problems are solved. 1. There is a lag between both cameras (about 3 to 4 seconds) which i think is because of network router. How can that lag be compensated. Or in simple words, how can i get synchronous video feeds from the cams to process. 2. I want to test my written algo against some standard dataset of video stitching to check if it is working fine in other situations or not. However i am unable to find any such dataset which have videos of same scene captured by two cameras (static). Any help in this regard will be appreciated.

Java/Android access 4-Dim Mat planes

$
0
0
I am building an Android App with uses the DNN module. The output of the forward pass is a Mat with dims() = 4. Actually its the output of semantic segmentation (ENet Example) with 1x8x45x80. mat.total() = 28800 which is also correct. The problem is that i cannot access the data of this mat with get(0,0,floatbuffer), as cols=-1 and rows=-1 which is normal for dim>2. Is there any other way? In the end i would like to have 8 Mats (or 8 simple float-arrays) for each plane. Best Regards

compareHist is returning very low value incase of Bhattacharyya method

$
0
0
hello, I have come to a problem comparing two .png images using **compareHist**. I have used Bhattacharyya, *(method 3)*. but it is returning value close to 0.64. Can anyone help me with the reason and possible solution to make it work?? i have attached here two images here. ![src image](https://imgur.com/Ht5kFvY) ![search image](https://imgur.com/4yCb59X) thnx in advance :)

OpenCV 3.3 build failed

$
0
0
I am building OpenCV 3.3 for windows 10 platform with MinGW and CodeBlocks. After 32% the build fails. It throws the following error message. Request for help. Thanks in advance C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lRunTmChk collect2.exe: error: ld returned 1 exit status mingw32-make.exe[2]: *** [bin/libopencv_core330.dll] Error 1 mingw32-make.exe[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 mingw32-make.exe: *** [all] Error 2 modules\core\CMakeFiles\opencv_core.dir\build.make:1722: recipe for target 'bin/libopencv_core330.dll' failed mingw32-make.exe[2]: Leaving directory 'C:/opencv33/build' CMakeFiles\Makefile2:2093: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed mingw32-make.exe[1]: Leaving directory 'C:/opencv33/build' C:/opencv33/build/Makefile:145: recipe for target 'all' failed
Viewing all 4615 articles
Browse latest View live


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