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 6968529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:27:48+00:00 2026-05-27T16:27:48+00:00

I just start to try MATLAB Project. I used to separate the Red, Green

  • 0

I just start to try MATLAB Project. I used to separate the Red, Green and Blue colors.
This is my function:

function x = colorsep(b) %
n = 256; % color is from 0->255, so it has 256
a = imread('peppers.png');


b=im2uint8(a);
x=figure; % create picture to put the image


subplot(2,2,1); %(2 rows, 2column, cell ti 1)
imshow(b),title('Full Color');


colorlist = {'Red','Green','Blue'};


gr = 0:1/(n-1):1;


for k=1:3

    cMap = zeros(n,3);
    cMap(:,k) = gr;
    subplot(2,2,k+1);
    imshow(ind2rgb(b(:,:,k),cMap)); %ind2r = index to rgb
    title(colorlist{k});
end
end    

Now I want to separate three color ( Pink, Yellow, Orange), what will I do? Anyone know about this? Thanks so much.

  • 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. Editorial Team
    Editorial Team
    2026-05-27T16:27:48+00:00Added an answer on May 27, 2026 at 4:27 pm

    The question is incorrect. An image in the computer consists of 3 color channels

    • Red
    • Green
    • Blue

    What you are doing here is showing a single channel, with a colormap that corresponds to it.
    By the way, the colormap is unnessecary, and you can show it like that (More natural)

    function colorsep() %
        a = imread('peppers.png');
        colorlist = {'R','G','B'};    
        subplot(2,2,1);
        imshow(a);
        for k=1:3
            subplot(2,2,k+1);
            imshow( a(:,:,k));
            title(colorlist{k});
        end
    end
    

    enter image description here

    If you want to separate it in another color space, you should first transform it to another color space – like LAB, and then show the channels separately.

    If you want to find all “pink”,”yellow” objects, you should do a segmentation, and check objects mean color.

    Please clarify what exactly you want.

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

Sidebar

Related Questions

I have just reinstalled LAMPP. When I try starting LAMPP using /opt/lampp/lampp start ,
I'm not sure exactly how to explain this, so I'll just start with an
I have just start reading Let over lambda and I thought I would try
I installed PyScript to try it out but it just wont start. It only
Does this cause a race condition with MySQL (InnoDB): Start Transaction. Try to get
I just start to try out my Hello World app development on Bada. I
I've just started experimenting something with Matlab, and since I'm used to Vim's interface,
I just start using jqgrid, but when I try the most simple example (loading
This is the message I receive always (100%) if I try to start the
I try to write a matlab function that upsamples me a picture (matrix of

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.