首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MATLAB中的几何均值滤波器

MATLAB中的几何均值滤波器
EN

Stack Overflow用户
提问于 2022-05-21 16:34:57
回答 1查看 98关注 0票数 1
代码语言:javascript
运行
复制
I = imread("example.tif");

G = imfilter(log(I), h, 'replicate'); 
G = exp(G); 
G = G .^ (1/numel(h));

它会给出以下错误。此外,我需要写什么而不是'h‘参数?

代码语言:javascript
运行
复制
Check for incorrect argument data type or missing argument in call to function 'log'.
EN

回答 1

Stack Overflow用户

发布于 2022-05-21 18:26:26

请按照下面的示例进行说明。

代码语言:javascript
运行
复制
I = imread('example.tif'); 

% Convert the image to double.
I = rgb2gray(im2double(I));

% Create the function you want to apply to the image — a geometric mean filter.
fun = @(x) geomean(x(:));

% Apply the filter to the image.
G = nlfilter(I,[5 5],fun); 

% Display the original image and the filtered image, side-by-side.
montage({I,G})
title('Original Image (Left) and Geometric-Mean Filtered Image (Right)')

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72331433

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档