Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

Black and White-Optical illusion using matlab

Today, Some of my friends in Facebook posted black and white optical illusion photo saying 'ITS FREAKING AWESOME'.
After seeing the image, I found it's actually black and white illusion. Yes, convert the image to binary and do logical not of the image. When you look or concentrate at one point on the image ,maybe in center you can see a logical not of the image (i.e) White pixels will be black and black pixels will be white.

The most interesting thing is, you can try with your own photo.

MATLAB CODE:


A=imread('illusion.jpg');



B=uint8(zeros(size(A)));
A=~im2bw(A);
Logical Not on Binary Image

for i=1:size(A,1)
    for j=1:size(A,2)
        if(A(i,j)==1)
            B(i,j,:)=255;
        end
    end
end

Stare at the dots on image for 20 to 30 secs. Close your eyes or look up towards the ceiling.
You can see a binary image. i.e im2bw(A);

To draw the dots on the image:

C=uint8(ones(4 ,4, 3));
C(:,:,1)=C(:,:,1)*200;
C(:,:,2)=C(:,:,2)*0;
C(:,:,3)=C(:,:,3)*250;
%Find the mid point of the image and draw 3 dots.


midx=round(size(B,1)/2);
midy=round(size(B,2)/2)+30;
for i=1:size(C,1)
    for j=1:size(C,2)
B(midx+i+5,midy+j,:)=C(i,j,:);
B(midx+i-5,midy+j,:)=C(i,j,:);
B(midx+i+15,midy+j,:)=C(i,j,:);
    end
end




Guess who?


0 comments:

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.