RGBからグレースケール画像への変換を Image Processing Toolbox を使わずに行うにはどうすればよいですか?

11 Ansichten (letzte 30 Tage)
MathWorks Support Team
MathWorks Support Team am 21 Feb. 2013
RGB からグレースケール画像への変換を Image Processing Toolbox を使わずに行う方法を教えてください。

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 21 Feb. 2013
RGB から YUVへの変換式の Y(輝度)を使用することができます。
intensity = 0.2989*red + 0.5870*green + 0.1140*blue
よって、以下のように処理を記述することが可能です。
rgb = rand(200,200,3);
gray = 0.2989 * rgb(:,:,1) + 0.5870 * rgb(:,:,2) + 0.1140 * rgb(:,:,3);

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!