💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
使用空间滤镜增强图像是一种常见的图像处理方法,旨在改善图像的质量、增强图像的特征以及减少图像中的噪声。这种方法基于对图像中每个像素及其周围像素的数学运算,以便在输出图像中产生某种视觉效果。空间滤镜通常通过在图像的局部区域内进行像素值操作来实现,这些操作可以是加权平均、差分运算、中值计算等。使用空间滤镜增强图像可以改善图像的对比度、锐化边缘、平滑噪声等。常见的空间滤镜包括均值滤波器、高斯滤波器、中值滤波器等。这些滤波器在图像处理中被广泛应用于去除噪声、边缘检测、图像平滑等方面,是图像处理中的基础技术之一。
📚2 运行结果
主函数部分代码:
clc; clear;
%% Read the original image
% (a) The original image
fig_original = double(imread('data/skeleton_orig.tif')) / 255;
figure;
subplot(2, 4, 1);
imshow(fig_original);
imwrite(fig_original, 'data/skeleton_orig.png');
% (b) The Laplacian of the original image
laplace_result = imfilter([-1 -1 -1; -1 8 -1; -1 -1 -1], fig_original);
subplot(2, 4, 2);
imshow(remap(laplace_result, 0, 1));
imwrite(remap(laplace_result, 0, 1), 'data/laplace_result.png');
% (c) The sharpened image using Laplacian
sharpened_laplace_result = fig_original + laplace_result;
subplot(2, 4, 3);
imshow(sharpened_laplace_result);
imwrite(sharpened_laplace_result, 'data/sharpened_laplace_result.png');
% (d) The Sobel gradient of the original image
sobel_grad = abs(imfilter([-1 -2 -1; 0 0 0; 1 2 1], fig_original)) + abs(imfilter([-1 0 1; -2 0 2; -1 0 1], fig_original));
subplot(2, 4, 4);
imshow(sobel_grad);
imwrite(sobel_grad, 'data/sobel_grad.png');
% (e) The smoothed Sobel gradient
smoothed_sobel_grad = imfilter(ones(5)/25, sobel_grad);
subplot(2, 4, 5);
imshow(smoothed_sobel_grad);
imwrite(smoothed_sobel_grad, 'data/smoothed_sobel_grad.png');
% (f) Mask image formed by the product of (c) and (e)
product_laplace_sobel = sharpened_laplace_result .* smoothed_sobel_grad;
subplot(2, 4, 6);
imshow(product_laplace_sobel);
imwrite(product_laplace_sobel, 'data/product_laplace_sobel.png');
% (g) Sharpened image obtained by the sum of (a) and (f)
sharpened_image = max(fig_original + product_laplace_sobel, 0);
subplot(2, 4, 7);
imshow(sharpened_image);
imwrite(sharpened_image, 'data/sharpened_image.png');
🎉3 参考文献
文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。
[1]李辉,刘姁升,蒋金豹等.基于冬小麦高光谱图像的天然气微泄漏胁迫区域提取[J].光谱学与光谱分析,2024,44(03):770-776.