If you want the color edges, then the most sensible thing is to measure Delta E - the color difference - between a pixel and its neighbors. I just gave the algorithm a few days ago here: http://www.mathworks.com/matlabcentral/answers/73635#answer_83593 An edge will have a high delta E while non-edges will have low delta E. I now have a demo script of this. Let me know if you want me to post it.
Thanks for the script, I think this will definitely be helpful to me. I need to construct a geometry through this So I need to get the Coordinates of the boundaries created in the image as well as the colour code to know about the orientation. Please help me how can I convert the output that I have got to a matrix containing the required information.