You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Somewhere in the kmeans clustering pipeline, the image size is changing. We think this is a feature of the patch-based approach maybe change dimensions to be divisible by the specified patch size. The proposed fix is to add padding to the right and bottom of the image with some background average value to make sure the patch size is divisible by each dimension, and then slice back to the original dimensions when finished.
To Reproduce
Starting with a set of images, train a model using plantcv.learn.train_kmeans making sure to specify a patch size that doesn't divide evenly into the image pixel dimensions
Using a focal image, classify the pixels in the image using plantcv.predict_kmeans
Check the shape of both the original focal image and the output from the prediction step. If the patch size doesn't divide evenly, the image will be smaller after prediction.
Expected behavior
We expect the kmeans function not to change the image size. This is making some downstream checks using the overlay of cluster masks on the original image impossible.
Local environment (please complete the following information):
OS: macOS
Environment: conda plantcv dev environment
PlantCV Version: dev
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Thank you to @jbraley1107 for your help reviewing the iterations of bugfixes. We are trying to adjust for the loss of detection along borders by adding some image padding prior to patch extraction in predict_kmeans .
Describe the bug
Somewhere in the kmeans clustering pipeline, the image size is changing. We think this is a feature of the patch-based approach maybe change dimensions to be divisible by the specified patch size. The proposed fix is to add padding to the right and bottom of the image with some background average value to make sure the patch size is divisible by each dimension, and then slice back to the original dimensions when finished.
To Reproduce
plantcv.learn.train_kmeans
making sure to specify a patch size that doesn't divide evenly into the image pixel dimensionsplantcv.predict_kmeans
Expected behavior
We expect the kmeans function not to change the image size. This is making some downstream checks using the overlay of cluster masks on the original image impossible.
Local environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: