正在加载图片...
中国科学技术大学电子工程与信息科学系©2018 实验十七Android下的摄像头编程 实验目的 (l)学习Android下进行摄像头控制的基本方法。 (2)理解回调函数。 二、 实验原理 l、android.hardware android.hardware包下面包含了如摄像头、传感器等硬件的支持(不是所有 的硬件)。如表1所示。 表1 android.hardware中类[1] 类 类的功能 Camera The Camera class is used to set image capture settings,start/stop preview,snap pictures,and retrieve frames for encoding for video. Camera.Area The Area class is used for choosing specific metering and focus areas for the camera to use when calculating auto-exposure,auto- white balance,and auto-focus Camera.Cameralnfo Information about a camera Camera.Face Information about a face identified through camera face detection. Camera.Parameters Camera service settings. Camera.Size Image size(width and height dimensions). ConsumerIrManager Class that operates consumer infrared on the device. ConsumerIrManager.Carrier Represents a range of carrier frequencies (inclusive)on which the FrequencyRange infrared transmitter can transmit GeomagneticField Estimates magnetic field at a given point on Earth,and in particular, to compute the magnetic declination from true north. Sensor Class representing a sensor. SensorEvent This class represents a Sensor event and holds informations such as the sensor's type,the time-stamp,accuracy and of course the sensor's data. SensorManager SensorManager lets you access the device's sensors. TriggerEvent This class represents a Trigger Event-the event associated with a Trigger Sensor. TriggerEventListener This class is the listener used to handle Trigger Sensors 2、android.hardware..Camera类 现在的手机一般都会提供相机功能,有些相机的镜头甚至支持1000万以上 像素,有些甚至支持光学变焦,这些手机已经变成了专业数码相机。为了充分利 用手机上的相机功能,Android APIs提供了丰富的支持库。如表2所示。 使用Android设备的摄像头(照相机)需要设备访问权限如下。 <uses-permission android:name="android.permission.CAMERA"/> 如果您在阅读过程中发现疏漏和错误,请联系《多媒体技术基础》课程组{network,.cxh}@ustc.edu.cn中国科学技术大学电子工程与信息科学系© 2018 如果您在阅读过程中发现疏漏和错误,请联系《多媒体技术基础》课程组{network,cxh}@ustc.edu.cn 实验十七 Android 下的摄像头编程 一、 实验目的 (1) 学习 Android 下进行摄像头控制的基本方法。 (2) 理解回调函数。 二、 实验原理 1、android.hardware android.hardware 包下面包含了如摄像头、传感器等硬件的支持(不是所有 的硬件)。如表 1 所示。 表 1 android.hardware 中类[1] 类 类的功能 Camera The Camera class is used to set image capture settings, start/stop preview, snap pictures, and retrieve frames for encoding for video. Camera.Area The Area class is used for choosing specific metering and focus areas for the camera to use when calculating auto-exposure, auto￾white balance, and auto-focus. Camera.CameraInfo Information about a camera Camera.Face Information about a face identified through camera face detection. Camera.Parameters Camera service settings. Camera.Size Image size (width and height dimensions). ConsumerIrManager Class that operates consumer infrared on the device. ConsumerIrManager.Carrier FrequencyRange Represents a range of carrier frequencies (inclusive) on which the infrared transmitter can transmit GeomagneticField Estimates magnetic field at a given point on Earth, and in particular, to compute the magnetic declination from true north. Sensor Class representing a sensor. SensorEvent This class represents a Sensor event and holds informations such as the sensor's type, the time-stamp, accuracy and of course the sensor's data. SensorManager SensorManager lets you access the device's sensors. TriggerEvent This class represents a Trigger Event - the event associated with a Trigger Sensor. TriggerEventListener This class is the listener used to handle Trigger Sensors. 2、android.hardware.Camera 类 现在的手机一般都会提供相机功能,有些相机的镜头甚至支持 1000 万以上 像素,有些甚至支持光学变焦,这些手机已经变成了专业数码相机。为了充分利 用手机上的相机功能,Android APIs 提供了丰富的支持库。如表 2 所示。 使用 Android 设备的摄像头(照相机)需要设备访问权限如下。 <uses-permission android:name="android.permission.CAMERA" />
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有