基于K最近邻算法的人体姿态检测与计数研究

宋咏琪, 王思多, 王琪, 鲁佳豪, 崔艳

电脑与电信 ›› 2025, Vol. 1 ›› Issue (5) : 1-5.

电脑与电信 ›› 2025, Vol. 1 ›› Issue (5) : 1-5.
算法研究

基于K最近邻算法的人体姿态检测与计数研究

  • 宋咏琪, 王思多, 王琪, 鲁佳豪, 崔艳*
作者信息 +

Research on Human Pose Detection and Counting Using K-Nearest Neighbors Algorithm

  • SONG Yong-Qi, WANG Si-duo, WANG Qi, LU Jia-hao, CUI Yan*
Author information +
文章历史 +

摘要

基于图像处理和机器学习设计人体姿态动作检测系统,旨在健身锻炼时实现自动化计数,避免因人工计数导致的误差。首先,利用OpenCV对测试视频进行采集,获取视频中的每一帧动作图像,接着对获取到的图像进行图像增强的预处理,并通过Mediapipe库检测图像中人体33个骨骼关键点进行归一化处理,再将关键点坐标转换为嵌入向量作为输入,利用K近邻(K-Nearest Neighbors, KNN)算法与样本库对比,完成姿态动作的计数识别。最后,平滑姿态分类结果并进行计数,实现姿态动作识别与个数检测,同时将识别与计数结果以视频形式输出到UI界面。本研究通过解决传统计数方式的弊端,提供了高效的集人体姿态动作识别及计数功能于一体的方法,在提升效率和促进健康方面具有显著的社会和经济价值。

Abstract

This study proposes a human posture action detection system based on image processing and machine learning, designed to automate fitness exercise counting and eliminate errors associated with manual tracking. The framework begins by capturing and decomposing test videos into sequential motion frames using OpenCV. The acquired images undergo preprocessing for enhancement, followed by the detection and normalization of 33 skeletal keypoints via the Mediapipe library. The normalized keypoint coordinates are then transformed into embedding vectors as model input. A K-Nearest Neighbors (KNN) algorithm compares these vectors against a reference database to classify and count exercise repetitions. Temporal smoothing refines the classification output, ensuring robust action recognition and accurate repetition counting. The system culminates in a user-friendly UI that visually presents the processed video stream alongside real-time analytics. By addressing the limitations of conventional counting methods, this research delivers an efficient, integrated solution for automated posture recognition and repetition tracking. Its practical implementation offers significant societal and economic value by enhancing workout efficiency and promoting health-conscious fitness practices.

关键词

人体姿态动作识别 / OpenCV / Mediapipe / K近邻算法

Key words

human pose action recognition / OpenCV / Mediapipe / KNN Algorithm

引用本文

导出引用
宋咏琪, 王思多, 王琪, 鲁佳豪, 崔艳. 基于K最近邻算法的人体姿态检测与计数研究[J]. 电脑与电信. 2025, 1(5): 1-5
SONG Yong-Qi, WANG Si-duo, WANG Qi, LU Jia-hao, CUI Yan. Research on Human Pose Detection and Counting Using K-Nearest Neighbors Algorithm[J]. Computer & Telecommunication. 2025, 1(5): 1-5
中图分类号: TP391.41   

参考文献

[1] Lowe D G.Distinctive image features from scale-invariant keypoints[J].International journal of computer vision, 2004, 60(2):91-110.
[2] Alexander T, Christian S.DeepPose: Human Pose Estimation via Deep Neural Networks[J/OL].CoRR abs/1312.4659.(2013).
[3] 张欣毅,张运楚,王菲,等.改进YOLOpose的轻量化多人姿态检测模型[J].小型微型计算机系统,2025,46(1):167-172.
[4] Newell A,Yang K,Deng J.Stacked hourglass networks for human pose estimation[C]//European conference on computer vision.Springer,Cham,2016:483-499.
[5] Chenchen L,Yongzhi L,Kangqi M,et al.Learning 3-D Human Pose Estimation from Catadioptric Videos[C]//The 30th International Joint Conference on Artificial Intelligence (IJCAI) 2021.
[6] 张恒博,刘大铭,伏娜娜,等.基于MediaPipe Pose的人体动作识别方法研究[J].宁夏工程技术,2024,23(1):79-84+91.
[7] 杨易木. 基于KNN算法的电子档案信息文本自动分类方法[J].办公自动化,2025,30(5):14-16
[8] 李怀义,李如晗,孙红霞.基于BlazePose模型和KNN算法的消防体能训练识别系统设计[J].人工智能,2023(3):89-97.

基金

国家自然科学基金资助项目,项目编号:61503231; 山西省高等学校大学生创新创业训练计划项目,项目编号:S202410118002; 山西师范大学大学生创新创业训练计划资助项目,项目编号:2024DCXM-02

Accesses

Citation

Detail

段落导航
相关文章

/