当前位置:网站首页>Gestureoverlayview (gesture recognition 2)
Gestureoverlayview (gesture recognition 2)
2022-07-27 19:52:00 【Ashurol】
GestureOverlayView: A transparent overlay for gesture input , Used to recognize various gestures , It can be overlaid on the control , Other controls can also be included , There are three listening interfaces
1.GestureOverlayView.OnGestureListener// Gesture monitor
2.GestureOverlayView.OnGesturePerformed// Gesture execution listener
3.GestureOverlayView.onGesturing// Gesture execution listener
// A new project , It is used to recognize the matching between the input gesture and the pre-existing gesture Library
The project is currently , First in the Android simulator Gesture Builder( Android comes with ) Add your own gesture and the corresponding gesture name

After adding, it can be in the corresponding program mnt Medium sdcard Find the added gesture file in the path , Export it to , Then import it into the new program res Folder already built in raw in .

public class MainActivity extends ActionBarActivity {
GestureOverlayView myGestureOverlayView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myGestureOverlayView=(GestureOverlayView) findViewById(R.id.gestureOverlayView);
// Find the preset gesture file
// Load all gestures of gesture file
// matching , distinguish
// The resource file has been loaded from the resource library
final GestureLibrary library= GestureLibraries.fromRawResource(this, R.raw.gestures);
library.load();
myGestureOverlayView.addOnGesturePerformedListener(new OnGesturePerformedListener() {
@Override
public void onGesturePerformed(GestureOverlayView arg0, Gesture gesture) {
// TODO Auto-generated method stub
// Read the contents of the hand potential library , Recognize gestures
ArrayList<Prediction> mygesture=library.recognize(gesture);
Prediction prediction=mygesture.get(0);
if(prediction.score>=5)
{
if(prediction.name.equals("exit"))
{
finish();
}else if(prediction.name.equals("pervious"))
{
Toast.makeText(MainActivity.this, " The previous page ", Toast.LENGTH_SHORT).show();
}else if(prediction.name.equals("next"))
{
Toast.makeText(MainActivity.this, " The next page ", Toast.LENGTH_SHORT).show();
}
}else{
Toast.makeText(MainActivity.this, " No such gesture ", Toast.LENGTH_SHORT).show();
}
}
});
}
}

边栏推荐
- [basic knowledge of deep learning - 43] concept of odds ratio
- Oppo released the first AR glasses and announced that it would invest 50billion in research and development in the next three years
- GestureDetector(手势识别)
- Intel releases horse ridge chip: 22nm process, which can control multiple qubits
- An unknown fastcgi error occurred in IIS: 0x80070005
- Adhering to the integration of software and hardware, one Hengke makes efforts to the intelligent educational robot market
- [daily accumulation - 06] view CUDA and cudnn versions
- Oracle XE版安装与用户操作
- SystemService(系统服务)
- What's new in helix QAC 2022.2, the ace code static testing tool (1)
猜你喜欢
![[basic knowledge of deep learning - 45] distance calculation methods commonly used in machine learning](/img/6c/b0c2ea667ac361c13d38c8f5e6e5f1.png)
[basic knowledge of deep learning - 45] distance calculation methods commonly used in machine learning

Introduction to socke programming

UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte
Dry goods of technical practice | preliminary exploration of large-scale gbdt training

5W bonus pool / for colleges and universities, 2022 legal science and technology innovation competition is in progress

GridView(实现表格显示图标)

下放三星3J1传感器:代码暗示Pixel 7人脸识别安全性将大增

Oracle XE版安装与用户操作

Fabric上搭建Hyperledger caliper进行性能测试

Binary search tree
随机推荐
MarqueeTextview(跑马灯)
Oracle 简单的高级查询
Detailed explanation of the underlying data structure of redis
Summenudemo (submenu)
坚持软硬一体化,一恒科发力智能化教育机器人市场
Pytorch reports CUDA error: no kernel image is available for execution on the device error
【深度学习基础知识 - 43】优势比的概念
ArrayAdapter(数组适配器)与SimpleAdapter(简单适配器)
Embedded C language pointer alias
Matplotlib(基本用法)
go-zero单体服务使用泛型简化注册Handler路由
函数总结
The first in the field of mobile phone chip design in the world! Ziguang zhanrui won the international certification of tmmi4
【日常积累 - 07】cuda多版本切换
贪心
[basic knowledge of deep learning - 47] Bayesian networks and naive Bayes
王牌代码静态测试工具Helix QAC 2022.2 中的新增功能(1)
Uncover the mystery of Qualcomm ultrasonic fingerprint being "cracked by film"
Flink introduction and operation architecture
Optimization of fixed number of cycles in embedded C language