vital-ultrasound / ai-echocardiography-for-low-resource-countries

AI-assisted echocardiography for low-resource countries
1 stars 1 forks source link

Masking relevant sections of the captured video frame #18

Closed mxochicale closed 2 years ago

mxochicale commented 3 years ago

🚀 Feature

Masking relevant sections of the captured video frame will lead to use different methods for the following potentials regions of interest:

US image arc shape

The current implementation to mask US image arc shape is a manual one which limitation will come when US beams are for different field of view and depth. That said, AG suggest the use of convex hull of opencv and the average of various frames to get the right mask. For the use of convex hull and image filter, MX mentions that might be impacted with different contrast or gain and modes of US settings.

Calipers

Chen et al. 2020 in frontiers of Neurology proposed a Mask R-CNN[11] which can automatically detect and segment the caliper and the fetal lateral ventricles (LVs) simultaneously. Although Mask R-CNN sounds promising, but maybe we will only apply to our work few for the following pre-processing techniques to enhance calipers and compute PPC: (01) intercept of the caliper in the raw image (02) crop the caliper using the bounding box given by Mask R-CNN, (03) conversion to gray-scale, (04) edge detection by the Laplace operator, (05) binarize the gray-scale image using a threshold value of 127 to obtain a monochrome image, (06) perform a morphological open operation on the monochrome image to eliminate a small amount of background noise, (07) minimize background noise and all contours in the image with “findContours” function of OpenCV (08) filter out the contours that have pixel numbers larger than the threshold value of 30, i.e., the large background contours that have not been cleaned by the morphological processing (09) filtering out the small and medium contours of the US image in order to "count the contours that intersect with each y-axis by traversing all y-axes in the caliper image". (10) the mode is obtained as the pixel distance between adjacent scales via calculating and recording the distance between adjacent contours. The position of each contour is represented by the point at the upper left corner of the contour (11) "Finally, all scale contours are obtained via the pixel distance, and the “minAreaRect” function of OpenCV is utilized to generate a rectangular bounding box for each scale contour, to filter out the small contours between scales." [11] He K, Gkioxari G, Dollár P, Girshick R. Mask R-CNN. In: Proceedings of the IEEE International Conference on Computer Vision. Venice (2017). p. 2961–9. doi: 10.1109/ICCV.2017.322. https://scholar.google.com/scholar?cites=16324699838103945745&as_sdt=2005&sciodt=0,5&hl=en

references from a quick seach

Motivation

Pitch

Alternatives

Additional context

mxochicale commented 3 years ago

In our weekly meeting, AG mentions that the bound box can we made as shown below where the black area can be randomised pixels to avoid the net converging to values that are not relevant. Similarly, bound box can be either a bit in the centre with different percentages that relate to the area to be cropped. Screenshot from 2021-10-19 14-07-06

Actions

MX will implement methods for bounding box with different percentages and a small benchmark on computation cost of the cropping.

mxochicale commented 2 years ago

Ideas to consider for cropping from Alberto's comments:

mxochicale commented 2 years ago

Few references that might help to crop relevant US image sections