Mediapipe Blazepose poseclassification android 源码分析(四)——RepetitionCounter.java
- RepetitionCounter.java
统计动作次数的关键代码
作用:Counts reps for the give class.为给定的类统计重复次数
参数:className
,enterThreshold = 6f
,exitThreshold = 4f
,numRepeats = 0
,poseEntered = false
实例化方法:就是初始化各个参数
重要方法:
- addClassificationResult(ClassificationResult classificationResult)
添加一个新的Pose分类结果,更新并返回给定类的重复次数Reps
public int addClassificationResult(ClassificationResult classificationResult) {
float poseConfidence = classificationResult.getClassConfidence(className);
// 如果poseEntered = false,判断poseConf