How to improve detection of Probalistic Hough
I'm trying to detect a clock hand in a video of an analogue display and extract the value it points to. I'm using Python with OpenCV for this.
What I essentially do is:
The Code for it:
def detect_clock_hand(img, center):
# Convert to gray
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
# Apply gaussian blur
blur = cv2.GaussianBlur(gray, (11, 11), 0, 0)
# Apply sobel edge detection
edges = cv2.Canny(blur, 30, 40)
# Apply HoughTransform
lines = cv2.HoughLinesP(edges, 10, np.pi / 180, 5, 15, 50)
#Filter lines in a given radius
filtered_edges = util.filter_edges(lines, center)
I played a lot with the parameters to improve the results. The current status looks like this:
Canny
Hough
As you can see, the result just marks a part of the clockhand. And that part isn't event a 'good' part from what I can tell from the Canny Edge Detection. I'm wondering if I use the Hough Transform wrong or the Edge Detection actually isn't as good as I think it is. Since I'm new to Image Processing, I'd be greatful for any advice.
链接地址: http://www.djcxy.com/p/79668.html上一篇: 如何在EmberJS中呈现除application.hbs以外的模板?
下一篇: 如何提高检测性检测的准确性