How can I take the rgb value of an image and color correct to an original rgb value?

Technical Source
2 min readJun 9


I am needing to write a code that takes the rgb value of a reference square in an image, and color correct it to the orginal rgb value of the reference square.

I will have various images with this reference square that will change colors depending on how the sunlight hits it, so I need to correct the whole image back to the original color. Is there a code that can be written to do this?

Additionally, I mainly am focused on the blue values, but how will the change in values be stored?

NOTE:- provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

You forgot to attach your reference image and the image that needs correction.

Basically you need to segment the image to find the square in both images, then assign the reference image colors to the test image. Assuming you’ve done the segmentation and have the square masks, you then do this.

% Split test and reference image into component color channels.
[rTest, gTest, bTest] = imsplit(testImage);
[rRef, gRef, bRef] = imsplit(refImage);
% Assign mean color from ref image to test image, but only in the square region.




Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.