|
From: | Ming Liu |
Subject: | Re: Google Summer of Code Project |
Date: | Fri, 12 Apr 2013 14:53:46 +1000 |
close all; clc; clear;
he = imread('a_picture.png');
figure; subplot(2,4,1); imshow(he), title('H&E image');
% Color Space Conversion MATLAB
% RGB -> XYZ
he = double(he);
R = he(:,:,1)/255;
G = he(:,:,2)/255;
B = he(:,:,3)/255;
R(R > 0.03928 ) = ((R(R > 0.03928 ) + 0.055 ) ./ 1.055 ) .^ 2.4;
G(G > 0.03928 ) = ((G(G > 0.03928 ) + 0.055 ) ./ 1.055 ) .^ 2.4;
B(B > 0.03928 ) = ((B(B > 0.03928 ) + 0.055 ) ./ 1.055 ) .^ 2.4;
R(R <= 0.03928 ) = R(R <= 0.03928 ) ./ 12.92;
G(G <= 0.03928 ) = G(G <= 0.03928 ) ./ 12.92;
B(B <= 0.03928 ) = B(B <= 0.03928 ) ./ 12.92;
X = R .* 0.4124 + G .* 0.3576 + B .* 0.1805;
Y = R .* 0.2126 + G .* 0.7152 + B .* 0.0722;
Z = R .* 0.0193 + G .* 0.1192 + B .* 0.9505;
subplot(2,4,2);imshow(X);title('X');
subplot(2,4,3);imshow(Y);title('Y');
subplot(2,4,4);imshow(Z);title('Z');
%XYZ -> LAB
xyz = whitepoint('d65'); %X/Xn Y/Yn Z/Zn
X = X./xyz(1);
Y = Y./xyz(2);
Z = Z./xyz(3);
%Calculate L
L = Y;
L(L > 0.008856) = 116 * L(L > 0.008856).^(1/3) - 16;
L(L<= 0.008856) = 903.3 * L(L<= 0.008856) ;
X(X > 0.008856) = X(X > 0.008856) .^ (1/3);
Y(Y > 0.008856) = Y(Y > 0.008856) .^ (1/3);
Z(Z > 0.008856) = Z(Z > 0.008856) .^ (1/3);
X(X<= 0.008856) = 7.787 * X(X <= 0.008856) + 4/29;
Y(Y<= 0.008856) = 7.787 * Y(Y <= 0.008856) + 4/29;
Z(Z<= 0.008856) = 7.787 * Z(Z <= 0.008856) + 4/29;
a = 500 * (X - Y) + 128; a = uint8(a);
b = 200 * (Y - Z) + 128; b = uint8(b);
L = L*255/100; L = uint8(L);
subplot(2,4,6);imshow(L);title('L');
subplot(2,4,7);imshow(a);title('a');
subplot(2,4,8);imshow(b);title('b');
lab_he = uint8(he);
lab_he(:,:,1) = L;
lab_he(:,:,2) = a;
lab_he(:,:,3) = b;
subplot(2,4,5);imshow(lab_he);title('H&E Lab');
On Thu, Apr 11, 2013 at 5:53 AM, Ming Liu <address@hidden> wrote:Dear patrick,I am Ming Liu, a postgraduate student in the Australian National University. I am interested in the GNU Octave project "Color management functions in image package". I have some relative background about this. May I participate in this project?Kind regards,Ming LiuHi Ming,Thank you for your interest. I am copying the octave-maintainers list. Please CC the list for future correspondence on this project.Can you please describe your experience with Octave and/or ICC profiles? What is your experience with using m-files and C++ programming? Have you tried building Octave from source?This project will likely involve incorporating the littlecms library into Octave, and providing an octave interface that matches the Matlab interface for the relevant functions (iccread, iccwrite, applycform, makecform). The primary function in littlecms for applying color transforms is the cmsDoTransform function. The littlecms library and documentation are available at http://www.littlecms.com/.You will need to provide the ability to perform color transforms between at least the following color spaces:CMYK <--> L*a*b* (using any 1 of 4 rendering intents contained within a "print" ICC profile)L*a*b* <--> XYZL*a*b* <--> sRGBL*a*b* <--> RGB (using an "RGB" profile)The more info you can provide about your experience and interest will only help to make your submission stronger.Thanks,Patrick
[Prev in Thread] | Current Thread | [Next in Thread] |