You can try the following code snippet for detecting digits in image
img = imread('mm.jpeg'); % your image path
ocr_result = ocr(img,[125.5 103.5 87 39],Language="seven-segment"); % this gives the co-ordinates of the bounding box around the digits
% i got the roi values by using the imcrop function
ocr_result.Words % displays the text detected
Iocr = insertObjectAnnotation(i,"rectangle",...
ocr_result.WordBoundingBoxes,ocr_result.Words,LineWidth=5,fontsize=18);
figure ;
imshow(Iocr)
More information on ocr can be found at the following documentation https://in.mathworks.com/help/vision/ref/ocr.html
I hope this helps your query
Thank you