- Negative Image
MATLAB CODE:
%Here the I am subtracting 255 from R,G and B.
A=imread('person.jpg');
imshow(255-A);
Original Image |
Negative Image |
- Sine Wave
First find the mid point of the RGB image.
Convert the points from Cartesian to polar co_ordinates
Find the sine value for the angle 'theta'
Again convert the points to Cartesian co_ordinates
SAMPLE CODE:x2=zeros([size(A,1) size(A,2)]);y2=zeros([size(A,1) size(A,2)]);for i=1:size(A,1)x=i-midx;for j=1:size(A,2)%Cartesian to Polar co-ordinates[theta1,rho1]=cart2pol(i,j-midy);phi=sin(theta1);%Polar to Cartesian co-ordinates[l,m]=pol2cart(phi,rho1);x2(i,j)=ceil(l)+midx;y2(i,j)=ceil(m)+midy;endend
Sine wave
Original Image |
0 comments:
Post a Comment