Sie sind auf Seite 1von 5

Zendie Monea B.

Sollano 5 BSECE-A

July 16, 2012

% Write a Matlab program to manipulate the pixels of ImgA to create a mirror image effect in the x-direction, also create a mirror image effect of ImgB in the y-direction.

function ImageManipulationByZendie = reflection(ImgA,L) ImgA = imread ('face.gif'); [x y z]=size(ImgA); Zend =zeros(x,y,z); Zend(:,255+1:y,:)=ImgA(:,1:y-255,:); Zend(:,1:256,:)=ImgA(:,256:-1:1,:); Zend=uint8(Zend); image1 = [ImgA Zend]; figure, imshow(image1); ImgB =imread('face1.bmp'); Zendie =imfinfo('face1.bmp') Zee =ImgB(end:-1:1, :); image2 = [ImgB Zee]; figure, imshow (image2); end

%Simple image blending (with 100% overlap) can be accomplished by linear combination of the gray level values of two images Where 0 1.The value of determines the amount of contribution of the input images to the final output g(x,y). Implement an image blending routine in Matlab to blend your chosen input images, use = 0.5. Try other values of to determine the correctness of your blending implementation, i.e. is your output image correct if =0 and if = 1.
function exercise3b

clc clear all close all a =imread ('face.gif'); b =imread ('face1.bmp'); b = imresize(b, [256 256]); [m n] =size (a); alpha1=0.5; alpha2=1; alpha3=0; for x=1:m for y=1:n g1 (x,y)= alpha1* a(x,y) + (1-alpha1)* b(x, y); g2 (x,y)= alpha2* a(x,y) + (1-alpha2)* b(x, y); g3 (x,y)= alpha3* a(x,y) + (1-alpha3)* b(x, y); end end figure, imshow (g1) figure, imshow (g2) figure, imshow (g3)

At alpha= 0.5

At alpha =1

At alpha=0

Describe some characteristics of the output image. The output image is a blend of the two input images. Alpha values determine the amount of blending that takes place. What happens if f(x,y) is blended with a constant value greater than one, i.e. 100? With a constant value less than 1? If an alpha is

Das könnte Ihnen auch gefallen