mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
57d4c86b2b
Also, removed the one from modules/python/src2/cv.py and cleared its executable bit, since it's not a script.
17 lines
483 B
Python
Executable File
17 lines
483 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import cv2.cv as cv
|
|
|
|
def precornerdetect(image):
|
|
# assume that the image is floating-point
|
|
corners = cv.CloneMat(image)
|
|
cv.PreCornerDetect(image, corners, 3)
|
|
|
|
dilated_corners = cv.CloneMat(image)
|
|
cv.Dilate(corners, dilated_corners, None, 1)
|
|
|
|
corner_mask = cv.CreateMat(image.rows, image.cols, cv.CV_8UC1)
|
|
cv.Sub(corners, dilated_corners, corners)
|
|
cv.CmpS(corners, 0, corner_mask, cv.CV_CMP_GE)
|
|
return (corners, corner_mask)
|