Thursday, June 03, 2004

Several Matlab commands

1. pixval shows the cursor on the last image displayed.
2. im2unit8, im2unit16, im2double, im2bw, mat2gray(A, [Amin, Amax]), A is double.
3. fp = f(end:-1:1, :); flipped image f vertically
4. for q =0:5:100
filename = sprintf('series_%3d.jpg', q);
imwrite(f, filename, 'quality', q);
end
5. use stopwatch timer:
tic % start timing
.......
t1=toc; % end timing
5. I/O. disp(argument) to display information on the screen. disp('sdjfaksjfasdf');
input: t=input('enter your data:', 's')
class(t) , ans=char.
str2num(t), strcmp(s1,s2), return 1 or 0.
6. g=imadjust(f, [low_in high_in], [low_out high_out], gamma), map the intensity in image f to new image g, values between lowin and highin map to lowout and highout. imadjust(f, [0 1],[1 0]) get negative image. imcomplement(f) can do negative too.
7. fftshift can be used to move the origin of the transform to the center of the frequency rectangle. : Fc=fftshift(F); imshow(abs(Fc), []); S2=log(1+abs(Fc)); imshow(S2,[]); also, ifftshift() is available.

No comments:

Post a Comment