一元网络论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 196|回复: 0

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

[复制链接]

1万

主题

1万

帖子

5万

积分

管理员

Rank: 9Rank: 9Rank: 9

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



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


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|一元网络论坛

GMT+8, 2024-9-21 13:55 , Processed in 0.086910 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表