It is easier to do this in
HSV color space than
RGB color space.
first image(the pinky one) is imported into matlab workplace as
variable A,and the
second(the yellowish one) as
First, I removed the white margin of both A and B with a same Rect:
Rect=[82.51 32.51 511.98 509.98]; % I found this with [~,Rect]=imcrop(A);
I am going to find a simple way to transform image A_c to B_c in HSV color space;
Read the wikipedia page of HSV.. you will find that most different parts between the two images must be in the
Hue parts,i.e, between
And the average difference between their hues is:
I just used the hue parts in my transform:
A_c_hsv_transformed=A_c_hsv; % make a copy of A_c_hsv
A_c_hsv_transformed(:,:,1)=A_c_hsv_transformed(:,:,1)+ave_dif_in_hue; % change the hue parts only
let's check our transform:
subplot(1,3,3);imshow(hsv2rgb(A_c_hsv_transformed));title('transformed from A_c');
here is the result:
you can optimize the transform further, with dealing with the other two channel in HSV color space..
Or.Maybe something more needed.