Я хочу сделать эти серые изображения цветными, чтобы я мог наблюдать хроматическую адаптацию
Другое дело, как применить преобразование Брэдфорда к изображениям (чтобы умножить изображение на матрицу Брэдфорда
Mbfd = [.8950 .2664 -.1614;
-.7502 1.7135 .0367;
.0389 -.0685 1.0296])
Я знаю, что мне нужно умножить входное изображение на матрицу Брэдфорда, но я не знаю, как именно это сделать.
I=imread('snimka.jpeg');
figure(1), imshow(I);
srgb2lab_byA = makecform('srgb2lab', 'AdaptedWhitePoint',whitepoint('a'));
srgb2lab_byD50 = makecform('srgb2lab', 'AdaptedWhitePoint',whitepoint('d50'));
srgb2lab_byD55 = makecform('srgb2lab', 'AdaptedWhitePoint',whitepoint('d55'));
srgb2lab_byD65 = makecform('srgb2lab', 'AdaptedWhitePoint',whitepoint('d65'));
lab_A = applycform(I,srgb2lab_byA);
lab_D50 = applycform(I,srgb2lab_byD50);
lab_D55 = applycform(I,srgb2lab_byD55);
lab_D65 = applycform(I,srgb2lab_byD65);
% figure;
figure();
subplot(2,2,1), imshow(lab_A(:,:,1)); title('sRGB to Lab by adapting to illuminant A');
subplot(2,2,2), imhist(lab_A(:,:,1)); title('Histogram of the red channel');
subplot(2,2,3), imhist(lab_A(:,:,2)); title('Histogram of the green channel');
subplot(2,2,4), imhist(lab_A(:,:,3)); title('Histogram of the blue channel');
figure();
subplot(2,2,1), imshow(lab_D50(:,:,1)); title('sRGB to Lab by adapting to illuminant D50');
subplot(2,2,2), imhist(lab_D50(:,:,1)); title('Histogram of the red channel');
subplot(2,2,3), imhist(lab_D50(:,:,2)); title('Histogram of the green channel');
subplot(2,2,4), imhist(lab_D50(:,:,3)); title('Histogram of the blue channel');
% luminance_diff=abs(lab_A(:,:,1)-lab_D50(:,:,1));
figure();
subplot(2,2,1), imshow(lab_D55(:,:,1)); title('sRGB to Lab by adapting to illuminant D55');
subplot(2,2,2), imhist(lab_D55(:,:,1)); title('Histogram of the red channel');
subplot(2,2,3), imhist(lab_D55(:,:,2)); title('Histogram of the green channel');
subplot(2,2,4), imhist(lab_D55(:,:,3)); title('Histogram of the blue channel');
figure();
subplot(2,2,1), imshow(lab_D65(:,:,1)); title('sRGB to Lab by adapting to illuminant D65');
subplot(2,2,2), imhist(lab_D65(:,:,1)); title('Histogram of the red channel');
subplot(2,2,3), imhist(lab_D65(:,:,2)); title('Histogram of the green channel');
subplot(2,2,4), imhist(lab_D65(:,:,3)); title('Histogram of the blue channel');