Generate eight distinct shapes from a set of specified variables

1 view (last 30 days)
To be able to generate eight distinct shapes from a set of specified variables using MATLAB image processing. Your shape generator algorithm should be able to generate the following shapes:
  1. &nbspCircle(Input radius in pixels)
  2. &nbspSquare(Input length of 1 side in pixels. Adjacent sides must be parallel to both borders of the image respectively)
  3. &nbspTriangle(Input length of base in pixels and both base angles in degrees. The base is associated with column span, which is parallel to the top border, and the apex of triangle must be located at a point above the base line)
  4. &nbspRectangle(Input length of 2 adjacent sides in pixels. For display purposes the smaller value is associated with the row span and the larger values is associated with the column span. Adjacent sides must be parallel to both borders of the image respectively)
  5. &nbspPentagon(Input length of 1 side in pixels. The base is associated with column span, which is parallel to the top border, and the apex of pentagon must be located at a point above the base line)
  6. &nbspHexagon(Input length of 1 side in pixels. At least 2 sides must be parallel to the top and bottom borders of the image)
  7. &nbspEllipse(Input length of semi-minor (rows) and semi-major (columns) axes in pixels. For display purposes the semi-minor axis is associated with the row span, and must be parallel to the left and right borders of the image, and the semi-major axis is associated with column span, and must be parallel to the top and bottom borders of the image)
  8. &nbspOctagon(Input length of 1 side in pixels. At least two sides must be parallel to the top and bottom borders of the image)

Accepted Answer

Image Analyst
Image Analyst on 28 Apr 2015
You can do all of those by varying the number of elements in theta in the 4th example in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!