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?
0 件のコメント
回答 (1 件)
Matt J
2018 年 10 月 18 日
condition = (hValue == 0 & sValue == 0) | (hValue == 0.6 & sValue == 1);
vValue(~condition) = 0.5;
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!