ios: Adding real time filter effects to photos

后端 未结 2 1433
时光说笑
时光说笑 2021-01-07 05:04

I want to program an ios app that takes photos but I would like to filter the photo preview in real time. What I mean is implemented in the app called \"CamWow\" (here is a

2条回答
  •  情话喂你
    2021-01-07 05:46

    I'm looking for the same kind of info (its a pretty hot sector so some devs may not be willing to give up the goods just yet). I came across this, which may not be exactly what you want, but could be close. Its a step by step tutorial to process live video feed.

    Edit: I've tried the code that was provided in that link. It can be used to provide filters in real time. I modified the captureOutput method in ViewController.m , commented out the second filtering step ("CIMinimumCompositing") and inserted my own filter (I used "CIColorMonochrome").

    It worked. My first few attempts failed because not all filters in Core Image Filter reference are available for iOS apparently. There is some more documentation here.

    Not sure if this code is the best performance wise, but it does work.

    Edit #2: I saw some other answers on SOverflow that recommended using OpenGL for processing which this sample code does not do. OpenGL should be faster.

提交回复
热议问题