opencv

Solve PnP or Estimate Pose Single Markers: which is better?

Solve PnP or Estimate Pose Single Markers: which is better? Question: I need a program to estimate the pose of an ArUco marker, and, as far as I know, I can code it with two different functions: cv2.solvePnp() or cv2.aruco.estimatePoseSingleMarker(). Which one is better? I read about them, and it seems easier to use cv2.aruco.estimatePoseSingleMarker(), …

Total answers: 1

cv2.drawKeypoints not drawing keypoints on the outImage

cv2.drawKeypoints not drawing keypoints on the outImage Question: I am working with OpenCV in Python and trying to diplay the keypoints recognized by SIFT from gray image to the original color image. Here is my code import cv2 as cv org_img = cv.imread(‘/content/Sunset_org.jpg’) gray_img = cv.cvtColor(org_img,cv.COLOR_BGR2GRAY) sift = cv.SIFT_create() kp = sift.detect(gray_img,None) sift = cv.drawKeypoints(gray_img, …

Total answers: 1

How to detect pits on smart card contact pins using diplib

How to detect pits on smart card contact pins using diplib Question: During the smart card manufacture process, a probe stucks could leave pits on contact pins. I try to use dip.tophat and dip.HysteresisThreshold to extract the pits, this works but found more local height outside or near the edge of the contact pins. How …

Total answers: 2

Remove border from opencv generated ellipse in pygame

Remove border from opencv generated ellipse in pygame Question: I’ve set up this window where I blit an ellipse to the screen. I would like to have the ellipse fully white with a smooth border. It looks acceptable, but when I add the ellipse to a white background, the border of the ellipse shows up. …

Total answers: 2

Why is median blur not working? – OpenCV – Python

Why is median blur not working? – OpenCV – Python Question: I have a function to add gaussian noise to an image read by OpenCV with imread that returns an image (matrix). I am trying to use median blur on that image but terminal returns this error: median = cv2.medianBlur(image, 5) ^^^^^^^^^^^^^^^^^^^^^^^^ cv2.error: OpenCV(4.7.0) D:/a/opencv-python/opencv-python/opencv/modules/imgproc/src/median_blur.simd.hpp:870: …

Total answers: 1

I can't get Opencv aruco to work on raspberry pi

I can't get Opencv aruco to work on raspberry pi Question: I’ve tried to install cv2 on my raspberry pi and when I run just import cv2 in python it executes fine but when I run import cv2.aruco If it’s relevant, I have a raspberry pi 1b (the original one with 2 usb ports not …

Total answers: 2

How do you detect the largest set of parallel lines in an image?

How do you detect the largest set of parallel lines in an image? Question: I have images with multiple line in them and I’m looking to detect the largest set of lines which are (approximately) parallel using Python and OpenCV. For example give: The green lines are the best set: Asked By: nickponline || Source …

Total answers: 1

Find "noisy" lines in a image with cv2 in python

Find "noisy" lines in a image with cv2 in python Question: I have the following image: What is the best way to find the brown lines? The output image should kind of look like this: I have tried to just filter out the brown color, but I couldn’t find a good color range. Asked By: …

Total answers: 3

Filling a cloud 2D image into a continous map

Filling a cloud 2D image into a continous map Question: I have the following image: and I wish to obtain something close to (I didn’t do it perfectly): How can I do this with python? My initial image is a 2D numpy array of 0 and 255 values. Asked By: Learning from masters || Source …

Total answers: 2

Find countors on a dark background

Find countours on a dark background Question: Suppose, I have a dark image on a white background. For example, the image below: With the code below, I can easily extract its countors import imutils import cv2 image = cv2.imread("image.jpg") image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) image = imutils.resize(image, width = 64) thresh = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, …

Total answers: 2