How to do a maximum rank filter
2 次查看(过去 30 天)
显示 更早的评论
I would like to do a 3x3 max-rank filter with 0 padding. How would I go about doing this? Currently I have tried:
M = [203 167 233 113 222 232;
79 176 39 27 22 46;
135 191 211 256 102 67;
42 115 137 1 66 37;
154 21 254 198 204 35;
67 58 20 208 110 222];
localMaxImage = imdilate(M, true(3))
0 个评论
采纳的回答
yanqi liu
2021-11-26
clc; clear all; close all;
M = [203 167 233 113 222 232;
79 176 39 27 22 46;
135 191 211 256 102 67;
42 115 137 1 66 37;
154 21 254 198 204 35;
67 58 20 208 110 222];
localMaxImage = imdilate(M, true(3))
fun = @(block_struct) max(max(block_struct.data)) * ones(size(block_struct.data));
localMaxImage2 = blockproc(M,[3 3],fun)
0 个评论
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!