LoginSignup
1
1

More than 3 years have passed since last update.

例えばこの画像を
nekocyan458A4183_TP_V4.jpg
↓猫だけのCGRectで切り抜いたはずなのに、
スクリーンショット 2020-09-24 13.09.26.png
↓UIImageViewに表示すると、一部しか表示されなかったり、全然表示されなかったりする
スクリーンショット 2020-09-24 13.11.33.png

一旦CGImageにしてからUIImageにすると綺麗に表示されます。
原因はCore ImageとUIKitの座標系が一致しないせいらしいです。
cropped(to:)の公式ドキュメントに書いてました。

let context = CIContext()
let final = context.createCGImage(ciCroppedImage, from:ciCroppedImage.extent)

🐣


Core MLを使ったアプリを作っています。
機械学習関連の情報を発信しています。

Twitter
MLBoysチャンネル
Medium

相棒
note

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1