finding minimum value in Quanterion matrix
2 次查看(过去 30 天)
显示 更早的评论
I have a 386x514 quaternion array,in this please tell how to find the minimum value of that matrix
3 个评论
Matt J
2012-12-21
FIR Commented:
i downloaded [the quaternion] tool box from here
FIR Commented:
Sorry Matt my code [which doesn't work] is
A=imreadq('peppers.png');
T=65;
for i=2:6
for j=2:6
q= A(i-1:i+1,j-1:j+1);
[minsum, minidx] = min( sum(abs(bsxfun(@minus, q(:), q(:).'))) );
qVFM = q(minidx);
V1=an equation
V2=an equation
S=min([V1 V1]);
if S>T
THE CENTRE PIXEL IS REPLACED BY qVFM %%%%3x3 matrix
else
THE CENTRE PIXEL IS not REPLACED BY qVFM%%%%3x3 matrix
end
end
end
采纳的回答
Matt J
2012-12-21
编辑:Matt J
2012-12-21
BSXFUN isn't overloaded well in the quaternion toolbox that you're using. Here is a workaround
q= convert(A(i-1:i+1,j-1:j+1),'single');
[minsum, minidx] = min( sum(abs( repmat(q(:),1,9)-repmat(q(:).',9,1) ) ));
9 个评论
Walter Roberson
2012-12-22
Or, since that would affect the computations as you slid the window, create a second array and set the pixels in it -- as I showed you in one of your previous questions.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!