I have an RGB image in MATLAB, and I want to loop through each pixel and check if it’s skin coloured (ish) [I will probably do it in HSV space at a later point to negate the effects of lighting etc.]
Does anyone know the best way to do this? MATLAB’s weird syntax is confusing me a little!
At the moment I have:
for x = 1:size(I,1) for y = 1:size(I,2) %Get the value from this x,y coordinate and check the colour. end end
But I think that's horribly wrong.
How do you access the different parts of the matrix correctly?
Ed,
You do not need to loop:
You can see how this statement could be expanded for RGB and such. I would make a function
function out = isFlesh(in)
%% put flesh checking code here
I suspect you are going to want a range of these (isCaucasian, isAsian, etc…) The problem is going to be that there is a huge range of flesh colors, so you are going to want to check for proximity to neighbors of a similar color range.
This part of the problem is easy, but the larger problem is fraught with peril.
-Doug