feature-detection

opencv and python: how to use cv2.surf() with mask

依然范特西╮ 提交于 2021-02-07 20:43:22
问题 I am a newbie at opencv and python and am trying to collect keypoints and descriptors of faces within an image. I am using HAAR cascade classifier with frontal face template to look for faces in an image. The HAAR cascade gives me a list of coordinates marking the faces in the image. I want to generate a "mask" at those coordinates so that I can use cv2.surf() to extract keypoints and descriptors within the masked region. I don't know how to create that mask. Try this photo as an example to

opencv and python: how to use cv2.surf() with mask

夙愿已清 提交于 2021-02-07 20:42:31
问题 I am a newbie at opencv and python and am trying to collect keypoints and descriptors of faces within an image. I am using HAAR cascade classifier with frontal face template to look for faces in an image. The HAAR cascade gives me a list of coordinates marking the faces in the image. I want to generate a "mask" at those coordinates so that I can use cv2.surf() to extract keypoints and descriptors within the masked region. I don't know how to create that mask. Try this photo as an example to

opencv and python: how to use cv2.surf() with mask

筅森魡賤 提交于 2021-02-07 20:41:52
问题 I am a newbie at opencv and python and am trying to collect keypoints and descriptors of faces within an image. I am using HAAR cascade classifier with frontal face template to look for faces in an image. The HAAR cascade gives me a list of coordinates marking the faces in the image. I want to generate a "mask" at those coordinates so that I can use cv2.surf() to extract keypoints and descriptors within the masked region. I don't know how to create that mask. Try this photo as an example to

Using inRange() in OpenCV to detect colors in a range

北慕城南 提交于 2021-02-06 12:54:47
问题 I'm writing a C++ program with OpenCV for lunar crater detection which seems to detect only a small fraction of craters accurately. My strategy for this approach was to first convert the image to HSV, then use inRange() to catch the colors in a range of values to produce a threshold, then Gaussian blur it and use HoughCircles() to detect the circles. One thing that I am not fully understanding is that when I give inRange() a low and high threshold around a color, it simply does not return

Using inRange() in OpenCV to detect colors in a range

元气小坏坏 提交于 2021-02-06 12:54:31
问题 I'm writing a C++ program with OpenCV for lunar crater detection which seems to detect only a small fraction of craters accurately. My strategy for this approach was to first convert the image to HSV, then use inRange() to catch the colors in a range of values to produce a threshold, then Gaussian blur it and use HoughCircles() to detect the circles. One thing that I am not fully understanding is that when I give inRange() a low and high threshold around a color, it simply does not return

How to get points coordinate position in the face landmark detection program of dlib?

你离开我真会死。 提交于 2021-02-06 09:27:27
问题 There is one example python program in dlib to detect the face landmark position. face_landmark_detection.py This program detect the face feature and denote the landmarks with dots and lines in original photo. I wonder if it is possible to obtain each points' coordinate position. Like a(10, 25). 'a' denotes corner of the mouth. After slightly modifying the program to process one picture at one time, I try to print out the value of dets and shape without success. >>>print(dets) <dlib.dlib

Using SIFT (or an alternative) in Python OpenCV 4.2.0 (In 2020)

久未见 提交于 2021-01-28 04:00:49
问题 I am trying to use SIFT for feature detection with Python, but it is no longer part of OpenCV or OpenCV contrib. With OpenCV opencv-contrib-python (both versions 4.2.0.34, the latest as of this question), I get: >>> import cv2 >>> cv2.SIFT_create() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'cv2.cv2' has no attribute 'SIFT_create' >>> cv2.xfeatures2d.SIFT_create() Traceback (most recent call last): File "<stdin>", line 1, in <module> cv2

Using SIFT (or an alternative) in Python OpenCV 4.2.0 (In 2020)

徘徊边缘 提交于 2021-01-28 03:49:10
问题 I am trying to use SIFT for feature detection with Python, but it is no longer part of OpenCV or OpenCV contrib. With OpenCV opencv-contrib-python (both versions 4.2.0.34, the latest as of this question), I get: >>> import cv2 >>> cv2.SIFT_create() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'cv2.cv2' has no attribute 'SIFT_create' >>> cv2.xfeatures2d.SIFT_create() Traceback (most recent call last): File "<stdin>", line 1, in <module> cv2

opencv - object tracking using feature detection

两盒软妹~` 提交于 2021-01-27 03:53:08
问题 I want to track an object(for example, a moving ball) in a video. Referring to opencv tutorial - 'Features2D + Homography to find a known object', I have been able to track my object in a still image by providing a reference image. I plan to use a reference image to detect the moving object from the first frame of input video. For the next frame the object detected in previous frame should act as a reference image and so on. But I don't know how to find back an object from its descriptor. An

opencv - object tracking using feature detection

牧云@^-^@ 提交于 2021-01-27 03:51:20
问题 I want to track an object(for example, a moving ball) in a video. Referring to opencv tutorial - 'Features2D + Homography to find a known object', I have been able to track my object in a still image by providing a reference image. I plan to use a reference image to detect the moving object from the first frame of input video. For the next frame the object detected in previous frame should act as a reference image and so on. But I don't know how to find back an object from its descriptor. An