Skip to content

Commit

Permalink
docs: changing 2 parameters to ISIIS images
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernanda Lecaros Saavedra authored and Fernanda Lecaros Saavedra committed Jul 31, 2024
1 parent 78ac76b commit 417bbf4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sdcat/detect/saliency_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def extract_blobs(saliency_map: np.ndarray, img_color: np.ndarray, show=False) -
255, # Max pixel value
cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
cv2.THRESH_BINARY,
27, # Block size (size of the local neighborhood)
23, # Block size (size of the local neighborhood)
3 # Constant subtracted from the mean
)

Expand All @@ -152,9 +152,10 @@ def extract_blobs(saliency_map: np.ndarray, img_color: np.ndarray, show=False) -
saliency_map_thres_c = cv2.dilate(saliency_map_thres_c, kernel1, iterations=4)
saliency_map_thres_c = cv2.erode(saliency_map_thres_c, kernel2, iterations=4)
else:
kernel = np.ones((3, 3), np.uint8)
saliency_map_thres_c = cv2.dilate(saliency_map_thres_c, kernel, iterations=2)
saliency_map_thres_c = cv2.erode(saliency_map_thres_c, kernel, iterations=1)
kernel1 = np.ones((4, 4), np.uint8)
kernel2 = np.ones((3, 3), np.uint8)
saliency_map_thres_c = cv2.dilate(saliency_map_thres_c, kernel1, iterations=1)
saliency_map_thres_c = cv2.erode(saliency_map_thres_c, kernel2, iterations=1)

if show:
# Display the thresholded saliency map
Expand Down

2 comments on commit 417bbf4

@danellecline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flecaros-mbari these changes look great, although it looks like this is breaking the tests https://github.com/mbari-org/sdcat/actions/runs/10184796729/job/28172930349

Tests are created from the UAV images and these changes may be fine for that as well. I'll take a closer look and report back.

@danellecline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. These changes reduced the detections only slightly for UAV so ok to keep.

Please sign in to comment.