Skip to content

Populate classId and confidence level for object detection in Java simulation#2372

Open
shdalton wants to merge 2 commits intoPhotonVision:mainfrom
shdalton:java-object-detection-simulation
Open

Populate classId and confidence level for object detection in Java simulation#2372
shdalton wants to merge 2 commits intoPhotonVision:mainfrom
shdalton:java-object-detection-simulation

Conversation

@shdalton
Copy link

Description

compute confidence level based on target area in total image size and populate classId and confidence level in Java (while building the PhotonTrackedTarget)

What changed? Why? (the code + comments should speak for itself on the "how")

  • classId and confidence level was filled at -1 during PhotonTrackedTarget in Java

…puted confidence level in Java (while building the PhotonTrackedTarget)
@shdalton shdalton requested a review from a team as a code owner February 21, 2026 21:01
@github-actions github-actions bot added the photonlib Things related to the PhotonVision library label Feb 21, 2026
@samfreund samfreund requested a review from amquake February 21, 2026 21:02
float conf = tgt.objDetConf;
if (classId >= 0 && conf < 0) {
// Simulate confidence using sqrt-scaled area for a more realistic
// curve. Raw areaPercent/100 is tiny for most targets; sqrt scaling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applies to all 3 languages but can we move this to the target javadoc? So people know "either set confidence yourself, or the sim will guess at it based on area"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I did implement it for all 3 languages, would you like me to put a function header in all 3 languages for the process function? I apologize I'm not sure exactly what you mean by "move this to the target javadoc". While at it, would you happen to have an idea why my change fails for orangepi5pro (I only have an orangepi5plus here... maybe I can try to duplicate the problem)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps you meant add some documentation to the AddVisionTargets or even just the VisionTargetSim class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

photonlib Things related to the PhotonVision library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants