How can i use zero-padding in an image?
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello ,
I have an image(512x512) and i want to do zero-padding in order to covolute it with a filter .
The problem here is that i dont know how to do that ,meaning that i dont know where the zeros should be (around the image or next to it) and furthermore the size of the zero-padding.
Any help would be valuable.
댓글 수: 0
채택된 답변
추가 답변 (1개)
Ameer Hamza
2020년 10월 13일
편집: Ameer Hamza
2020년 10월 13일
You don't need to do padding yourself. imfilter(): https://www.mathworks.com/help/images/ref/imfilter.html automatically does it based on the option you pass
filtered_image = imfilter(img, fil, 'same')
If you want to understand the concept behind it, then this link might be helpful: https://machinelearningmastery.com/padding-and-stride-for-convolutional-neural-networks/
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!