Basic image processing functions:
The 'imread()' command will read an image into a matrix: example : img = imread(abc.jpg);

- Size of an Image : size()

example: size(img) It's a 340x650 matrix with 3 RGB channels. 

- Display an image: imshow()
To show our image, we will use imshow() command.example : imshow(img) - Export an Image : imwrite()
imwrite(img,'s.png','png'); 
- Clear the 'command window' in MATLAB? : clc
We can clear our MATLAB's 'command window' by using this command- imaqhwinfo()
This will return the information about all the adaptors available on the system.
- vid = videoinput ('winvideo',1);
- preview (vid)
Suppose you want to preview your webcam then type

- vid=videoinput('winvideo',1);
- I=getsnapshot(vid);
- save data
Take photos from your webcam - vid=videoinput('winvideo',1);
- for i=1:10
I=getsnapshot(vid);
Fname=['Image',num2str(i),'.jpg'];
imwrite (I,Fname,'jpg');
pause(1);
endTake 10 photos from the webcam and rename them in your formate
- Create a function in Matlab
function [ output_args ] = functionName( input_args )
imshow(input_args);
end
- Automatic alignment 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');

- imaqhwinfo()
This will return the information about all the adaptors available on the system.
- vid = videoinput ('winvideo',1);
- preview (vid)

- vid=videoinput('winvideo',1);
- I=getsnapshot(vid);
- save data
Take photos from your webcam
- vid=videoinput('winvideo',1);
- for i=1:10
Fname=['Image',num2str(i),'.jpg'];
imwrite (I,Fname,'jpg');
pause(1);
end
Take 10 photos from the webcam and rename them in your formate

- Create a function in Matlab
imshow(input_args);
end
- Automatic alignment 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');


No comments:
Post a Comment