Open artemtkachenko opened 7 years ago
Maybe it can help someone. I found what I need:
Basically this is the answer: https://github.com/BradLarson/GPUImage/issues/1908
Class: GPUImageHarrisCornerDetectionFilter.m
method:
This is exactly what I want.
Hi Brad, I am sry. I think this not an issue, but I hope that you could help me with it.
I want to connect dlib in GPUImage2, draw facemasks (similar to MSQRD app) in camera preview and capture video. I found existed samples, containing DlibWrapper for iOS. That wrapper helps to generate 2D array from image buffer:
and deep detect face shape points inside previously detected face rects:
draw detected point on generated 2D pixel array and put it back to buffer;
Looks simple, but is it possible to use it inside didOutputSampleBuffer Camera callback: https://github.com/BradLarson/GPUImage2/blob/master/framework/Source/iOS/Camera.swift#L169
Previously I thought that I have to modify cameraFrame object inside this method. But I believe it is impossible because sampleBuffer captured with using kCVPixelFormatType_420YpCbCr8BiPlanarFullRange pixel buffer format and I don't want to change it to kCVPixelFormatType_32BGRA.
Next I found that GPUImage code contains convertYUVToRGB(): https://github.com/BradLarson/GPUImage2/blob/master/framework/Source/iOS/Camera.swift#L233
Maybe I have to modify resultBuffer? I believe this is the final object before rendering and it contains everything what I need for generating 2D pixels array for dlib, drawing detected face shape points and modify this resultBuffer before rendering?
Can you help me with 2D pixels array generation and modifying resultBuffer before rendering?
Thank you.