---
title: "Squat Detection With Pose Estimation: Landmarks, Camera, Rep Logic"
canonical: "https://aifitnessapi.com/motion/squat-detection-pose-estimation"
cluster: "AI Motion"
primary_query: "squat detection pose estimation"
last_reviewed: "2026-10-18"
description: "Squat counting from a camera, by the studies: knee and hip landmarks, phone placement that worked, rep thresholds to calibrate, and the accuracy measured."
publisher: "AIFitnessAPI — independent, not sponsored"
cite_as: "\"Squat Detection With Pose Estimation: Landmarks, Camera, Rep Logic\", AIFitnessAPI, https://aifitnessapi.com/motion/squat-detection-pose-estimation"
---

# Squat Detection With Pose Estimation: Landmarks, Camera, Rep Logic

> A camera squat counter reads the knee angle from the hip, knee and ankle landmarks, usually alongside the hip angle, and counts a repetition when that angle drops past a bottom threshold and climbs back past a top one. Placement matters as much as the model: in a 2026 study that filmed 22 adults from 12 phone positions, one phone pipeline counted 95.5% of squat repetitions correctly from a diagonal view at 200 cm and none from the side at 90 cm. Treat every threshold here as a study's starting point, to calibrate for your own camera, model and users.

- Canonical: https://aifitnessapi.com/motion/squat-detection-pose-estimation
- Last reviewed: 2026-10-18
- Publisher: AIFitnessAPI (https://aifitnessapi.com) — independent, not sponsored
- Cite as: "Squat Detection With Pose Estimation: Landmarks, Camera, Rep Logic", AIFitnessAPI, https://aifitnessapi.com/motion/squat-detection-pose-estimation

---

This page is the squat-specific layer under [how rep counting works](/motion/how-rep-counting-works) and [how form feedback works](/motion/how-form-feedback-works): which landmarks to read, where the camera went in the studies, how to structure the rep logic, and what the studies measured. We read them on October 18, 2026. Each number is one study's result under that study's conditions, so use it as a starting point to calibrate for your camera, model and users. This is engineering guidance for building a tracker, not exercise or medical advice.

## The studies behind this page

- **Oliosi and colleagues** (JMIR mHealth and uHealth, 2026) filmed 22 healthy university students doing squats from 12 phone positions and scored the repetition counts of a pipeline built for the Dotmoovs mobile platform against two raters.
- **Sousa and colleagues** (Journal of Functional Morphology and Kinesiology, 2026) counted repetitions of 12 exercises, squats among them, with angle-threshold state machines on [MediaPipe](/motion/mediapipe-pose-landmarker-models)'s 33 landmarks.
- **Iizuka and colleagues** (Frontiers in Sports and Active Living, 2026) compared hip and knee angles from [MoveNet](/motion/movenet-models) Lightning, running in a web browser, against a six-camera marker system in 30 healthy adult males.
- **Gu and colleagues** (Sensors, 2026) recorded 10 participants doing push-ups, sit-ups and squats from the side, the front and behind, and report how often their camera branch recognised each exercise from each view.

## Landmarks and angles

Two angles carry a squat: the knee angle, at the knee between the hip and the ankle, and the hip angle, at the hip between the shoulder and the knee. Every keypoint scheme on this site has those six points, so any common pose model can produce the counting signal. Sousa and colleagues compute each angle from three MediaPipe landmarks, and they describe the results as approximate kinematic indicators rather than precise biomechanical measurements.

The schemes differ at the foot. [BlazePose 33](/pose-keypoints/blazepose-33), the MediaPipe Pose Landmarker's map, and [ML Kit's 33 landmarks](/pose-keypoints/ml-kit) include a heel and a foot-index point on each side; [Halpe26](/pose-keypoints/halpe-26) and [OpenPose BODY_25](/pose-keypoints/openpose-body-25) include heels and toes; [COCO 17](/pose-keypoints/coco-17), the output of MoveNet and YOLO pose, and [Apple Vision's 2D joints](/pose-keypoints/apple-vision-2d) stop at the ankle. A heel-lift check or an ankle angle needs one of the first four.

Angle conventions differ as well. Iizuka and colleagues express depth as flexion: their on-screen target was 120° of hip and knee flexion. Sousa and colleagues' example squat starts with the knee angle above 160, which in our reading only works if a straight leg reads near 180. Check which convention a number uses before you copy it. Iizuka and colleagues also computed angles with the four-quadrant arctangent (atan2) instead of an inverse cosine, to keep the angle continuous near full extension.

## Where to put the camera

Oliosi and colleagues recorded 1080p video at 30 frames per second with the phone on the floor at 0° (front), 45° (diagonal) or 90° (side) to the participant, and 90, 180, 200 or 360 cm away. For squats, diagonal and front views beat side views at every distance. The best squat setup was diagonal at 200 cm, with 95.5% of repetitions counted correctly and a mean absolute error of 0.05 repetitions; the worst was side-on at 90 cm, with 0% and an error of 5 repetitions. Their summary is that diagonal and frontal views at mid-range distances of 180 to 200 cm gave the highest detection accuracy and counting precision.

Iizuka and colleagues, who measured angles rather than counts, did the opposite: a laptop webcam 2.00 m to the participant's right for a sagittal view, at about 0.975 m, the average height of the greater trochanter, to limit perspective distortion at the hip and knee. Participants kept their arms crossed over the chest so the arms would not hide keypoints.

In our reading the two results do not conflict. A side view keeps the hip and knee angles in the image plane, which an angle measurement needs, while counting in Oliosi and colleagues' pipeline worked better from the diagonal and the front. Decide which job your feature does, then test both placements with your own users.

## A rep state machine for squats

Both counting studies count state changes rather than raw peaks. Oliosi and colleagues' pipeline labels every frame with a movement state such as squat-down, squat-up or other, and a Markov-chain step counts a repetition when it sees a set sequence such as up, down, up. Sousa and colleagues model the squat as standing, descending and ascending phases. Their example definition, with every value marked as an adjustable default, starts at `knee_angle > 160` and `hip_angle > 160` and enters the descent at `knee_angle < 100` and `hip_angle < 150`.

The gap between the top threshold and the bottom one is the hysteresis described in [how rep counting works](/motion/how-rep-counting-works): an angle jittering around either boundary cannot complete a cycle by itself. Sousa and colleagues also hold the last valid phase for a few frames, typically 3 to 5, when no phase matches, so a dropped or noisy frame does not reset the cycle; they report that this removed nearly all spurious resets. Gu and colleagues cut the camera's vote when mean keypoint confidence fell below 0.45, and call that a fixed engineering setting rather than an optimised value. A minimum phase duration is the same idea from the other side: in our view, require each phase to hold for a few frames before the machine accepts it, and tune the frame count on your own recordings.

## Failure modes the studies report

- **Bending hides landmarks.** Sousa and colleagues saw key body parts occluded particularly in squats and deadlifts, more so at greater distances. Their squat error table lists one cause, missed bottom positions, 26 times, against 572 annotated squat repetitions.
- **Clothing that blends in.** In the same study, dark clothing against a similar background caused joint misalignment and pose errors.
- **Projection in 2D.** Iizuka and colleagues measured a systematic underestimate from the side-view webcam, −11.2° at the hip and −10.6° at the knee against the marker system, and explain it with the pinhole camera model: a thigh rotating out of the image plane is foreshortened, so the knee angle is underestimated more as the squat gets deeper. [2D vs 3D pose estimation](/motion/2d-vs-3d-pose-estimation) covers what estimated depth can and cannot recover.
- **Viewpoint and self-occlusion.** Gu and colleagues' camera branch recognised squat frames 99.2% of the time from the side, 86.6% from the front and 66.2% from behind. From behind, most failures were frames the pipeline rejected rather than frames given the wrong exercise. Recognising which exercise is under way is a different task from counting it, which is one reason this side-view result does not contradict Oliosi and colleagues' counts.

The general versions of these problems, from lighting to loose clothing, are covered in [pose estimation accuracy](/motion/pose-estimation-accuracy).

## What was measured, and why it will not transfer

- Across all 12 setups, Oliosi and colleagues' squat counts reached a mean detection rate of 61.5% with a mean absolute error of 1.11 repetitions. The reference was two trained raters, an exercise physiologist and a physical therapist; the participants were healthy university students in a laboratory with standardised lighting, and the authors caution that the findings may not generalise to other pose models, populations or unstructured settings.
- Sousa and colleagues report 95% accuracy for squats (95% confidence interval 92.7 to 97.4%), comparing automated counts with manually annotated repetitions from their own recordings, public pose datasets and competition footage.
- Iizuka and colleagues' linear correction, validated leave-one-subject-out, cut root mean square error from 11.6° to 4.0° at the hip and from 10.9° to 3.9° at the knee, and the authors tie that result to a standardised camera distance and orientation.

None of these numbers carries over by itself: each describes one pipeline, one camera geometry and one group of people. Re-measure with your own model, phones and users; [testing a rep counting algorithm](/test/rep-counting) covers how to build that test set.

## Sources

- [pmc.ncbi.nlm.nih.gov/articles/PMC12978916/](https://pmc.ncbi.nlm.nih.gov/articles/PMC12978916/) — Oliosi et al., JMIR mHealth and uHealth 2026: phone placement, the counting pipeline, detection rate and error for squats (full text read as Europe PMC's XML). (checked 2026-10-18)
- [pmc.ncbi.nlm.nih.gov/articles/PMC13204307/](https://pmc.ncbi.nlm.nih.gov/articles/PMC13204307/) — Sousa et al., J Funct Morphol Kinesiol 2026: squat states, default thresholds, phase persistence, accuracy and error causes (read as Europe PMC's XML). (checked 2026-10-18)
- [www.frontiersin.org/journals/sports-and-active-living/articles/10.3389/fspor.2026.1831625/full](https://www.frontiersin.org/journals/sports-and-active-living/articles/10.3389/fspor.2026.1831625/full) — Iizuka et al., Front Sports Act Living 2026: side-view webcam setup, angle bias and corrected error. (checked 2026-10-18)
- [pmc.ncbi.nlm.nih.gov/articles/PMC13611031/](https://pmc.ncbi.nlm.nih.gov/articles/PMC13611031/) — Gu et al., Sensors 2026: recognition by camera view and the 0.45 confidence gate (read as NCBI's efetch XML). (checked 2026-10-18)

## FAQ

### Where should the phone go to count squats?

In Oliosi and colleagues' 2026 study, diagonal (45°) and front views beat side views at every distance, and the best squat result came from a diagonal view at 200 cm. Side-on at 90 cm, the pipeline counted no repetitions correctly. If you need clean hip and knee angles rather than counts, Iizuka and colleagues filmed from the side at 2.00 m with the camera near hip height, so test both placements for your own feature.

[Permalink](https://aifitnessapi.com/motion/squat-detection-pose-estimation#faq-1)

### Which pose landmarks does a squat counter need?

Hip, knee and ankle for the knee angle, and shoulder, hip and knee for the hip angle; every keypoint scheme on this site has all of them. Heel and toe points exist only in some schemes, including BlazePose 33, ML Kit, Halpe26 and OpenPose BODY_25, so a heel-lift check needs one of those, while COCO 17 models such as MoveNet and YOLO pose stop at the ankle.

[Permalink](https://aifitnessapi.com/motion/squat-detection-pose-estimation#faq-2)

### What knee angle should count as the bottom of a squat?

No study we read gives a universal number. Sousa and colleagues' example squat enters the descent below a knee angle of 100 and a hip angle of 150, after a standing phase above 160, and marks each value as an adjustable default. Start there, calibrate per camera, model and user, and check whether a paper reports included angles or flexion angles before you copy its numbers.

[Permalink](https://aifitnessapi.com/motion/squat-detection-pose-estimation#faq-3)

### How accurate is camera-based squat counting?

It depends on the setup. One phone pipeline averaged a 61.5% detection rate across 12 phone positions and reached 95.5% from its best one; a MediaPipe state-machine counter scored 95% against manually annotated squats. Neither figure transfers to another model, camera or population until you measure it there.

[Permalink](https://aifitnessapi.com/motion/squat-detection-pose-estimation#faq-4)
