Change color of real time object in live camera fe

2019-08-02 04:30发布

问题:

I would like to know your suggestions on this. Basically I want to change colors of a real time object after I open the camera view in iOS. To elaborate- for ex. if I open the camera and point it to a physical object such as chair in my room - it should be able to change the color of the actual chair based on the preference I give and with out modifying the background. This should happen in the real time feed of the camera. I know this is possible to apply filters after you have taken a photo but I want to do that in real time feed of the camera. Any pointers please?

I got to know about GPUImage3 by Brad Larson which is some real awesome work out there. Library Link

In RGBAdjustment.metal, I can see the following gets returned -

return half4(color.r * uniform.redAdjustment,
             color.g * uniform.greenAdjustment,
             color.b * uniform.blueAdjustment,
             color.a);

How do I identify any particular color in the live camera feed and replace it by some other color of my choice ?