Lets Learn together... Happy Reading

" Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference "-Robert Frost

Glassy effect in MATLAB

To obtain a glassy effect, define a window of size m by n. Obtain a random pixel value from the window matrix and add it with the current position value.


MATLAB CODE:
A=imread('aish.jpg');
%WINDOW SIZE
m=6;                                                                  
n=7;
Image=uint8(zeros([size(A,1)-m,size(A,2)-n,3]));

for i=1:size(A,1)-m
    for j=1:size(A,2)-n

        mymask=A(i:i+m-1,j:j+n-1,:);
%Select a pixel value from the neighborhood.
x2=ceil(rand(1)*m);
y2=ceil(rand(1)*n);
   
        Image(i,j,:)=mymask(x2,y2,:);
    end
end

figure,imshow(Image);
    We can change the matrix size and see the difference in the result.

SEE ALSO : Oil Painting  Swirl effect   Cone effect     Tiling effect   Paint application

  Reference:
FOR FUN:  Create your own Photoshop effects
    like button Like "IMAGE PROCESSING" page

    0 comments:

    Enjoyed Reading? Share Your Views

    Previous Post Next Post Home
    Google ping Hypersmash.com