我很难做到这一点。 我的图像集由小图像(58x65)组成
我正在使用具有以下参数的ORB:
# Initiate ORB detector
# default: ORB(int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31, int firstLevel=0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31)
orb = cv2.ORB_create(
nfeatures = 500, # The maximum number of features to retain.
scaleFactor = 1.2, # Pyramid decimation ratio, greater than 1
nlevels = 8, # The number of pyramid levels.
edgeThreshold = 7, # This is size of the border where the features are not detected. It should roughly match the patchSize parameter
firstLevel = 0, # It should be 0 in the current implementation.
WTA_K = 2, # The number of points that produce each element of the oriented BRIEF descriptor.
scoreType = cv2.ORB_HARRIS_SCORE, # The default HARRIS_SCORE means that Harris algorithm is used to rank features (the score is written to KeyPoint::score and is
# used to retain best nfeatures features); FAST_SCORE is alternative value of the parameter that produces slightly less stable
# keypoints, but it is a little faster to compute.
#scoreType = cv2.ORB_FAST_SCORE,
patchSize = 7 # size of the patch used by the oriented BRIEF descriptor. Of course, on smaller pyramid layers the perceived image area covered
# by a feature will be larger.
)
可以看出,我更改了edgeThreshold和patchSize参数,但恐怕这些尺寸太小,找不到有意义的功能
我正在测试一组相当大的停车场图像(约3900张58x65的图像),其中既有空的也有人
但结果并不一致:一辆停着的汽车(从场景外)的图像显示为比其他停着的汽车更靠近空位
我可能做错了什么?我的猜测是上述参数。在这方面有更多经验的人可以证实吗
编辑:
Here是图像的一小部分
完整数据集可在here找到
由于探测器的窗口大小和刻度的数量,通常不能同时看到球体和小图像。窗口大小为7 x 7,选择的比例数为8,比例因子为1.2。这是探测器的典型设置,但如果你做数学运算,你会很快意识到,当你进一步缩小时,窗口大小将过大,提示很少检测(如果有的话)。我不建议您在这里使用ORB
尝试使用密集特征描述符,例如HOG或密集SIFT,它为重叠的像素窗口提供特征描述符,而不管它们的组成如何。从您描述的图像来看,这听起来是一个更好的方法
假设您有一个名为
im
的灰度图像,例如:对于密集筛分:
注意,对于SIFT描述符,您需要安装库的
opencv-contrib-python
风格(即pip install opencv-contrib-python
)相关问题 更多 >
编程相关推荐