I have some 50 photos which I want to extarct the text out of from, I am saving the extracted text into a text file. Problem is the current code that I am using seems to be opening the image files from the folder randomly. How do I make sure that image file opens sequentially ?
location= 'file_path\*.jpg';ds = imageDatastore(location);fid = fopen('noPlate.txt', 'wt');while hasdata(ds) img = read(ds) ; % read image from datastore
ocrResults = ocr(img) recognizedText = ocrResults.Text; % This portion of code writes the recognise text
fprintf(fid,'%s\n', recognizedText); fprintf(fid,'%s\n', '\n'); endfclose(fid); winopen('noPlate.txt')
Best Answer