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
Show older comments
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
Accepted Answer
More Answers (2)
lya lya
on 28 Nov 2015
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
on 3 Mar 2017
0 votes
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 Comment
Image Analyst
on 3 Mar 2017
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.
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!