iOS8での画像処理+α
Upcoming SlideShare
Loading in...5
×
 

iOS8での画像処理+α

on

  • 87 views

#potatotips9

#potatotips9

Statistics

Views

Total Views
87
Views on SlideShare
46
Embed Views
41

Actions

Likes
0
Downloads
0
Comments
0

3 Embeds 41

http://himaratsu.hatenablog.com 47
http://blog.mogmet.com 6
https://twitter.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

iOS8での画像処理+α iOS8での画像処理+α Presentation Transcript

  • iOS8での画像処理理 +α potatotips #9 ! @_̲shingt
  • ⾃自分 • 後藤慎⼀一(@_̲shingt) • インフラエンジニア?⾒見見習い @ DeNA 2
  • 今⽇日話すこと • iOS8でのCore Imageを使った画像処理理+α • vlImageとかOpenCVとかの話はしません 3
  • Core Imageでの画像処理理
  • iOS7以前 Input CIImage CIFilter(115種?) Output CIImage * 本当は画像ではなくレシピ CISepiaTone …
  • Input CIImage CIFilter(115種?) Output CIImage CISepiaTone CIKernelに 処理理内容を記述 iOS8
  • CIKernel
  • CIKernel • これを⽤用いてCIFilter(のサブクラス)を作る • “ピクセル毎の処理理” を書く • 処理理内容はGLSL(OpenGL Shading Language) で記述 8
  • myFilter.cikernel kernel vec4 swapRedAndGreenAmount ( __sample s, float amount ) { return mix(s.rgba, s.grba, amount); } 処理理をGLSLで記述 そのまま⽂文字列列として CIKernelに渡す
  • 画像処理理系のアプリ作ってないと あまり興味沸かないですよね><
  • でもこんな例例があった
  • 12
  • fastred / MotionBlur • by Arkadiusz Holko • CIKernelを使いMotion Blur(動きぼけ)の効果を ビューのアニメーションに適⽤用 • Motion BlurはCIFilter標準の115種の中にはない • http://holko.pl/2014/07/21/motion-‐‑‒blur/ 13
  • ちょっとデモ
  • しくみ 1. あらかじめ対象ビューのスナップショット取得 2. MotionBlurのフィルタ適⽤用 3. 対象ビューのトップ層に追加 4. ランループを回し、移動が発⽣生した際にこの層の 透明度度を調整し⾒見見えるように 15
  • Main View Blurred Menu Menu View 横から⾒見見た図 16
  • fastred / MotionBlur • アニメーションにアクセント • 常に使うものではない(と作者も⾔言ってる) • ここぞという時に? • UIViewにカテゴリとして実装されてる • https://github.com/fastred/MotionBlur 17
  • まとめ
  • まとめ • CIKernelでより柔軟にフィルタを記述 • GLSLを使うためハードルは⾼高い(個⼈人的に) • (OpenCVとかvlImageっぽく書きたい..) • iOS⽤用のドキュメントがまだなくてつらい • うまくやればUIに応⽤用 • 処理理が重いので注意が必要 19
  • 参考 • WWDC 2014 Session 515 -‐‑‒ Developing Core Image Filters for iOS(https:// developer.apple.com/videos/wwdc/2014/) • Holko.pl -‐‑‒ Motion Blur(http://holko.pl/ 2014/07/21/motion-‐‑‒blur/) 20