Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Machine Vision, Color Problem Hello. i am thinking of how to approach the above

ID: 3780313 • Letter: M

Question

Machine Vision, Color Problem

Hello. i am thinking of how to approach the above question. Here is some through process thus far:

XYZ is some huge space of color. RGB is a subset. I can figure out coordinates that correspond to primaries: red, blue, green extremes in XYZ, multiple them by the T and this is my p(y) coordinate set. This is where i am stuck. I thought a color function is something that takes spectral input (light that hits our eyes) and tells us how to weight primaries (extreme red, extreme green, extreme blue) to get a match that we can see.

I am not attaching the data provided with this problem set, because I want to code it myself, but I really need help understanding the relationship between primaries, color functions, input spectrum. I don't understand how to derive color functions from the transformation matrix.If you could tell me the approach for this problem and the underlying theory, that would help me a lot. The notes for this class are cryptic and do not address this in detail. Getting started help will be much appreciated.

In the comments, someone said that image was not clear, so I am attaching another image:

Problem For this problem you should use Matlab for computations and plotting. We say that a set of primaries, pi(A) is associated with a set of color matching functions, ci(A) if the spectrum s (A) is a perceptual match to Xi pi(A) ci (A1)s(A1)) in words, we project an input spectrum onto the color matching function associated with each primary to determine the amount of that primary needed to give a perceptual match to the input spectrum. In all data provided in this example, the data points are sampled at wavelengths B60:5 730nm. (a) We can transform the color coordinate in CIE XYZ space to RGB space using a transfor- mation matrix T 1.54 -0.50 x Y where -0.97 1.88 0.01 0.06 -0.207 1.06 Using the transformation matrix T (CIE2RGB.mat) and the color matching func- tions for CIE XYZ color space (CIEMatch.mat), compute the color matching functions associated with those specified by RGB primaries. (ii) Find a valid set of primary light spectra associated with the RGB color space. Plot them as function of wavelengths. Comment on the positivity of the power spectra. (iii) Find a valid set of primary light spectral associated with the CIE color space. Plot them as a function of wavelengths. Comment on the positivity of the power spectra. (b) Figure 1 shows the spectral response curves for eye photoreceptors (we have also provided the response curves in LMSResponse.mat Find a set of primary lights that correspond to the spectral sensitivity curves of the eye. Comment on the positivity of the power spectra.

Explanation / Answer

function [R,G,B, RGB] = XYZ_spectrum_converter(spectrum, Lambda, x, y, z)

R=0;G=0;B=0;

tempFunDel = (spectrum(end,1)-spectrum(1,1))/length(spectrum);

for i=1:length(spectrum)
[~, j] = min(abs(spectrum(i,1)-Lambda));
fx=0;fy=0;fz=0;

% linear interpolation of lambda value
if (spectrum(i,1)-Lambda(j))>0 && j~=length(Lambda)
fx=x(j)+(x(j+1)-x(j))/(Lambda(j+1)-Lambda(j))*(spectrum(i,1)-Lambda(j));
fy=y(j)+(y(j+1)-y(j))/(Lambda(j+1)-Lambda(j))*(spectrum(i,1)-Lambda(j));
fz=z(j)+(z(j+1)-z(j))/(Lambda(j+1)-Lambda(j))*(spectrum(i,1)-Lambda(j));
end

if (spectrum(i,1)-Lambda(j))<=0 && j~=1
fx=x(j)+(x(j)-x(j-1))/(Lambda(j)-Lambda(j-1))*(spectrum(i,1)-Lambda(j));
fy=y(j)+(y(j)-y(j-1))/(Lambda(j)-Lambda(j-1))*(spectrum(i,1)-Lambda(j));
fz=z(j)+(z(j)-z(j-1))/(Lambda(j)-Lambda(j-1))*(spectrum(i,1)-Lambda(j));
end

% calculating integral
R=tempFunDel*fx*spectrum(i,2)+R;
G=tempFunDel*fy*spectrum(i,2)+G;
B=tempFunDel*fz*spectrum(i,2)+B;
end

M=[0.41847 -0.15866 -0.082835; -0.091169 0.25243 0.015708; 0.00092090 -0.0025498 0.17860];
RGB = M*[R;G;B];
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote