Jlamprong
Jlamprong

Reputation: 111

Making several "look-alike" images using matlab

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

Answers (1)

Cape Code
Cape Code

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');

image 1

Added noise:

noisyI=imnoise(I, 'salt & pepper', 0.3);

image 2

Directional shear:

tform = affine2d([1 0 0; .3 1 0; 0 0 1]);
shearedI = imwarp(I,tform);

image 3

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);

image 4

Upvotes: 3

Related Questions