日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation

發布時間:2025/3/21 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

實驗報告:

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:Mfor j = 1:Nsd = sd + (R1(i, j) - R1_ave) * (R1(i, j) - R1_ave);end end R1_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');

實驗結果:

從顏色分割的結果來看,白色部分主要為草莓的那部分區域,也正好是我們所要區分的紅色的區域。

總結

以上是生活随笔為你收集整理的数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。