簡単な画像処理 (1)

Nov 20, 2010 Revised Set 19, 2011
by Masahiro MIZUTANI

配列を与えて画像を生成する

モノクローム画像

0(Black)から1(White)までのGrayScale値を与える

RandomReal[1,{5,10}]

Image[RandomReal[1,{100,200}]]

Image[Table[x+y,{x,0,1,0.01},{y,0,1,0.01}]]

Image[Table[1/2(x+y),{x,0,1,0.01},{y,0,1,0.01}]]

Image[Table[Sin[x+y],{x,0,Pi,0.01},{y,0,Pi,0.01}]]

Byteデータ

0 (Black)から255(White)までのByte値を与える

Image[Table[x+y,{x,0,255},{y,0,255}],"Byte"]

Image[Table[1/2(x+y),{x,0,255},{y,0,255}],"Byte"]

RGBカラー画像

0から1の範囲の(r, g,b)値からなる配列を与える

RandomReal[1,{2,4,3}]

Image[RandomReal[1,{100,200,3}]]

Image[Table[{Sin[x],Cos[y],Sin[x+y]},{x,0,Pi,0.01},{y,0,Pi,0.01}]]