2

The Lane departure system in MATLAB 2011 demos for Computer Vision toolbox has the following function.

hShapeIns1 = vision.ShapeInserter( ...
                'Shape', 'Polygons', ...
                'Fill', true, ...
                'FillColor', 'Custom', ...
                'CustomFillColor', [1 0 0], ...
                'Antialiasing', false, ...
                'Opacity', 1);

The hShapIns1 object is used to draw a polygon within the Hough lines and captures the road area. If you see the matlab product help for vision.ShapeInserter function, the shapes that can be inserted are polygons, rectangles and lines.

My problem is that I want to insert a line parallel to the Hough lines, using the above code. But when I replace 'Polygons' with 'Lines' it doesn't work. How can I achieve this?

Dima
  • 38,860
  • 14
  • 75
  • 115
HashT
  • 209
  • 1
  • 4
  • 13

1 Answers1

1

By "it doesn't work", I assume that you are not seeing any visible effects on the video. This is because there is another ShapeInserter object hShapeIns2 in that demo which is drawing the same lines on top of this in different color. If you remove that object you will be able to see dark lines over the lane markers.

Navan
  • 4,407
  • 1
  • 24
  • 26
  • Are you sure? because if you see the help documentation for vision.ShapeInserter the parameters for Line are not those of Polygons or Rectangles. – HashT Jun 20 '11 at 15:00
  • Yes. Properties related to Fill have no effect on line. So you might get warnings. If you need to change the color of line you need to use BorderColor property. I also have tried the code. It runs fine and produces the line. – Navan Jun 20 '11 at 18:32
  • Thank you Sir. Can you plz alter my above code with yours? And post it. Thanks again. – HashT Jun 20 '11 at 19:22
  • For a pair of black lines use `hShapeIns1 = vision.ShapeInserter('Shape', 'Lines', 'Antialiasing', false);` – Navan Jun 20 '11 at 20:23
  • Im sorry but there are no lines visible other than hough lines. – HashT Jun 20 '11 at 20:58