For More Matlab Projects Visit last Posted Matlab Project **Traffic Sign Recognition Using Matlab . **

**Introduction **

- Our Objective is to Detect Road tract using road edges especially when road signs or marking are not available.
- Input is
**video.avi**format first frames are extracted and then Chroma based segmentation is applied. - Figure Below Shown the Project model we have to implement this project according the Below Block Set.

## Scenarios when both edges of road are visible

- First algorithm search for the detection of left and right edges of the road.
- This is done by simply analyzing video frames and when there’s change in color behavior algorithm search for edges by drawing lines on road starting from the center and in the same way lines move towards the edges as shown in the figure below
- Lines started from
**Initial Lines Pair**and then lines are**Expanding**and finally when there is**Convergence**edges are found

## Algorithm Result

Now the following image below shows result of above procedure.

## Algorithm Detected Edges of Road Shown by Pink and Yellow Lines

## When There’s No Road

## Results when only one side of road is visible

## Result When Both Sides of Road Edges are Visible

## Templates

Following images were used for concatenation

## Used to Show Road is Left

## Used to Show Road is Right Diagonal

## Used to Show Road is Right

## Used to Show Road is Left Diagonal

## Used to Show Road Straight

## Used to Show There’s No Road

## Matlab Implementation

function road

arrow1=imread(‘arrow1.jpg’); arrow1=imresize(arrow1,[50 50]);

arrow2=imread(‘arrow2.jpg’); arrow2=imresize(arrow2,[50 50]);

arrow3=imread(‘arrow3.jpg’); arrow3=imresize(arrow3,[50 50]);

arrow4=imread(‘arrow4.jpg’); arrow4=imresize(arrow4,[50 50]);

arrow5=imread(‘arrow5.jpg’); arrow5=imresize(arrow5,[50 50]);

cross=imread(‘cross.jpg’); cross =imresize(cross,[50 50]);

readerobj = mmreader(‘roadtest.avi’);

Frames = read(readerobj);

vidFrames = read(readerobj);

numFrames = get(readerobj, ‘numberOfFrames’);

r = readerobj.Height;

c = readerobj.Width;

for k = 1 : numFrames-1

mov(k).cdata = vidFrames(:,:,:,k);

a=mov(k).cdata;

z=mov(k).cdata;

for i=1:r

for j=1:c

if(a(i,j,1)>100&&a(i,j,2)>120&&a(i,j,3)>110&&a(i,j,1)<255&&a(i,j,2)<255&&a(i,j,3)<255) if(a(i,j,1)>120&&a(i,j,2)>190&&a(i,j,3)>120&&a(i,j,1)<160&&a(i,j,2)<255&&a(i,j,3)<150) z(i,j,1)=255; z(i,j,2)=255; z(i,j,3)=255; else z(i,j,1)=0; z(i,j,2)=0; z(i,j,3)=0; end else z(i,j,1)=255; z(i,j,2)=255; z(i,j,3)=255; end end end z=z(:,:,1); check=0; if(z(r,c/2)==0&&z(r-2,c/2)==0) for i=1:1:r-10 if(z(i,1)&&z(i+1,1)&&z(i+2,1)&&z(i+4,1)&&z(i+5,1)==255&&z(i+10,1)==255) x=i; end if(z(i,c)&&z(i+1,c)&&z(i+2,c)&&z(i+4,c)&&z(i+5,c)==255&&z(i+10,c)==255) y=i; end end if(x>=160&&y>=160)

if(x==y||x==y+2)

a(120:169,120:169,:)=arrow3;

check=1;

elseif(x<y) a(120:169,120:169,:)=arrow4; check=1; elseif(x>y)

a(120:169,120:169,:)=arrow2;

check=1;

end

end

if(check==0)

a(120:169,120:169,:)=arrow5;

end

else

a(120:169,120:169,:)=cross;

end

mov(k).cdata=a;

vidFrames(:,:,:,k)=mov(k).cdata;

end

implay(Frames);

implay(vidFrames);

## How To See Output

Just play these two input and output videos to see output.

## Source Code

Like , share this post on **Facebook** , **Twitter** by using left moving **Social Sharing block** and follow us on Facebook **Page** , **Twitter** and do **comment **and enter your email. After you have done you will automatically get source code in your mail. **Note : **This will be **auto generated** mail you can’t get until you follow above method.

** **

Hi Khan,

Please send me your source code.

Thanks you very much!

Check your mail

Please send me too @ emperorhasan1992@gmail.com

I recieved. Thank you very much!

No Problem Keep Visiting

Very nice. Can you send me the full source code?

engsegtrab.turma6.ucam@gmail.com

Thanks

please read your mail and cooperate with us thanks

Hi!

It’s dreat!

please send me on

m14061928@gmail.com

Hi , could you share codes ?

this is so cool, can’t wait to get my hands on this. look forward to studying more of this! this is the answer to tonnes of my questions!

Kindly mail me the code

Best,

xjtuxjt

Hi ,aswinrajan23@gmail.com

This is my mail,id could you send the source for this project?

I was wondering if you have a implementation of chroma based color similarity , i am doin a project on the following paper and have completed the whole code except for the color similarity part , the paper i am refrerring to is “www.ijcaonline.org/volume15/number2/pxc3872565.pdf”. can u help me out with the color part , i can mail u the rest of the code if u need

mail me at ammad.amu36@gmail.com and tell me more about this what you have done on your own and what do you expect more

can u send me your source code please? i;m really interesting in your job,thx

my email adress is: star_honey659@yahoo.com

thx alot

a very interesting. can you send me your source code please?

kalin13yakimov@abv.bg

pl

can i plz plz plz get this source code! i need it badely

please send me the source code

Hi,

could you please send me the code?

Hi Ammad! Can you send me the complete code of this? on my email. emperorhasan1992@gmail.com

i need it for my project

hai..

can u send me complete source code to my mail-id…

somethinf4others@gmail.com

Please send me your matlab code, thanks.