ICCV2025 特征点检测 图像匹配 RIPE

目测对刚性物体效果比较好

代码:https://github.com/fraunhoferhhi/RIPE

论文:https://arxiv.org/abs/2507.04839

python 复制代码
import cv2
import kornia.feature as KF
import kornia.geometry as KG
import matplotlib.pyplot as plt
import numpy as np
import torch
from torchvision.io import decode_image

from ripe import vgg_hyper
from ripe.utils.utils import cv2_matches_from_kornia, resize_image, to_cv_kpts

dev = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = vgg_hyper().to(dev)
model.eval()

image1 = resize_image(decode_image("assets/all_souls_000013.jpg").float().to(dev) / 255.0)
image2 = resize_image(decode_image("assets/all_souls_000055.jpg").float().to(dev) / 255.0)

kpts_1, desc_1, score_1 = model.detectAndCompute(image1, threshold=0.5, top_k=2048)
kpts_2, desc_2, score_2 = model.detectAndCompute(image2, threshold=0.5, top_k=2048)

matcher = KF.DescriptorMatcher("mnn")  # threshold is not used with mnn
match_dists, match_idxs = matcher(desc_1, desc_2)

matched_pts_1 = kpts_1[match_idxs[:, 0]]
matched_pts_2 = kpts_2[match_idxs[:, 1]]

H, mask = KG.ransac.RANSAC(model_type="fundamental", inl_th=1.0)(matched_pts_1, matched_pts_2)
matchesMask = mask.int().ravel().tolist()

result_ransac = cv2.drawMatches(
    (image1.cpu().permute(1, 2, 0).numpy() * 255.0).astype(np.uint8),
    to_cv_kpts(kpts_1, score_1),
    (image2.cpu().permute(1, 2, 0).numpy() * 255.0).astype(np.uint8),
    to_cv_kpts(kpts_2, score_2),
    cv2_matches_from_kornia(match_dists, match_idxs),
    None,
    matchColor=(0, 255, 0),
    matchesMask=matchesMask,
    # matchesMask=None, # without RANSAC filtering
    singlePointColor=(0, 0, 255),
    flags=cv2.DrawMatchesFlags_DEFAULT,
)

plt.imshow(result_ransac)
plt.axis("off")
plt.tight_layout()

plt.show()
相关推荐
yz_aiks几秒前
WorkBuddy 使用技巧:Claude Code 国内平替,签到免费用、自动签到和手机远程控制电脑
人工智能·ai编程·效率工具·claude code·workbuddy
锋行天下15 分钟前
DeepSeek写Langgraph就是个大傻逼,一本正经胡说八道
前端·人工智能·后端
沃达德软件35 分钟前
智慧无人机图像识别分析技术
人工智能·目标检测·计算机视觉·目标跟踪·视觉检测·无人机
染指11101 小时前
162.Agent-LangGraph-检查点的作用
人工智能·python·langchain·agents
FII工业富联科技服务1 小时前
从灯塔工厂到规模化智能运营:Omniverse Sim2Real与多智能体协同架构解析
人工智能·数字孪生·ai智能体·工业机器人·omniverse·柔性制造·灯塔工厂
合尘猫1 小时前
6GB 笔记本本地跑 Z-Image Turbo:一次从 cu121 到 cu130 的踩坑记录
人工智能·ai·大模型·本地部署
2401_832298101 小时前
当思考本身被解放:AI 时代的人与机器
人工智能
北方的银狐-Zero1 小时前
Palantir 平替产品出世:OntoL 8.0 发布,把「企业级本体决策平台」产品复刻出来了
人工智能·本体论·本体产品
赤龙ERP1 小时前
ERP周报:连接器开闸、国产GPU进场与智能工厂253家
数据库·人工智能·大模型·rpa·erp·企业数字化·builderpattern
AI编程教父1 小时前
企业AI转型做自动化,哪些靠规则、哪些交给AI?红烁AI企业AI培训用两类任务对比
人工智能