How to get pixel information of a straight line plotted in an image?

2 ビュー (過去 30 日間)
roro6992
roro6992 2014 年 1 月 18 日
コメント済み: Image Analyst 2014 年 1 月 18 日
Hi..evryone. I have a binary image of a corridor or a maze where white areas indicate the corridor path or accessible path. And black regions represent the inaccessible areas. I have been provided a start point and I want to trace my path through the corridor and find a way out of it. So for this I start by projecting straight lines in 4 directions upto a certain xtent and see if any of them fully traverses through white zone only. So for this i need to know the pixel info. of the point on the st. lines. Is there any way of getting it?
Again is there any better approach of solving the problem? If its thre. please let me know. Thanx in advance!! The image of the corridor is attached for help.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 1 月 18 日
I solve a maze using image processing and morphology. See my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/27175-mazesolution
Basically you label the walls, take one wall, say the left one, fill holes, dilate, subtract, and you're left with just the left wall.
Other resources for you are
Steve's Blog where he talks about using bwgeodesic() to solve the shorted path problem.
Prof. Luengo's Blog solves harder mazes than mine.
  4 件のコメント
roro6992
roro6992 2014 年 1 月 18 日
Yea yea.Found it. Thanx anyway :)
Image Analyst
Image Analyst 2014 年 1 月 18 日
I'm glad improfile() worked for you - that's it's main purpose. What do you mean anyway ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLabyrinth problems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by