Can anyone please help with a question in relation with RGB image ?

I've been struggling with this question and I don't how to solve it I need to modify the image to reveal a band of height H at the top, whose color corresponds to the average color on this same band on the original image . Any ideas?

2 Comments

Seems like a class hw or test question. What codes do you have so far? Is the question confusing, or would you like hints about what matlab functions to use?
The question is confusing. It's a practice exercice.

Answers (1)

I can try to interpret that in the context of matlab:
1. Open the image using imread. Should get a MxNx3 matrix.
Im = imread('your_image_file_name.jpg')
2. Modify the top H rows of the image accordingly
-use "mean" to get the average R, G, B values of the top H rows of the image
mean(mean(Im(xrange, yrange, zrange), 1), 2)
-replace all the pixels in the top H rows with the average values for R, G, and B
the red channel should be the mean of all red in the top H rows
the green channel should be the mean of all green in the top H rows
the blue channel should be the mean of all blue in the top H rows
3. Your resulting image should have a band at the top of average RGB values

This question is closed.

Products

Release

R2017b

Asked:

on 19 Jun 2018

Closed:

on 20 Jun 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!