Reputation: 111
I have a 112x92 image, img.jpg, say. I would like to have several images that look-alike with it. Is it possible to be done using matlab? What I have tried was as follow:
A=imread(img.jpg)
It will give 112x92 uint8 matrix
I tried to add A
with some uint8 matrix B
. However, I didn't get what I wanted. Could anyone help me please? I am really newbie in image processing
Upvotes: 1
Views: 64
Reputation: 3574
Not sure of exactely what you are after, but here are a few things to get you strated:
I=imread('peppers.png');
Rotation:
rotI=imrotate(I, 45, 'crop');
Added noise:
noisyI=imnoise(I, 'salt & pepper', 0.3);
Directional shear:
tform = affine2d([1 0 0; .3 1 0; 0 0 1]);
shearedI = imwarp(I,tform);
Projective distortion:
theta = 1;
tform = projective2d([cosd(theta) -sind(theta) 0.001; sind(theta) cosd(theta) 0.001; 0 0 1]);
projI = imwarp(I,tform);
Upvotes: 3