Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error handling in pcv.transform.detect_color_card #1610

Open
HaleySchuhl opened this issue Oct 17, 2024 · 0 comments
Open

Fatal error handling in pcv.transform.detect_color_card #1610

HaleySchuhl opened this issue Oct 17, 2024 · 0 comments
Labels
help wanted Request help

Comments

@HaleySchuhl
Copy link
Contributor

Describe the bug
It's possible for pcv.transform.detect_color_card to fatally error out, as was brought to our attention in issue #1606 .

To Reproduce
Steps to reproduce the behavior (including sample data and code really help):

  1. Starting with image '...'
    IMG_9309.zip

  2. Run function(s) '....'
    card_mask = pcv.transform.detect_color_card(rgb_img=img)

  3. See error

106 corners = corners[np.argsort([math.dist(corner, corners[white_index]) for corner in corners])[[0, 1, 3, 2]]]
107 # Increment amount is arbitrary, cell distances rescaled during perspective transform

IndexError: index 7145 is out of bounds for axis 1 with size 6960

Expected behavior
Trigger the warning message that a color card couldn't be IDed? Is it valid to have a partial color card?

Local environment (please complete the following information):

  • OS: [macOS]
  • Environment [conda, dev]
  • PlantCV Version [e.g. >4.3.0]

Additional context
Add any other context about the problem here.

@HaleySchuhl HaleySchuhl added the help wanted Request help label Oct 17, 2024
@github-project-automation github-project-automation bot moved this to New Issues in PlantCV4 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Request help
Projects
Status: New Issues
Development

No branches or pull requests

1 participant