필터 지우기
필터 지우기

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일
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