How to extract an image?

4 次查看(过去 30 天)
Darsana P M
Darsana P M 2016-11-20
The black region is the road and white region is the surrounding. I need to extract the black region alone and display the road. Can anybody help me with the matlab code?
[Edit by Image Analyst -- images inserted]

回答(1 个)

Image Analyst
Image Analyst 2016-11-20
We can't see your .fig files. Attach PNG format images with the green and brown frame icon. Until then, see my Image Segmentation tutorial or color segmentation tutorials: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Or else see the Color Thresholder on the Apps tab of the tool ribbon.
  2 个评论
Darsana P M
Darsana P M 2016-11-20
i have made the image in png format
Image Analyst
Image Analyst 2016-11-20
I did what I was hoping you'd do up top on your original post.
15.3.3 Road, Path Following Operators
15.3.3.1 Road Following, Depth, Stereo Based, Off-Road, Safe Path
15.3.3.2 Ground Plane Detection
15.3.3.3 Lane Detection, Lane Following, White Line Detection
15.3.3.4 Indoor Navigation Issues, Lines, Walls, Doors, Flat Surfaces
15.3.3.5 CMU Road Followers, ALVINN YARF MANIAC
15.3.3.6 Obstacle Dectection, Other Vehicles, Objects on the Road
15.3.3.6.1 Collision Avoidance, Collision Detection, Vehicles, Objects on the Road
15.3.3.6.2 Obstacles, Objects on the Road Using Radar, Sonar, Active Vision
15.3.3.7 Airplane Obstacles, Collision Detection, Sense and Avoid, Aircraft Landings
15.3.3.8 Road Signs, Traffic Signs, Traffic Lights, Objects along the Road, Inspections
To mask your image so that the road shows up in full RGB and elsewhere is blackened, starting with your binaryImage, you can do it like this:
mask = ~binaryImage; % Invert it so the road is white
% Mask the image using bsxfun() function
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Feature Detection and Extraction 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by