图像分割的GUI设计
首先,读取原始图像:
clc,clear,close all
im = imread('ball.jpg');
imshow(im)
运行结果如图所示:
接下来对原始图像进行RGB分割:
greenball = im;
r = greenball(:,:,1);
g = greenball(:,:,2);
b = greenball(:,:,3);
%%计算绿色分量
justGreen = g - r/2 -b/2;
figure
subplot(221),imshow(r);title('r')
subplot(222),imshow(g);title('g')
s
1