Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
could this problem be solved with a 2d convolution?

Subject: could this problem be solved with a 2d convolution?

From: Ha

Date: 21 Aug, 2011 17:07:08

Message: 1 of 3


Providing a big 2D matrix, I wanna fill the value of each element with the maximum of its surrounding NxN elements. This can of course be solved by using nested loops, which must be too slow. How can I deal with this problem with a 2D convolution?

Subject: could this problem be solved with a 2d convolution?

From: Bruno Luong

Date: 21 Aug, 2011 17:18:08

Message: 2 of 3

"Ha" wrote in message <j2rdvs$m4j$1@newscl01ah.mathworks.com>...

> How can I deal with this problem with a 2D convolution?

You can't with 2d convolution (not all sliding computation is a convolution).

You can do with imdilate (image processing toolbox) or with

http://www.mathworks.com/matlabcentral/fileexchange/24705-minmax-filter

Bruno

Subject: could this problem be solved with a 2d convolution?

From: Ha

Date: 22 Aug, 2011 02:01:09

Message: 3 of 3

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <j2rekg$npt$1@newscl01ah.mathworks.com>...
> "Ha" wrote in message <j2rdvs$m4j$1@newscl01ah.mathworks.com>...
>
> > How can I deal with this problem with a 2D convolution?
>
> You can't with 2d convolution (not all sliding computation is a convolution).
>
> You can do with imdilate (image processing toolbox) or with
>
> http://www.mathworks.com/matlabcentral/fileexchange/24705-minmax-filter
>
> Bruno

nice. thx

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us