Closed HaleySchuhl closed 6 months ago
Here's the code health analysis summary for commits 8e34132..559d57c
. View details on DeepSource ↗.
Analyzer | Status | Summary | Link |
---|---|---|---|
Python | ✅ Success | View Check ↗ | |
Test coverage | ✅ Success | View Check ↗ |
Metric | Aggregate | Python |
---|---|---|
Branch Coverage | 100% | 100% |
Composite Coverage | 99.7% | 99.7% |
Line Coverage | 99.7% | 99.7% |
New Branch Coverage | 100% | 100% |
New Composite Coverage | 100% | 100% |
New Line Coverage | 100%, ✅ Above Threshold | 100%, ✅ Above Threshold |
💡 If you’re a repository administrator, you can configure the quality gates from the settings.
Changed merged in previous PR
Describe your changes Previously we were manually checking for hierarchy of contours and then we would draw the parent contour white, and carve out the child contour shape with black by plotting the first level hierarchy. This means that child of children contours are lost, plus we noticed a bug where the shape of the child contour is slightly enlarged by re-drawing it this way, regardless of settings to
cv2.drawContours
it still seemed like there was a line thickness that would change the result ofcv2.countNonZero(filtered_mask)
and we don't want to change the shape/size of masks by redrawing them. Instead, now we use themaxDepth=2
setting within drawing, provide the function all filtered contours, and just provide thecontourIdx
of the contour we ID as being the largest after ROI filtering. Removes the logic which had been replicatingopencv
contour and hierarchy datatype syntax.Also edit to the unit test which is what brought my attention to this bugfix. Now assert that the pixel count of the largest shape is the same pre & post filtering, and add a secondary small object to get filtered out.
Type of update Is this a:
Associated issues
1507 discovered although separate to the length vs area issue in logic.
Additional context Add any other context about the problem here.
For the reviewer See this page for instructions on how to review the pull request.
plantcv/mkdocs.yml
updating.md
Test on simulated data to see the difference before & after