フィルターのクリア

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 件のコメント
Cesar
Cesar 2013 年 2 月 18 日
編集済み: Walter Roberson 2013 年 2 月 18 日
I did solve it. This is how it should look: https://www.dropbox.com/s/gsgcsb8rqwlg55z/done.doc
Cesar
Cesar 2013 年 2 月 18 日
Using fill(X,Y,C). The fill function creates colored polygons.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by