Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 153729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:51:10+00:00 2026-05-11T09:51:10+00:00

I have an RGB image in MATLAB, and I want to loop through each

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:51:10+00:00Added an answer on May 11, 2026 at 9:51 am

    Ed,

    You do not need to loop:

    >> a  = magic(5)  a =      17    24     1     8    15     23     5     7    14    16      4     6    13    20    22     10    12    19    21     3     11    18    25     2     9   >> vi = (a > 5) & (a < 10)  vi =       0     0     0     1     0      0     0     1     0     0      0     1     0     0     0      0     0     0     0     0      0     0     0     0     1 

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine you have an RGB image and want to process every pixel: import numpy
Using OpenCV. I have an RGB image, each value is a float. I also
I have an RGB image of size 412x550 . I want to divide it
I have a RGB image and want to apply following formulas to it so
I have an RGB image. I want to convert it to numpy array. I
i have converted an image from RGB to B/W then i want to convert
In matlab: I have an RGB image 'img'. if I write : tmpImg=imhist(img); I
I have a greyscale image which was created from a RGB image using farmula:
I have an array of integers which represent a RGB image and would like
Or say does 1 denotes white for an RGB image? I have this question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.