How to rescale a part of a 2D Matrix?

조회 수: 1 (최근 30일)
Kevin San Diego
Kevin San Diego 2019년 8월 27일
댓글: Kevin San Diego 2019년 8월 27일
Hello,
I have read an image using imread() and it returns a 2D Matrix of uint8.
I proceed to get the indeces of parts of the image which meet some conditions. For example, I store make_zero = image < 100 as I want to make these values zero. And I do, scale_above = image >= 100 which I want to rescale from x to y. I was hoping to use the rescale function.
However, after I get this 2D Matrix logical where the conditions meet, I am unsure how to proceed on how to use these indeces.
Thank you for your help!

채택된 답변

Matt J
Matt J 2019년 8월 27일
편집: Matt J 2019년 8월 27일
Why not as follows?
image(scale_above) = rescale(image(scale_above),____)
  댓글 수: 1
Kevin San Diego
Kevin San Diego 2019년 8월 27일
Thank you so much! I have been way to concerned with vectorisation and I feel as though it's changing the way I think about simple conditional statements.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by