GPUImageMotionDetector.h 768 B

123456789101112131415161718
  1. #import "GPUImageFilterGroup.h"
  2. #import "GPUImageLowPassFilter.h"
  3. #import "GPUImageAverageColor.h"
  4. @interface GPUImageMotionDetector : GPUImageFilterGroup
  5. {
  6. GPUImageLowPassFilter *lowPassFilter;
  7. GPUImageTwoInputFilter *frameComparisonFilter;
  8. GPUImageAverageColor *averageColor;
  9. }
  10. // This controls the low pass filter strength used to compare the current frame with previous ones to detect motion. This ranges from 0.0 to 1.0, with a default of 0.5.
  11. @property(readwrite, nonatomic) CGFloat lowPassFilterStrength;
  12. // For every frame, this will feed back the calculated centroid of the motion, as well as a relative intensity.
  13. @property(nonatomic, copy) void(^motionDetectionBlock)(CGPoint motionCentroid, CGFloat motionIntensity, CMTime frameTime);
  14. @end