, , , , . . , , . , , . , , .
Stack Imgur, - :

"" , . 5 , , , . , imerode imdilate, 5 × 5 .
% Read from Stack Imgur directly
im = imread('/img/0f4664860a3f6ef58f2ffe83464b5be9.png');
% Perform Sobel Edge detection
sim = edge(im, 'sobel');
% Find the mask of the object
mask = im > 5;
% Shrink the object
se = strel('square', 5);
mask_s = imerode(mask, se);
% Remove the inner boundary of the object
mask(mask_s) = false;
% Slightly enlarge now to ensure outer boundary is removed
mask = imdilate(mask, se);
% Create new image by removing the boundaries of the
% edge image
sim(mask) = false;
% Show the result
figure; imshow(sim);
:

Sobel, , . , , .