필터 지우기
필터 지우기

Line in a matrix and differentiation between matrix indices.

조회 수: 2 (최근 30일)
Sotirios
Sotirios 2014년 1월 17일
댓글: Sotirios 2014년 1월 18일
How can I create a line in a matrix. Since I create it, how can I differentiate between the indices from the one side of the line with them of the other. What I am trying to do, is to create a shaped image. The shape can be a square, rhombus, etc. Thus, I want to set the values of the matrix that exist out of the shape to zero (or 255).
  댓글 수: 2
Jan
Jan 2014년 1월 18일
Please give us an example. Are you looking for a method to fill a region, which is defined by an edge with a specific value?
Sotirios
Sotirios 2014년 1월 18일
Yes I would like to fill in a region or more, in order to make visible only a specific part of the image. For instance, lets say I have an image with a matrix mat. Then I draw a line from mat(size(mat,2)/2,1) to mat(1,size(mat,1)/2). What I want to do next, is to fill the indices located on the left of the line with 0. Is this feasible?
Thank you.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2014년 1월 18일
I have a number of masking demos and demos to burn things into images. For example, run the attached demos.
  댓글 수: 2
Image Analyst
Image Analyst 2014년 1월 18일
Another demo. Evidently there is a 3 file attachment limit.
Sotirios
Sotirios 2014년 1월 18일
Thank you :) I guess that demo burn_overlay_into_image.m, can solve my problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by