close all;
clear all;
clc;% 对人体骨骼扫描图像进行增强
% 编写时间:2017年10月30号 作者:gq % 读入图像
I1 = imread('人体骨骼扫描图像.jpg');
I1 = im2double(I1);
I1 = rgb2gray(I1);
subplot(241),imshow(I1),title('人体骨骼扫描图像');% 拉普拉斯变换
h = [-1,-1,-1;-1,8,-1;-1,-1,-1];
I2 = imfilter(I1,h,'replicate');
subplot(242),imshow(I2,[]),title('经过拉普拉斯操作过的图像');% 图像相加
I3 = imadd(I1,I2);
subplot(243),imshow(I3),title('图像相加后得到的锐化图像');% sobel梯度处理
Sv = [-1,-2,-1;0,0,0;1,2,1];
Sh = [-1,0,1;-2,0,2;-1,0,1];
Gv = imfilter(I1,Sv,'same');
Gh = imfilter(I1,Sh,'same');
abs_Gv = abs(Gv);
abs_Gh = abs(Gh);
I4 = abs_Gv + abs_Gh;
subplot(244),imshow(I4,[]),title('经过sobel梯度处理后的图像');% 5*5均值滤波
w = fspecial('average',5);
I5 = imfilter(I4,w,'replicate');
subplot(245),imshow(I5),title('使用5*5均值滤波器平滑后的sobel图像');% 得到掩蔽图像
I6 = immulti