date: 2024-09-11
title: CV-HW-2
status: DONE
author:
  - AllenYGY
tags:
  - CV
  - HOMEWORK
publish: TrueCV-HW-2
Given an image, filter the image with cross-correlation and convolution, respectively.
Cross-correlation:
| 1 | 2 | 2 | 3 | 4 | 5 | 
|---|---|---|---|---|---|
| 2 | 3 | 4 | 5 | 6 | 7 | 
| 3 | 3 | 4 | 4 | 5 | 6 | 
| 4 | 5 | 6 | 7 | 8 | 9 | 
Filter:
| 1 | 2 | 1 | 
|---|---|---|
| 0 | 0 | 0 | 
| -1 | -2 | -1 | 
Result:
| -6 | -6 | 5 | -4 | 
|---|---|---|---|
| -8 | -8 | -8 | -8 | 
Convolution:
| 1 | 2 | 2 | 3 | 4 | 5 | 
|---|---|---|---|---|---|
| 2 | 3 | 4 | 5 | 6 | 7 | 
| 3 | 3 | 4 | 4 | 5 | 6 | 
| 4 | 5 | 6 | 7 | 8 | 9 | 
Filter:
| 1 | 2 | 1 | 
|---|---|---|
| 0 | 0 | 0 | 
| -1 | -2 | -1 | 
Result:
| 6 | 6 | -5 | 4 | 
|---|---|---|---|
| 8 | 8 | 8 | 8 |