Dear Stephane,
thanks for your help.
I think in my case the problem is solved just by using:
[Minstances_hat] = unique(B(:));
This gives a vector of used px-values for different objects shown in image.
Each object is defined by a single pixel value.
Since B is the B-plane of an RGB-image, it is
Sorry, in my answer the loop constructs "ic", not "ia", i.e. the full
equivalent to Matlab's "[C,ia,ic] = unique(A)" is in Scilab:
[C,ia] = unique(A)
for i=1:length(A)
ic(i)=find(A(i)==C)
end
S.
Le 16/10/2019 à 13:19, Stéphane Mottelet a écrit :
Sorry, I thought you were just asking
Sorry, I thought you were just asking about the tildas, not the syntax
of unique() in Scilab.
Please see
https://help.scilab.org/docs/6.0.2/en_US/unique.html
vs
https://fr.mathworks.com/help/matlab/ref/unique.html
Matlab syntax [C,ia,ic] = unique(___) with 3 outputs has no equivalent
in
[ans,ans,Minstances_hat] = unique(B(:));
gives: Wrong number of output arguments.
I also tried :
[Minstances_hat] = unique(B(:));
and get a vector.
also
[Minstances_hat,index] = unique(B(:));
seem to work.
However afterwards there is this line:
masks = reshape(Minstances_hat-1,size(B));
Hello
Le 16/10/2019 à 11:46, P M a écrit :
Dear experts,
trying to convert a matlab code to scilab I come across following line:
[~,~,Minstances_hat] = unique(B(:));
How to replace the "~" symbol?
by dummy names, e.g.
[ans,ans,Minstances_hat] = unique(B(:)); There is no equivalent
Dear experts,
trying to convert a matlab code to scilab I come across following line:
[~,~,Minstances_hat] = unique(B(:));
How to replace the "~" symbol?
B is the blue channel of a RGB image...hence a m x n matrix of
integers (type(B) = 8 )
Thank you,
Philipp