Swift,python間のコードの書き換えについてです。
pythonのプログラムの中で,画像のRGB情報の配列を作るコードを見つけたのですが,これをswiftで書くとどうなるのでしょうか?
ネット検索をしたのですが,コードやクラスの意味しかなく,書き換えをどうすれば良いか分からず質問させていただきました。
python
1outPixels = np.zeros((outSizeY, outSizeX, inPixels.shape[2]),dtype=inPixels.dtype)
⇧書き換えたいコードです
python
1inFile = 'IMG_0073.JPG' # Input image file name 2outFile = 'IMG_0073_transformed.png' # Output image file name 3outSizeX = 1024 # X size of the output image 4outSizeY = 768 # Y size of the output image 5 6inIm = Image.open(inFile) 7 8inPixels = np.asarray(inIm)
⇧書き換えたいコードの変数です
わかりにくい部分もあるかと思いますが,よろしくお願い致します
開発環境はSwift3です。
あなたの回答
tips
プレビュー