Given an image with a colored object in it i need a code to display the name of the colored object in it as a text under the image. Thanks in advance
이전 댓글 표시
I get an image with a camera for example then imread it and this image have a colored object it for example a green or purple ball the output should be in text under the picture for example : Purple. Please i need a matlab code for this and Thanks in advance
채택된 답변
추가 답변 (2개)
lya lya
2015년 11월 28일
Hello,
I'm currently working on detecting colors in an image. For example, given an image that have multiple colors, and text will appear to indicate or to show each region color by displaying the color names.
I've work on HSV color space, and represent them in Fuzzy set operation.
close all; clc; clear all
img='Peppers2.bmp';
OrigImg=imread(img); % reading the image
HSVimg=(rgb2hsv(OrigImg)); % RGB->HSV conversion
Himg=(HSVimg(:,:,1)); % extracting the hue component, between [0,1]
H=(Himg*255); % normalizing to [0, 255]
% computation of the membership degree of each pixel, to each fuzzy set
RedH_l=trimf(H, [0 0 21]);
RedH_r=trimf(H, [234 255 255]);
RedH=max(RedH_l, RedH_r);
OrangeH=trimf(H, [0 21 43]);
YellowH=trimf(H, [21 43 80]);
GreenH=trapmf(H, [43 80 90 128]);
CyanH=trimf(H, [90 128 165]);
BlueH=trapmf(H, [128 165 175 191]);
PurpleH=trimf(H, [175 191 213]);
PinkH=trimf(H, [213 234 255]);
I only managed to perform the coding until here. I am not sure whether I should put in the membership function for saturation (S) and value (V) component.
For displaying image, just appear the original image and add text to indicate the color names inside the image.
Your assistance and guide are very much appreciated.
Ankith Jain Rakesh Kumar
2017년 3월 3일
0 개 추천
can anyone let me know how to find skin tone of a person after detecting skin from a person's body? If you have any code for it can you share it.
댓글 수: 1
Image Analyst
2017년 3월 3일
Start a new question for this. And let us know if you have RGB, or calibrated LAB values for skin color and whether the "tone" is the Fitzpatrick Scale.
카테고리
도움말 센터 및 File Exchange에서 Color Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!