Skip to content

Tag: opencv

camera suddenly close when i run the code

I am trying to make a color detection from the default camera using python, to do this I am using OpenCV and NumPy. My program suddenly closes the camera. This is code I’m trying to run: Answer There are three stages to do this task: Firstly you need to make a color boundries Color detection Stack them …

Opencv-Overlay a Video on Webcam

Guys I am having problem on overlaying my video to webcam. I can open webcam without any issues or errors but my video is not being showed. I am trying to play my video in specific x-y coordinates.I take most of my code from an other stackoverflow question but I cannot find it know so that I cannot mention it

Turning an Open CV frame into a Base64 encoded JPEG

I want to take a frame from an Open CV webcam stream, produce a JPEG thumbnail and then encode it as Base64 (It will then be sent as an MQTT message, but this is not the problem). My Python “sendimage” function is: It seems to work as far as the cv2.imencode, but the base64.b64encode fails with. E…

OPENCV – !ssize.empty()

THIS IS MY CODE: Guys, this is the part of my code. I am trying to resize my image but ıt gives the following error: error: OpenCV(4.0.1) C:ciopencv-suite_1573470242804workmodulesimgprocsrcresize.cpp:3784: error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’ Do you have any sugge…

OpenCV – Detect points along a curve

I need to detect the points along these curves, in particular I need the position on the image of one of the two points starting from the left: I tried to detect Hough Points like that: But it doesn’t get the right points and I suppose that this is because the points are positioned along the two curves.…

Bounding box detection for characters / digits

I have images, which look like the following: I want to find the bounding boxes for the 8 digits. My first try was to use cv2 with the following code: Unfortunately that doesn’t work. Does anyone have an idea? Answer The problem in your solution is likely the input image, which is very poor in quality. …