Performing 2D convolution
显示 更早的评论
Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you!
采纳的回答
更多回答(1 个)
Image Analyst
2025-9-9
0 个投票
@William Rose gave a good answer. Bottom line, I wouldn't do anything to your image in advance. Simply call conv2 and pass it the original image. Or you can call imfilter. It doesn't flip the kernel (not sure you need to, and don't for simple things like low pass or high pass filters) and imfilter gives you additional options for how edge computations are computed.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
