plantcv icon indicating copy to clipboard operation
plantcv copied to clipboard

Autocrop Objects Needs Attention

Open maliagehan opened this issue 1 year ago • 1 comments

Describe the bug Autocrop object currently requires indexing otherwise does not work. Works: crop_img = pcv.auto_crop(img=img, objects=roi_objects[0], padding_x=20, padding_y=20, color='black')

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

  1. Starting with image '...'
  2. Run function(s) '....'
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Local environment (please complete the following information):

  • OS: [e.g. Linux, macOS, Windows]
  • Environment [e.g. conda, virtualenv, pip, docker, etc.]
  • PlantCV Version [e.g. 3.6.0]

Additional context Add any other context about the problem here.

maliagehan avatar Mar 22 '23 21:03 maliagehan

One solution could be to check number of contours and add a loop if more than one.

maliagehan avatar Mar 23 '23 13:03 maliagehan