Create a mask based on pixel values

I want to have my code be able to create a mask based on a range of pixel values. For example, if a part of the images' pixels range from 50-125, I want it to only mask that range

답변 (1개)

Rik
Rik 2020년 3월 16일

0 개 추천

IM = uint8(randi(255,100,80));
L= IM >=50 & IM <=125;

댓글 수: 2

ali eskandari
ali eskandari 2021년 2월 17일
I want to substract two images and show the results in another figure. For instance, if the subtraction matrix has 0 value indicate the elements with black, if it has negative value show them with red and if it has positive value show with blue. How can I do that?
Rik
Rik 2021년 2월 17일
This is not a comment, but a question. Have a read here and here. It will greatly improve your chances of getting an answer.

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

태그

질문:

2020년 3월 16일

댓글:

Rik
2021년 2월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by