守望_sy 2021-12-01 08:22 采纳率: 63.2%
浏览 13
已结题

计算机视觉的卷积及Dr的代码,上课没有听懂,需要超级详细讲解

问题遇到的现象和发生背景

Practical task 1: Developing a correlation filter.
Developing a correlation filter.

It is necessary to develop a function - a filter based on correlation. without using ready-made implementations and using only numpy library functions.

It is necessary to use the following types of kernels for filters with normalization:

  1. 1 1 1 1 1 2) -1 -1 -1 -1 -1 3) -1 -1 -1 -1 -1

    1 1 1 1 1 0 0 0 0 0 0 0 1 0 0

    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

For test Image please use picture boat1_resize.jpg.

Plese, Save your Result as the processed image and code to the report file and subscribe it to answer of this task

img

问题相关代码,请勿粘贴截图
import numpy as np
import cv2 as cv
img=cv.imread("D:/boat1_resize.jpg",0)
cv.imshow("1",img)
cv.waitKey(0)
kernel1=np.array([[1,1,1],                   
                   [0,0,0],
                   [-1,-1,-1]])
img=cv.copyMakeBorder(img,1,1,2,2,cv.BORDER_REPLICATE)
img2=img.copy()
for i in range(0,321,1):
    for j in range(0,492,1):
        a=np.abs(np.sum(np.multiply(img[i:i+3,j:j+3],kernel1)))
        img2[i+1,j+2]=a
img=img[1:323,2:495]
cv.imshow("1",img2)
cv.waitKey(0)
cv.destroyAllWindows()

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

3条回答 默认 最新

  • 有问必答小助手 2021-12-02 10:22
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


    本次提问扣除的有问必答次数,已经为您补发到账户,我们后续会持续优化,扩大我们的服务范围,为您带来更好地服务。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 12月10日
  • 已采纳回答 12月2日
  • 创建了问题 12月1日

悬赏问题

  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用