有没有像下图那样使用图像处理技术分割检测轨迹的方法?
图1:车轮在沙子上的轨迹

图2:要检测的轨迹的一个示例

发布于 2021-02-18 20:51:24
在我看来,答案是否定的。首先,我去掉了光照效果,然后应用Canny来获取图像的特征,只有部分轨迹是可见的。接下来,我执行彩色分割以获得二进制掩码。然后我使用二进制掩模去除了背景,同样,唯一的部分轨迹是可见的。
cv2.divide.使像素在比例内均匀分布,然后使用cv2.GaussianBlur平滑图像
- 
- # Load the image img = cv2.imread("v1uU4.jpg") # Convert to the gray-scale gry = convert\_to\_grayscale(img) # Remove the lightning effect blr = cv2.GaussianBlur(gry, (125, 125), 0) div = cv2.divide(gry, blr, scale=192)图像的
的特征:
- 
- # Load non-lightning image img = cv2.imread("non-lightning.png") # Convert to the gray-scale gry = convert\_to\_grayscale(img) # Remove the lightning effect blr = cv2.GaussianBlur(gry, (5, 5), 0) # Find canny features cny = cv2.Canny(blr, 50, 200)- Here you see only the left part of the track is partially visible. Of course, different parameters will give different results. If you will try them more unwanted features become more available.我们将加载未照明的图像,将其转换为
cv2.inRange找到二进制蒙版。然后我们使用二进制掩码来使曲目更具visible.- 
- # Convert to HSV color-space hsv = cv2.cvtColor(img, cv2.COLOR\_BGR2HSV) # Perform color-segmentation to get the binary mask lwr = np.array([0, 0, 0]) upr = np.array([179, 255, 194]) msk = cv2.inRange(hsv, lwr, upr)使用binary-mask:的
- 
- # Extracting the rod using binary-mask krn = cv2.getStructuringElement(cv2.MORPH\_RECT, (50, 30)) dlt = cv2.dilate(msk, krn, iterations=5) res = 255 - cv2.bitwise\_and(dlt, msk)在我看来,去除背景而只显示可见的轨迹是不可能的。
https://stackoverflow.com/questions/66255144
复制相似问题