Monday, 31 October 2016

Program for Sobel Operator edge detection using Matlab





Program for Sobel Operator edge detection using Matlab



 SOBEL EDGE DETECTION

             Standard Sobel operators, for a 3×3 neighborhood, each simple central gradient estimate is vector sum of a pair of orthogonal vectors. Each orthogonal vector is a directional derivative estimate multiplied by a unit vector specifying the derivative’s direction. The vector sum of these simple gradient estimates amounts to a vector sum of the 8 directional derivative vectors. 


%Program
clear all;
clc;
aa=imread('D:\Edge.jpg');
a=rgb2gray(aa);
[row,col]=size(a);
w1=[-1 -2 -1;0 0 0;1 2 1];
w2=[-1 0 1;-2 0 2;-1 0 1];
 for x=2:1:row-1;
    for y=2:1:col-1;
        a1(x,y)=w1(1)*a(x-1,y-1)+w1(2)*a(x-1,y)+w1(3)*a(x-1,y+1)+w1(4)*a(x,y-1)+w1(5)*a(x,y)+w1(6)*a(x,y+1)+w1(7)*a(x,y+1)+w1(3)*a(x+1,y-1)+w1(8)*a(x+1,y)+w1(9)*a(x+1,y+1);

Wednesday, 5 October 2016

Program for removing salt and pepper noise using median filter



Program for removing salt and pepper noise using median filter


Program:


clc;
a=imread('D:\Flower.jpg');   
b=rgb2gray(a);
ab = imnoise(b,'salt & pepper',0.02);   %adding noise
d=double(ab);
e=d;
[row,col]=size(d);
     for x=2:1:row-1
        for y=2:1:col-1
            a1=[a(x-1,y-1) a(x-1,y) a(x-1,y+1)...
                a(x,y-1) a(x,y) a(x,y+1)...
                a(x+1,y-1) a(x+1,y) a(x+1,y+1)];
            a2=sort(a1);
            med= a2(5);
            f(x,y)=med;
     end

Sunday, 2 October 2016

Matlab Video Program and output

sample  ---- Download video


Program Code --- Download code

Output:

Output image

Program for steganography and retrieval of secret message using Matlab

Program for steganography and retrieval of secret message using Matlab

      The art and science of hiding information by embedding messages within other, seemingly harmless messages. Steganography works by replacing bits of useless or unused data in regular computer files (such as graphics, sound, text, HTML) with bits of different, invisible information. This hidden information can be plain text, cipher text, or even images.

PROGRAM: 
%Program for Steganography

clc;
img1=imread('D:\sample.jpg');
img1=rgb2gray(img1);
img1=double(img1);