Extract data from the image
조회 수: 2 (최근 30일)
이전 댓글 표시
Sir, how to extract data from the image file. I attached sample figure, I need the value 4795 from the image. Please help me sir.
댓글 수: 0
답변 (1개)
DGM
2023년 11월 29일
편집: DGM
2023년 11월 29일
Why would you save an image by embedding it in a figure? Creating completely pointless obstacles is a great way to make sure nobody takes the time to answer. Save images with imwrite(). Avoid JPG when appropriate.
% the image was obviously a JPG to begin with
% but i'm not going to lossy transcode it again
inpict = imread('asdf.png');
imshow(inpict,'border','tight')
% extract the text
roi = [0.51 49.51 39.98 21.98];
ocrResults = ocr(inpict,roi)
% this can be expected to break as non-numeric "words" are recognized
thenumber = str2double(ocrResults.Words)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
