# I'm unable to understand from matlab documentation as im not good at basics ,so please say the explanation of the syntaxes that I enter below in simple words for exam viva.

2 ビュー (過去 30 日間)
Naren B 2022 年 5 月 16 日
コメント済み: Steven Lord 2022 年 5 月 19 日
a=size(img);
thresh=multithresh(img,7);
Iresize1=imresize(A,0.5,'bilinear');
[I256,map256]=gray2ind(A,256);
B= imcomplement(A);
F=im2double(A);
L1=1*log(1+F);
J(abs(J)<1)=0;
L=histeq(I);
BW=im2bw(b,level);
y=bwdist(x);
i=label2rgb(l,'copper','w');

サインインしてコメントする。

### 採用された回答

Image Analyst 2022 年 5 月 16 日
This code was written by someone who doesn't know what they are doing and are very inexperienced in image processing. I recommend you don't look to them anymore for good coding or algorithms. Nonetheless, I've added comments.
a=size(img);
% Get a set of threshold to segment this image.
thresh=multithresh(img,7);
% Resize the image. Cut its size down by half.
Iresize1=imresize(A,0.5,'bilinear');
% The next two lines are useless for several reasons.
[I256,map256]=gray2ind(A,256);
B= imcomplement(A);
% Stretch the contrast. Again, most likely unnecessary.
% Convert to double so we can do math on it and retain precision.
F=im2double(A);
% Transform the image by taking the natural log of it.
L1=1*log(1+F);
% Set any pixels with a value less than 1 to zero, probably to compress the
% range and ignore any -infinity values.
% Will throw an error because J is not defined.
J(abs(J)<1)=0;
% Do a locally adaptive contrast stretch so that image looks good everywhere.
% Then throw away or ignore G.
% Do a histogram equalization. Another totally useless thing they're doing.
% Also will throw an error because (the badly-named) I was never defined.
L=histeq(I);
% Binarize the function into foreground and background.
% Also will throw an error because level and b were never defined.
BW=im2bw(b,level);
% Compute the Euclidean Distance transform which is an image where the
% pixel value is the distance to the edge of the nearest blob.
% Useless because y is never used, and x is not defined and will throw an
% error.
y=bwdist(x);
% Get an RGB image where every blob has a different color.
% Store the RGB image in the badly named i, which is normally sqrt(-1).
% Will throw an error because the labeled image, the badly-named l,
% was never defined, like with bwlabel().
i=label2rgb(l,'copper','w');
##### 10 件のコメント表示非表示 9 件の古いコメント
Steven Lord 2022 年 5 月 19 日
In addition to @Image Analyst's suggestion, I suggest you start with the free MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
This should give you a foundation (the "basics" as you phrased it) so you can focus on understanding more specifics around what individual functions do and how they are combined to solve problems.

サインインしてコメントする。

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by