Conventional convex hull algorithm determines the smallest convex polygon that contains the analyzed shape. The article presents a modification of this algorithm, which allows us to select the concavity to detect. In contrast to the typical convex hull algorithm, the data are analyzed in portions. This paper proposes the use of this modified algorithm for the defects detection on medical images. Two types of images were used: micro-computer tomography images of dental root canals filled with sealer and magnetic resonance images of a patient hand with rheumatoid arthritis. Those images contained some defects that needed to be measured. Prepared algorithm greatly facilitated this process by supporting the user in the segmentation process. The achieved results were positively evaluated by experts - doctors: rheumatologists and endodontists.