How do I generate eight distinct shapes from a set of specified variables using MATLAB image processing.

5 次查看(过去 30 天)
How do I generate eight distinct shapes from a set of specified variables using MATLAB image processing.
Myshape generator algorithm should be able to generate the following shapes: 1. Circle (Input radius in pixels) 2. Square (Input length of 1 side in pixels. Adjacent sides must be parallel to both borders of the image respectively) 3. Triangle (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. Rectangle (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. Pentagon (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. Hexagon (Input length of 1 side in pixels. At least 2 sides must be parallel to the top and bottom borders of the image) 7. Ellipse (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. Octagon (Input length of 1 side in pixels. At least two sides must be parallel to the top and bottom borders of the image) In addition to the input specifications described above, a colour must be attributed to every shape i.e. every shape must have an R, G and B value associated with it. The final product/algorithm must output 2 separate images: 1. A binary (black and white) image with all the shapes in black and background in white. (50%) a. Each shape must be located centrally within 8 square boxes of equal size (as shown below).
Please assist in this question.

采纳的回答

Image Analyst
Image Analyst 2015-4-28
This is the same question you asked before and I answered here. I thought it was a good answer, Yashlin - why didn't you?
  18 个评论
Image Analyst
Image Analyst 2021-6-7
@Haytham Ali, did you notice the examples in the help documentation? Did you try them? If it's not what you want, then explain in a lot more detain what you want.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by