Road Extraction from Image using SVM?

Can any one help me to write code for road extraction from image using Support vector machine?
Any Help would be appreciated...
Thanks

8 comentarios

Jeff E
Jeff E el 14 de Jun. de 2013
Editada: Walter Roberson el 14 de Jun. de 2013
Yes. I'm very confident that someone can help you write code for road extraction from an image that uses, at least in part, a SVM.
Did you have a Matlab related question? Or perhaps a more specific question? It is unlikely someone will give you a complete turn-key solution out of the blue...
Oh what the heck. Here you go:
rizwan
rizwan el 15 de Jun. de 2013
Editada: rizwan el 15 de Jun. de 2013
Thanks Jeff,
I just need to know how i can train an Image to extract Road.
Would it be at pixel level training or some thing else.
Thanks
Image Analyst
Image Analyst el 15 de Jun. de 2013
Editada: Image Analyst el 15 de Jun. de 2013
That's what all those published papers do that I referred you to. Did you even look at any of them?
rizwan
rizwan el 15 de Jun. de 2013
Editada: Walter Roberson el 15 de Jun. de 2013
Yes i have read all those and many more but nothing practically has been mentioned in the paper, every paper just describe the technique but didn't show how things were done practically.
Till now i have written the following lines of code.
%Road Extraction using SVM%
road_image = imread('C:\Users\rizwan\Documents\MATLAB\59859777.jpg');
%Convert road_imageage to gray scale%
gray_roadImage = rgb2gray(road_image);
%SVM Training%
%Classify a given pixel based on its value and neighborhood pixel values%
%i.e. determine whether pixel belongs to the road segment or %
%non road (anything other than road)%
%We can classify pixel as +1 for road pixel and -1 for non road pixel%
Is this approach/direction towards my goal is right enough or should i change. Please let me know how i can train SVM to classify road pixel and non road pixel.
Thanks
Jeff E
Jeff E el 17 de Jun. de 2013
That looks like a decent enough start, although I would question immediately converting to grayscale. Presumably a color image would give you more information about your road pixels. Otherwise you're just left with intensity and texture.
Maybe you can start simple, and see if you can define a set of training data. Walter describes this a bit below, but you could even limit it to single pixel data (and not a window) to simplify things further. Say, just the RGB values of each road pixel as your positive class, and likewise all the non-road pixels as your negative class. Then see if you can train an SVM, and run it on your training data to see what you get.
Walter Roberson
Walter Roberson el 17 de Jun. de 2013
Although I was not thinking of it at the time, where I wrote about converting the N x N window to a vector, that could apply to an N x N window over RGB as well.
Using no window is the same as a 1x1 window :)
rizwan
rizwan el 18 de Jun. de 2013
Thanks Jeff,
No got stuck in the svmtrain function, as matlab help suggests the first parameter is Training, how ?
As i have just used the imread() method to read the image and obtained the Array of image..
Yes Jeff you were write converting color image to grayscale prone to reduction of information about the image, i will continue with the color image i thought i would be good enough if have have just 0,1 values of pixels and make less effort in classification step but i was wrong
Thanks and appreciate Conversation and Learned Alot from your comments.
Jeff E
Jeff E el 18 de Jun. de 2013
has two examples of how to train an SVM using two different 2-D data sets. If you are keeping things simple, and just using the RGB values of individual pixels, you should be able to follow these pretty closely.
impixel should facilitate generating your two training data sets.
If you run into problems following the examples, post your code and error messages generated to get more specific help. If everything goes smoothly, then you can look at additional kinds of training data (neighboring pixel info, texture, etc.)

Iniciar sesión para comentar.

Respuestas (3)

Image Analyst
Image Analyst el 14 de Jun. de 2013
Pick your algorithm from Section 15 or 22 here: http://iris.usc.edu/Vision-Notes/bibliography/contents.html
15 Active Vision, Camera Calibration, Mobile Robots, Navigation, Road Following
16 Motion -- Feature-Based, Long Range, Motion and Structure Estimates, Tracking, Surveillance, Activities
17 Optical Flow Field Computations and Use
18 Motion Analysis --Low-Level, Image Level Analysis, Mosaic Generation, Super Resolution, Shape from Motion
19 Implementations and Applications, Databases, QBIC, Video Analysis, Hardware and Software, Inspection
20 Medical Applications, CAT, MRI, Ultrasound, Heart Models, Brain Models
21 Face Recognition, Detection, Tracking, Gesture Recognition, Fingerprints, Biometrics
22 Cartography, Aerial Images, Remote Sensing, Buildings, Roads, Terrain, ATR

2 comentarios

Image Analyst
Image Analyst el 15 de Jun. de 2013
OK, so you say you've read the several dozen papers listed there like "Road Extraction Based on the Algorithms of MRF and Hybrid Model of SVM and FCM", plus even more, and none of them work. Those people spent months developing their algorithms so I doubt I'm going to be able to give you anything after 5 minutes of work. I don't even know what the two clusters you want to use with the SVM represent. Please tell me what your clusters represent. Plus I don't know what your plans are to handle the fact that roads change color and the ground beside the roads also changes color.
rizwan
rizwan el 18 de Jun. de 2013
Hi Image Analyst,
I said i have read the papers but none of any paper has given the implementation details just described the algorithm nothing else..i want some help from where i am able to implement Road Extraction using SVM, my research fellow told me about the svmlib and currently i m working on it.

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 15 de Jun. de 2013

0 votos

Take the N x N window of pixels that has a given pixel in the center. Reshape that N x N window to be a vector. Now use that vector as one "sample". Do the same for each of the pixels in the image (after deciding how you want to handle the boundary conditions.)
If you are really lucky then a c-means or k-means clustering with two clusters will divide nicely into "road" versus "non-road". But I doubt you would be so lucky.
So now take a subset of the pixels and manually assign classes numbers to them, +1 for road, -1 for non-road. Train the subset with class number using your favorite 2-class technique (e.g., SVM). Now apply the learned metrics against a test class for which the answer is known but not input. Check the accuracy. If everything is okay, go ahead and apply to the entire image.

1 comentario

ROSE MARY KATIKALA
ROSE MARY KATIKALA el 20 de Mzo. de 2017
how can i assign +1 to roads and -1 to nonroads based on glcm texture feature calculation? can u please provide code. i have calculated entropy energy etc values and im comfused what to after that.

Iniciar sesión para comentar.

shantanu shukla
shantanu shukla el 20 de Abr. de 2014

0 votos

Hay rizwan i am also working on it, so if u have some information related with road extraction then plz share with me.it's abt my project

Preguntada:

el 14 de Jun. de 2013

Comentada:

el 20 de Mzo. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by