cvCreateCameraCapture Not Working

I am using OpenCV2.2 in Ubuntu 11.04. Using code::blocks 10.05 IDE. Testing the webcam with a simple code in openCV to capture video from the webcam. But, cvCreateCameraCapture(index) is always...

An opencv function similar to matlab's graythresh

Hi i'm trying to convert a matlab code to opencv code. So I need something that does what graythesh in matlab does and give me a proper threshold for my grayscale image. Has this been already...

g++ ld: symbol(s) not found for architecture x86_64

I'm trying to compile the Sam Hare's Struck code. I'm using mac OSX10.9, opencv 2.4.6 and Eigen 2.0.17. Eigen and opencv headers are stored in /opt/local/include while opencv dylib in...

ImportError: numpy.core.multiarray failed to import

I'm trying to run this program import cv2 import time cv.NamedWindow("camera", 1) capture = cv.CaptureFromCAM(0) while True: img = cv.QueryFrame(capture) cv.ShowImage("camera", img) ...

How can I read an image from an Internet URL in Python cv2, scikit image and mahotas?

How can I read an image from an Internet URL in Python cv2? This Stack Overflow answer, import cv2.cv as cv import urllib2 from cStringIO import StringIO import PIL.Image as...

Reading every nth frame from VideoCapture in OpenCV

Is it possible to read frames from a video in steps (eg I want to read every fifth frame of a video stream). Currently I'm doing this as a workaround but it's not very effecient. bool bSuccess int...

How do I install Python OpenCV through Conda?

I'm trying to install OpenCV for Python through Anaconda, but I can't seem to figure this out. I tried conda install opencv conda install cv2 I also tried searching conda search cv No cigar. I...

Android convert byte array from Camera API to color Mat object openCV

I'm trying to take data captured off the camera API and do color postprocessing. My issue is that while I can convert a byte[] object to a Mat object, I cannot get the color channels without...

rotation matrix in openCV

I am creating a rotation matrix in python as follows: import numpy as np def make_rot(angle): cost = np.cos(np.deg2rad(angle)) sint = np.sin(np.deg2rad(angle)) rot = np.array([[cost,...

openCV video saving in python

I am trying to save the video but it's not working. I followed the instructions from the openCV documentation. import numpy as np import cv2 cap = cv2.VideoCapture(0) fourcc =...

Capturing video from two cameras in OpenCV at once

How do you capture video from two or more cameras at once (or nearly) with OpenCV, using the Python API? I have three webcams, all capable of video streaming, located at /dev/video0, /dev/video1,...

OpenCV 3.0 LineIterator

I want to use the LineIterator in OpenCV 3.0 using Python, is it still available with OpenCV 3.0 built for Python? It seems that the answers on the internet are all pointing to cv.InitLineIterator...

cmake error : opencv2/opencv.hpp:opencv2/opencv.hpp:No such file or directory

I am compiling opencv programs with cmake. The code is as follows: DisplayImage.cpp: #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { ...

opencv - videowriter control bitrate

I have a working python script that uses the video writer from opencv. source https://gist.github.com/stanchiang/b4e4890160a054a9c1d65f9152172600 If i take in a file, and regardless of whether I...

Share OpenCV C++ Object with Python

Scenario: A C++ program process captures an image using OpenCV. Another process, using Python and OpenCV has a shared memory area (with mmap) with the first program. Problem: How do I create in a...

OpenCV Python: Restarting a video

I am new to both OpenCV and Python, and I am trying to create a simple program that will read in a video file named 'SixtyFPS.mov' and replay the video when it has reached its end. Ideally I would...

OpenCV live stream video over socket in Python 3

I am trying to create a simple application to send live stream video over the socket in Python 3 with OpenCV. I am new to OpenCV and socket programming so if you can provide answer in detail I...

OpenCV TermCriteria Difference between CV_TERMCRIT_EPS and TermCriteria::EPS

What is the difference between using CV_TERMCRIT_EPS and using TermCriteria::EPS inside the TermCriteria function? I've just taken over a small bit of software written in C++ and am no expert....

List available cameras OpenCV/Python

I have multiple webcams connected to my PC and I would like to select one camera based on its info (name, resolution etc.). Is there a way to list all the cameras available on a PC, instead of...

how to stream multiple camera feeds to single socket in python

I am working on a module where i have to detect some predefined objects in the video stream. For object detection i am using YOLO. I need to process multiple camera feeds in parallel. I tried...

Converting PNG to JPG in python

I'm trying to compare two images, one a .png and the other a .jpg. So I need to convert the .png file to a .jpg to get closer values for SSIM. Below is the code that I've tried, but I'm getting...

OpenCV hough lines vs scikit-image

I've been comparing OpenCV and scikit-image's hough lines implementation and I'm finding that scikit-image gives significantly better results. I'm trying to do the same canny/hough lines transform...

Python OpenCV resize an image by reading the QR code placed on the image

I'm working on a project using Python(3.7) and OpenCV in which I have an image of a document with a QR code placed on it. This QR code has 6 values respectively as: Size of QR code...

Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer

I'm trying to create a simple photo capture app using kivy, opencv. When I tried to create an .apk file using buildozer, and put opencv in requirements at .spec file then I faced this error --...

How can I make empty grayscale image in OpenCV Python?

I want to know how to make a empty grayscale image in OpenCV. First, I know how to make a empty 'color image' like this. import cv2 import numpy as np blank_image = np.zeros((height,width,3),...

No suitable user-defined conversion from "cv::Scalar" to "CvScalar" exists

I am traying to run old c++ code in pc with this caracteristcs: opencv: 3.4.14 OS: Win 10 code: c++ An example of the code: CvScalar color = CV_RGB(255, 255, 255); But return the next...

Windows forms - C++/CLR (.NET Framework) - How to use button events

I am building an application that uses Computer Vision to detect objects with a webcam. To implement the idea, I use the OpenCV library and C++. To build the windows form I am using C++/CLR (.NET...

Opencv config with two major python (3.7 & 3.8)

For some time I was using opencv (4.5.2 compiled from source) with python 3.8.5 (on Ubuntu 18.04), but for some project, I do need to work with tensorflow, which is not working with my python...

TypeError: create_int(): incompatible function arguments

I've Been Recently Learning Computer Vision using python, and when making a hand detector project, I encountered this error :- Traceback (most recent call last): File "c:\Users\idhant\OneDrive -...

How to solve "cv2.error: OpenCV(4.5.4) :-1: error: (-5:Bad argument) in function 'imshow'"

I'm learning how to use opencv, but I'm running into this problem. from cvzone.HandTrackingModule import HandDetector import cv2 cap =...