Create a triangular image with height of 200 pixels and the base of 200 pixels and color the image in any two colors.

1 次查看(过去 30 天)
Create a triangular image with height of 200 pixels and the base of 200 pixels and color the image in any two colors.

回答(1 个)

Image Analyst
Image Analyst 2013-2-13
Hint: use poly2mask() and logical indexing.
yourImage = zeros(rows, columns, 'uint8'); % Initialize.
% Assign values to triangle defined by "mask" image.
yourImage(mask) = someValue;
  30 个评论

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by