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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:31:00+00:00 2026-06-11T22:31:00+00:00

I need some help with RGB capture in a image. I am using impixel

  • 0

I need some help with RGB capture in a image.
I am using impixel to manualy get RGB from a picture, but i would like to create a grid of let’s say 20×20 px boxes where it will automatically tell me for each box a RGB value. So in a picture lets say i have 20 boxes it will tell me 20 RGB values. Yeah an if there is 20% or more of white space that it ignores that rgb box.

Can you point me to some links or give me a general idea how to do this.

Best regards

P.S. image is just a .jpg, the background is white an in the middle there is an item.

UPDATE

This is my code for collecting RGB using impixel

px=impixel(img);        
st = num2cell(px,1);
zstup = cellfun(@sum,st); 
zred = size(px,1);         
rez = bsxfun(@rdivide,zstup,zred); 
trez=round(rez); 

What I want to do is :

http://imageshack.us/photo/my-images/696/exsample.jpg/

So every box like A1, A2, and so on will return RGB value like trez in my code.

So in my code i save my trez data in a table and it is like in excell lets say 220 | 23 | 34, now if i do that to another fruit i will have

220 | 23 | 34

123 | 212| 78

and so on…

Returning to automatization, A7 and A 15 would not be good RGB canditades because they have more then 50% white area so everything that has 20% white will be ignored.
So A31 is good and the RGB value needs to be saved.

So all in all here i would have my be 6 RGB values that would have to be automatically saved like the above example.
I know how to save to table i just need help for the gathering rgb values in every box.

  • 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-06-11T22:31:01+00:00Added an answer on June 11, 2026 at 10:31 pm

    Depending on your exact needs I see two solutions:

    Downscale the image using impyramid(img, 'reduce'). This gives you a smaller image consisting of average values of the original image. Then do what you did before to access single pixels. Repeat as often as necessary to get 2×2, 4×4, 8×8 or larger “boxes”.

    Or you could use define a box (or arbitrary shape) as a matrix of ones and zeros and use the regionprops function in order to get information about the images content depending on the fields containing ones:

    roi = zeros(size(img))
    roi(1:10,1:10) = 1;
    r = regionprops(roi, img, 'MeanIntensity')
    average = r.MeanIntensity
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need some help with retrieving information+Profile pic from twitter using php , i wanted
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some help joining these two tables I have two views that looks like
Need some help from Oracle app developers out there: I have an C#.NET 4.0
Need some help with putting this query together. I'm using Mysql I have two
need some help from a regex jedi master: If I have a string of
Need some help guys. For now, I can successfully get a single user timeline
Need some help designing a bash script for grepping IP addresses from auth.log and
I need some help. I want to generate numbers.But my numbers repeated. how can
I need some help with a binding error I'm getting from a style on

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.