Friday, May 5, 2017

Image processing with Matlab : (3)(create function,Binary photo,Crop image,Rotate)



  • Create function in Matlab 


function [ output_args ] = functionName( input_args )

imshow(input_args);


end

















  • Automatic alignement of code lines in editor, do EDIT->Select ALL, then TEXT -> Smart INDENT
  • Create Own Photo (Binary)
col=256;

row=256;
img=zeros(row,col);
img(100:100,:)=1.5;
img(:,100:100)=1.5;
imshow(img);




















  • Crop an Image 



a=imread('abc.jpg');

i=imcrop(a);
imshow(i)



  • rotate an image in Matlab and Subplot
a= imread ('abc.jpg');
i = imrotate(a,180,'bilinear');
i2 = imrotate(a,45,'nearest');
subplot(2,1,1)
imshow(i)
subplot(2,1,2)
imshow(i2)



No comments:

Post a Comment