数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation
来源:互联网 发布:笛子校音器软件 编辑:程序博客网 时间:2024/06/06 15:01
实验报告:
Objective:
Color image segmentation is a big issue in image processing. This students need to know the basics of this topic.
Main requirements:
Ability of programming with C, C++, or Matlab.
Instruction manual:
Download Fig. 6.28(b) and duplicate Example 6.15, but segment instead the darkest regions in the image.
本实验是彩色图像分割,从彩色图像中分割出特定颜色。这里我选了红色,从下面图片分割红色出来,主要是草莓的部分有较多的红色分量。
原图像:
实验代码:
%close all;clc;clear all;%img = imread('Fig6.30(01).jpg');figure;subplot(2, 2, 1);imshow(img);title('original image');%img1 = im2double(img);R = img1(:, :, 1);G = img1(:, :, 2);B = img1(:, :, 3);subplot(2, 3, 4);imshow(R);title('Red');subplot(2, 3, 5);imshow(G);title('Green');subplot(2, 3, 6);imshow(B);title('Blue');%R1 = R(129:256, 86:170);R1_ave = mean(mean(R1(:)));[M, N] = size(R1);sd = 0.0;for i = 1:M for j = 1:N sd = sd + (R1(i, j) - R1_ave) * (R1(i, j) - R1_ave); endendR1_d = sqrt(sd/(M*N));R2 = zeros(size(img, 1), size(img, 2));index = find((R > R1_ave - 1.25*R1_d) & (R < R1_ave + 1.25*R1_d));R2(index) = 1;subplot(2, 2, 2);imshow(R2);title('segment red');
实验结果:
从颜色分割的结果来看,白色部分主要为草莓的那部分区域,也正好是我们所要区分的红色的区域。
阅读全文
0 0
- 数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation
- 数字图像处理实验(15):PROJECT 06-02,Pseudo-Color Image Processing
- 数字图像处理实验(16):PROJECT 06-03,Color Image Enhancement by Histogram Processing
- 数字图像处理实验(8):PROJECT 04-04,Highpass Filtering Using a Lowpass Image
- 数字图像处理实验(1):PROJECT 02-01, Image Printing Program Based on Halftoning
- 数字图像处理实验(7):PROJECT 04-03 , Lowpass Filtering
- 数字图像处理实验(2):PROJECT 02-02, Reducing the Number of Gray Levels in an Image
- 数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors
- 数字图像处理实验(5):PROJECT 04-01 [Multiple Uses],Two-Dimensional Fast Fourier Transform
- 数字图像处理实验(6):PROJECT 04-02,Fourier Spectrum and Average Value
- 数字图像处理实验(9):PROJECT 04-05,Correlation in the Frequency Domain
- 数字图像处理实验(13):PROJECT 05-04,Parametric Wiener Filter
- 数字图像处理实验(4):PROJECT 02-04 [Multiple Uses],Zooming and Shrinking Images by Bilinear Interpolation
- 数字图像处理实验(3):PROJECT 02-03, Zooming and Shrinking Images by Pixel Replication
- 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators
- 数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter
- 数字图像处理实验(12):PROJECT 05-03,Periodic Noise Reduction Using a Notch Filter
- 数字图像处理实验(5):Proj03-01 ~ Proj03-06
- 基于深度学习的目标检测研究进展
- Android传感器 设备坐标系到世界坐标系的转换 分析以及应用
- 8、pcb绘制过程简介
- SWJTUOJ-2364 A room Problem(easy)
- thinkphp整合系列之苹果AppStore内购付款的服务器端php验证
- 数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation
- poj3349
- 9、铺铜铺地说明
- exists子查询真的就比连接查询慢吗?
- Hello world终于可以显示了
- 2017 计蒜之道 初赛 第三场
- 关于ros通信机制的浅谈
- 10、整体检查开板
- Qt-QML-关于两个平级的qml文件中的函数调用问题