Can anyone please help with a question in relation with RGB image ?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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
OCDER
on 19 Jun 2018
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?
Sofia Moussaid
on 19 Jun 2018
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.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!