필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Compare single element common at same indices in 2 matrixes and change values in third matrix

조회 수: 1 (최근 30일)
I have an image with 3 channels. I want to compare two channels to find a single color value and at the same places I want to change the values in third channel.
Here is the code I am using
vValue((hValue == 0 & sValue == 0) | (hValue == 0.6 & sValue == 1)) = 0.5;
The above works for condition, however I want exactly opposite. I don't want to change any values from above conditions but want to change all other values in vValue. How can I achieve this?

답변 (1개)

Matt J
Matt J 2018년 10월 18일
condition = (hValue == 0 & sValue == 0) | (hValue == 0.6 & sValue == 1);
vValue(~condition) = 0.5;

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by