Trending News
Promoted
matlab影像處理
請問 matlab把影片轉成灰階後
其中RGB值都介於0~255
想把"影片中"全部大於80的RGB值轉成255
就是變成黑色的
請問這要該怎麼用?
版本R2006A
1 Answer
Rating
- ChaosLv 71 decade agoFavorite Answer
假設你的圖形矩陣為testcolor,結合find 利用下法
>>t2=testcolor;
>> [Rx,Ry]=find(testcolor(:,:,1)>80);
>>t2(Rx,Ry,1)=255;
>> [Gx,Gy]=find(testcolor(:,:,2)>80);
>>t2(Gx,Gy,2)=255;
>> [Bx,By]=find(testcolor(:,:,3)>80);
>>t2(Bx,By,3)=255;
>>imshow(t2)
這些Rx,Ry,Gx,Gy,Bx,By就是其RGB大於80相對的位置
t2就是依據你所設定的圖
Source(s): 教學經驗
Still have questions? Get your answers by asking now.