diff options
Diffstat (limited to 'res/raw/goofy_face.graph')
-rw-r--r-- | res/raw/goofy_face.graph | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/res/raw/goofy_face.graph b/res/raw/goofy_face.graph new file mode 100644 index 0000000..344e137 --- /dev/null +++ b/res/raw/goofy_face.graph @@ -0,0 +1,100 @@ +// +// Copyright (C) 2011 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Imports --------------------------------------------------- +@import android.filterpacks.videosrc; +@import android.filterpacks.videosink; +@import android.filterpacks.ui; +@import android.filterpacks.base; +@import android.filterpacks.imageproc; + +@import com.google.android.filterpacks.facedetect; + +@setting autoBranch = "synced"; + +// Externals ------------------------------------------------- + +@external textureSourceCallback; +@external recordingWidth; +@external recordingHeight; +@external recordingProfile; +@external audioSource; + +@external previewSurface; +@external previewWidth; +@external previewHeight; + +// Filters --------------------------------------------------- + +// Camera input +@filter SurfaceTextureSource source { + sourceListener = $textureSourceCallback; + width = $recordingWidth; + height = $recordingHeight; + closeOnTimeout = true; +} + +// Face detection +@filter ToPackedGrayFilter toPackedGray { + owidth = 320; + oheight = 240; +} + +@filter MultiFaceTrackerFilter faceTracker { + numChannelsDetector = 3; + quality = 0.0f; + smoothness = 0.2f; + minEyeDist = 25.0f; + rollRange = 45.0f; + numSkipFrames = 9; + trackingError = 1.0; + mouthOnlySmoothing = 0; + useAffineCorrection = 1; + patchSize = 15; +} + +// Goofyface +@filter GoofyRenderFilter goofyrenderer { + distortionAmount = 1.0; +} + +// Display output +@filter SurfaceTargetFilter display { + surface = $previewSurface; + owidth = $previewWidth; + oheight = $previewHeight; +} + +// Recording output +@filter MediaEncoderFilter recorder { + audioSource = $audioSource; + recordingProfile = $recordingProfile; + recording = false; + // outputFile, orientationHint, listeners will be set when recording starts +} + +// Connections ----------------------------------------------- +// camera -> faceTracker +@connect source[video] => toPackedGray[image]; +@connect toPackedGray[image] => faceTracker[image]; +// camera -> goofy +@connect source[video] => goofyrenderer[image]; +// faceTracker -> goofy +@connect faceTracker[faces] => goofyrenderer[faces]; +// goofy -> display out +@connect goofyrenderer[outimage] => display[frame]; +// goofy -> record +@connect goofyrenderer[outimage] => recorder[videoframe]; |