using convolution on a basic matrix block

2 次查看(过去 30 天)
TZ
TZ 2017-12-17
编辑: Matt J 2017-12-17
Hi, In my program I have to use a mask and use conv2 on a big matrix (can be 20,000x20,000). this big matrix is built from smaller basic matrix, where i use the repmat to create the bigger one. I want to find a way to use conv2 on the smaller matix to save computing time and the use the repmat fuction. the problem is that the result in not the same even if I use 'same'. the reason is that at the boundries of the smaller matrix the mask only "feels" the end of the matrix thus the overlap becomes smaller, while in the bigger one the mask will also "feels" the continuation. I have thought of using a bigger basic matrix and after convolution take only the inner part of it and the duplicating it, but i fear of discontinuation. What I need is that the end of the top and bottom boundaries to be a continuation of each other, and the same goes for left and right boundaries. suggestions???

回答(2 个)

Matt J
Matt J 2017-12-17
编辑:Matt J 2017-12-17

Image Analyst
Image Analyst 2017-12-17
Not sure what you want. Do you want that the window shrinks as you get close to the edge? Or it pretends that there is data outside the image? Both conv2() and imfilter() have a number of options for handling computation near the edges. Perhaps you want the 'replicate', 'circular', or 'symmetric' option of imfilter().

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by