How to store real-time data in a file that can be accessed in matlab elsewhere?
Show older comments
I am working on a program to extract data from image using OCR and store in variables. The process is that the image will be refreshed with a different value after a regular interval (at least 10 seconds). So, I want to run loop with the following process which extracts the numerical from the image and also stores the time of the process, as demonstrated below
%% this complete demonstration will be put into a for loop for obtaining data from similar images
image = importdata('out.png');
image = imresize(image,4);
image = uint8(255*imbinarize(rgb2gray(image)));
%imshow(image)
ocrResults = ocr(image, TextLayout="word");
Iocr = insertObjectAnnotation(image,'rectangle',ocrResults.WordBoundingBoxes,ocrResults.WordConfidences);
imshow(Iocr);
Once OCR gets the value, I store the value and the time (at the instance of OCR processing) into the table.
datavalue = str2num(ocrResults.Text);
time = datetime('now','TimeZone','Asia/Seoul','Format','yyyy-MM-dd HH:mm:ss.SSS');
time = cellstr([string(time)]); % for storing time for exporting
disp([datavalue time]) % this is just for demonstrating the output
Currently, I used the following code to store in the excel file (it takes a second to store). Since the above-mentioned process will be put in a for-loop, so I am just writing the storing code.
xlswrite('name.xls', ftime, sheetNumber, ['A' num2str(i)]);
xlswrite('name.xls', data, sheetNumber, ['B' num2str(i)]);
I have very basic knowledge of Matlab, and I want to efficiently store these data into some sort of file (or files) in a LAN shared folder from 4 computers and then access the data in another computer for processing in realtime (the data keeps on updating).
1 Comment
Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!