admin 发表于 2024-7-20 12:36:27

支付300元求解一项技术难题!

文本改写如下:
规定使用 Python 3.10 或更高版本来执行任务
请采用 OpenCV 或其他图像识别库(排除 YOLO,因为它的训练数据不足)
当前状况:一组包含六幅图像,其中图像4和图像6未能成功匹配
采用了基本的灰度匹配法,要求相似度至少为50%
def capture_image(index: int):
    for method in methods:
      method_instance = globals()
      original_rgb = cv2.imread(image_list)
      grayscale_image = cv2.cvtColor(original_rgb, cv2.COLOR_BGR2GRAY)
      template = cv2.imread(template_image, 0)
      dimensions = template.shape
      result = cv2.matchTemplate(grayscale_image, template, cv2.TM_CCOEFF_NORMED)
      threshold_value = 0.45
      positions = np.where(result >= threshold_value)
      for position in zip(*positions[::-1]):
            cv2.rectangle(original_rgb, position, (position + dimensions, position + dimensions), (0, 0, 255), 2)
      cv2.imwrite(f"result_{index}.png", original_rgb)
感兴趣的人可以通过 Telegram 联系我,先分享一些初步想法。如果我认为方案可行,会发给你图片让你制作演示
无法匹配的图像如下所示:

https://cdn.linux.do/uploads/default/original/3X/c/a/ca455882fdb1e99f49e86f05e26c138528e34fb2.png

这是我自制的图像
由于直接上传可能存在问题,这是通过截图获取的

https://cdn.linux.do/uploads/default/original/3X/3/4/34d85596c19444e6718cb0fa58c58fe41832c753.png
页: [1]
查看完整版本: 支付300元求解一项技术难题!