Can anyone help me to find "Maximal Correlation Coefficient"?(Square root of second largest eigenvalue) This is the 14th feature of the Harlick Texture Features. I just need to calculate it out of those features. Can i get a piece of code for it?
4 ビュー (過去 30 日間)
古いコメントを表示
a=rgb2gray(imread('IM_0524-Frame1.jpg'));
a=im2double(a);
counter=1;
[row,col]=size(a);
for i =2:1:2
for j=2:1:2
temp= a(i-1:i+1, j-1:j+1);
offset1 = [0 0];
offset2 = [1 1];
offset3 = [0 1];
offset4 = [-1 1];
%glcm1=graycomatrix(temp,'numlevels',256,'offset',[0 1]);
glcm1 = graycomatrix(temp,'offset',offset1);
% Need to calculate Maximal correlation coefficient for glcm1.
end;
end;
4 件のコメント
Bryan Redd
2019 年 11 月 5 日
Did you ever figure this out? I am also looking for the code to calculate the fourteenth feature. I would like to check my work.
Walter Roberson
2019 年 11 月 5 日
Is it "second largest" according to absolute value? What if there is a tie?
temp = eigs(A, [], 2, 'largestabs');
result = sqrt(temp);
回答 (1 件)
Pawel Badura
2022 年 9 月 30 日
編集済み: Pawel Badura
2022 年 9 月 30 日
If you use dr Pierce's PORTS package (https://www.mathworks.com/matlabcentral/fileexchange/55587-ports-3d-image-texture-metric-calculation-package?s_tid=prof_contriblnk), just update the compute_GTSDM_metrics.m script by adding the following code below line 258:
% (14) Maximal Correlation Coefficient
%%% I don't think we use it, so I'll only code it up if needed.
%% ADDED BY PB: 2022-09-30 %%%
Q = zeros(size(p));
p_x0 = max(p_x, 1e-10); % just to make sure there's no division-by-0 later
p_y0 = max(p_y, 1e-10); % just to make sure there's no division-by-0 later
for i=1:N_g
for j=1:N_g
Q(i,j) = sum((p(i,:) .* p(j,:)) ./ (p_x0(i) * p_y0'));
end
end
MCC = eigs(Q, 2);
metrics_vect(14) = sqrt(MCC(2));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!