Skip to content

Colored Shape Polygon Vertices #2234

Description

@itserichuang

Describe the bug
I've been trying to detect the orientation of a coral using the Colored Shape pipeline and a polygon contour. I've figured out an algorithm that utilizes the individual vertices surrounding a coral to calculate the rotation of the coral; however, I can't seem to get the individual vertices of the shape, only the minimum area rectangle. Using the getDetectedCorners() method of PhotonTrackedTarget returns an empty List. If this is intended, could a feature be added to allow for getting the individual polygon vertices?

To Reproduce
Steps to reproduce the behavior:

  1. Set up a colored shape pipeline with a polygon contour that is filtered for coral
  2. Put a coral in view of the camera and check that it is being detected properly
  3. Get the results from the PhotonCamera, get the target from the result, and get the detected corners from the target
  4. Check the size of the returned List

Code for getting the size of the detected corners list

List<PhotonPipelineResult> results = camera.getAllUnreadResults();
if (results.size() > 0) {
    PhotonPipelineResult result = results.get(results.size() - 1);
    List<PhotonTrackedTarget> targets = result.getTargets();
    for (int i = 0; i < targets.size(); i++) {
        System.out.println("Number of Detected Corners: " + targets.get(i).getDetectedCorners().size());
    }
}

Platform:

  • Hardware Platform: Orange Pi 5
  • PhotonVision Version: 2025.3.1
  • Browser (with Version) (Chrome, Edge, Firefox, etc.): Google Chrome 143.0.7499.109
  • Camera(s) Used: Arducam OV9782

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions