Filter löschen
Filter löschen

Calculate Dominant wavelength in CIE 1931

36 Ansichten (letzte 30 Tage)
nesrine merabti
nesrine merabti am 27 Apr. 2023
Beantwortet: Supraja am 5 Mai 2023
I did program for get the dominant wavelength from CIE1931 diagram, Now I need mathematic demonstration of dominant wavelegth formula "dominant_wavelength = 580 + (300*x) + (700*y)".
Can any one help me for that.

Antworten (1)

Supraja
Supraja am 5 Mai 2023
You can use the below function:
function varargout=dp2xy(varargin)
%DP2XY Calculate chromaticity from dominating wavelength and spectral purity.
% XY=DP2XY(DP,CWF) with size(DP)=[M N ... P 2] returns
% matrix XY with same size.
%
% XY=DP2XY(D,P,CWF) with size(D,P)=[M N ... P] returns
% matrix XY with size [M N ... P 2].
%
% [X,Y]=DP2XY(DP,CWF) with size(DP)=[M N ... P 2] returns
% matrices X and Y, each with size [M N ... P].
%
% [X,Y]=DP2XY(D,P,CWF) with size(D,P)=[M N ... P]
% returns equally sized matrices X and Y.
% CWF is a color weighting function specification. It can be a string,
% e.g. 'D50/2', or a struct, see MAKECWF. If omitted or empty, the
% default cwf, DCWF is used.
%
% Example:
% Show the locus of xy with the spectral purity = 0.5 in the chromaticity plane
%
% lam=linspace(380,720,20);
% [x,y]=dp2xy(lam,.5*ones(size(lam)));
% plot(x,y, 'LineWidth', 2)
% hold on
% helmholtz
% hold off
% axis equal
%
% See also: I_DP2XY, XY2DP, MAKECMF, OPTGETPREF
% Part of the OptProp toolbox, $Version: 2.1 $
% Author: Jerker Wågberg, More Research & DPC, Sweden
% Email: ['jerker.wagberg' char(64) 'more.se']
% $Id: dp2xy.m 23 2007-01-28 22:55:34Z jerkerw $
varargout=cell(1,max(1,nargout));
[err,varargout{:}]=optproc([2 0 1 0 0],1,@i_dp2xy,varargin{:});
error(err);
For additional reference you can follow the link given below:
https://www.mathworks.com/matlabcentral/fileexchange/13788-optprop-a-color-properties-toolbox?s_tid=srchtitle_wavelength%20calculation%20of%20cie1931_1

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by