本文整理汇总了Java中android.hardware.Camera.Face类的典型用法代码示例。如果您正苦于以下问题:Java Face类的具体用法?Java Face怎么用?Java Face使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Face类属于android.hardware.Camera包,在下文中一共展示了Face类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setFaces
import android.hardware.Camera.Face; //导入依赖的package包/类
public void setFaces(Face[] faces) {
if (LOGV) {
Log.v(TAG, "Num of faces=" + faces.length);
}
if (mPause) return;
if (mFaces != null) {
if ((faces.length > 0 && mFaces.length == 0)
|| (faces.length == 0 && mFaces.length > 0)) {
mPendingFaces = faces;
if (!mStateSwitchPending) {
mStateSwitchPending = true;
mHandler.sendEmptyMessageDelayed(MSG_SWITCH_FACES, SWITCH_DELAY);
}
return;
}
}
if (mStateSwitchPending) {
mStateSwitchPending = false;
mHandler.removeMessages(MSG_SWITCH_FACES);
}
mFaces = faces;
invalidate();
}
开发者ID:jameliu,项目名称:Camera2,代码行数:24,代码来源:FaceView.java
示例2: setFaces
import android.hardware.Camera.Face; //导入依赖的package包/类
public void setFaces(Face[] faces) {
if (LOGV) Log.v(TAG, "Num of faces=" + faces.length);
if (mPause) return;
if (mFaces != null) {
if ((faces.length > 0 && mFaces.length == 0)
|| (faces.length == 0 && mFaces.length > 0)) {
mPendingFaces = faces;
if (!mStateSwitchPending) {
mStateSwitchPending = true;
mHandler.sendEmptyMessageDelayed(MSG_SWITCH_FACES, SWITCH_DELAY);
}
return;
}
}
if (mStateSwitchPending) {
mStateSwitchPending = false;
mHandler.removeMessages(MSG_SWITCH_FACES);
}
mFaces = faces;
invalidate();
}
开发者ID:asm-products,项目名称:nexus-camera,代码行数:22,代码来源:FaceView.java
示例3: onDraw
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (mFaces != null && mFaces.length > 0) {
Matrix matrix = new Matrix();
Util.prepareMatrix(matrix, false, mDisplayOrientation, getWidth(), getHeight());
canvas.save();
matrix.postRotate(mOrientation);
canvas.rotate(-mOrientation);
RectF rectF = new RectF();
for (Face face : mFaces) {
rectF.set(face.rect);
matrix.mapRect(rectF);
canvas.drawRect(rectF, mPaint);
canvas.drawText("Score " + face.score, rectF.right, rectF.top, mTextPaint);
}
canvas.restore();
}
}
开发者ID:bytefish,项目名称:VideoFaceDetection,代码行数:20,代码来源:FaceOverlayView.java
示例4: setFaces
import android.hardware.Camera.Face; //导入依赖的package包/类
public void setFaces(Face[] faces) {
// Log.v(TAG, "Num of faces=" + faces.length);
if (faces != null && faces.length >= 1)
System.out.println("人脸位置参数" + faces[0].rect.toString());
mFaces = faces;
invalidate();
}
开发者ID:hubert1002,项目名称:WiCamera3D,代码行数:9,代码来源:FaceIndicater.java
示例5: onFaceDetection
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
public void onFaceDetection(Face[] faces, Camera camera) {
if (faces.length > 0) {
long now=SystemClock.elapsedRealtime();
if (now > lastFaceToast + 10000) {
Toast.makeText(getActivity(), "I see your face!",
Toast.LENGTH_LONG).show();
lastFaceToast=now;
}
}
}
开发者ID:commonsguy,项目名称:cwac-camera,代码行数:13,代码来源:DemoCameraFragment.java
示例6: onFaceDetection
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
public void onFaceDetection(Face[] faces, Camera camera)
{
//overlay.reset();
Log.i( "Stuff", "Drawing " + faces.length + " rects");
for( int i=0; i<faces.length; i++ )
{
Face f = faces[i];
android.hardware.Camera.CameraInfo info =
new android.hardware.Camera.CameraInfo();
android.hardware.Camera.getCameraInfo(CameraID, info);
Matrix matrix = new Matrix();
// CameraInfo info = CameraHolder.instance().getCameraInfo()[cameraId];
// Need mirror for front camera.
boolean mirror = (info.facing == CameraInfo.CAMERA_FACING_FRONT);
matrix.setScale(mirror ? -1 : 1, 1);
// This is the value for android.hardware.Camera.setDisplayOrientation.
matrix.postRotate(currentCameraOrientation);
// Camera driver coordinates range from (-1000, -1000) to (1000, 1000).
// UI coordinates range from (0, 0) to (width, height).
matrix.postScale(overlay.getWidth() / 2000f, overlay.getHeight() / 2000f);
matrix.postTranslate(overlay.getWidth() / 2f, overlay.getHeight() / 2f);
overlay.drawRect( f.rect );
}
}
开发者ID:CDCA-C5ISR-Summit-Code-a-Thon-2013,项目名称:Works-on-My-Box,代码行数:28,代码来源:CameraActivity.java
示例7: setFaces
import android.hardware.Camera.Face; //导入依赖的package包/类
public void setFaces(Face[] faces,boolean isMirror){
this.mFaces = faces;
this.isMirror = isMirror;
invalidate();
}
开发者ID:MarukoZ,项目名称:FaceRecognition,代码行数:6,代码来源:FaceView.java
示例8: onFaceDetection
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
public void onFaceDetection(Face[] faces, CameraAgent.CameraProxy camera) {
if (mFaceView != null) {
mFaceView.setFaces(faces);
}
}
开发者ID:jameliu,项目名称:Camera2,代码行数:7,代码来源:PhotoUI.java
示例9: onFaceDetection
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
public void onFaceDetection(Face[] faces, CameraManager.CameraProxy camera) {
mFaceView.setFaces(faces);
}
开发者ID:asm-products,项目名称:nexus-camera,代码行数:5,代码来源:PhotoUI.java
示例10: onFaceDetection
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
public void onFaceDetection(Face[] faces, Camera camera) {
Log.d("onFaceDetection", "Number of Faces:" + faces.length);
// Update the view now!
mFaceView.setFaces(faces);
}
开发者ID:bytefish,项目名称:VideoFaceDetection,代码行数:7,代码来源:CameraActivity.java
示例11: setFaces
import android.hardware.Camera.Face; //导入依赖的package包/类
public void setFaces(Face[] faces) {
mFaces = faces;
invalidate();
}
开发者ID:bytefish,项目名称:VideoFaceDetection,代码行数:5,代码来源:FaceOverlayView.java
示例12: getFacesDetectedList
import android.hardware.Camera.Face; //导入依赖的package包/类
public List<Face> getFacesDetectedList() {
return new ArrayList<Face>(this.facesDetected);
}
开发者ID:pobzeb,项目名称:ironman,代码行数:4,代码来源:IronmanActivity.java
示例13: onFaceDetection
import android.hardware.Camera.Face; //导入依赖的package包/类
@Override
public void onFaceDetection(Face[] faces, Camera camera) {
// Load the faces list.
facesDetected = new ArrayList<Face>(Arrays.asList(faces));
}
开发者ID:pobzeb,项目名称:ironman,代码行数:6,代码来源:IronmanActivity.java
注:本文中的android.hardware.Camera.Face类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论