How can I write the results of my 'Video OCR' script to an excel document in the following format?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Good Afternoon, I'm attempting to write a script that will
- Break up a video into its component frames (Check)
- Use the OCR function (computer vision toolbox) to find text in each of these frames (Check)
- write this text to an excel document (this is where I am experiencing difficulty)
So for the sake of this question lets say that I am simply trying to write a script that will read names from the bottom of say a CNN video. I would have a series of names as such (John Doe firm x, Jane Doe firm y,...) and would like this written in an excel spreadsheet under column A(A1,A2,A3,...). Thus far I have only been able to have Matlab write the first frames recognized characters to excel which each character taking up its own column. Below I have copied my script thus far and additionally inserted a screenshot of my resultant excel file:
clear all
close all
clc
vid=VideoReader('/Users/me/Documents/MATLAB/Video 2.mp4');
nFrames = vid.NumberOfFrames;
roi=[7 595 1273 93];
for f = 1:7
frame=read(vid,f);
ocrResults(f) = ocr(frame,roi);
end
Text=ocrResults.Text
filename = 'textResults.xls';
xlswrite(filename,Text)
Any help would be greatly appreciated.
0 Commenti
Risposte (2)
Dima Lisin
il 8 Feb 2015
You can write your output into a .csv (comma-separated values) file using the csvwrite function. Excell can read a .csv file, and it will put every comma-delimited item into its own cell.
0 Commenti
ayesha abbassi
il 13 Mar 2018
thank you man... (y) this helps me..
1 Commento
ayça kepçe
il 3 Lug 2019
Hi there, I am stuck with the same thing but csvwrite does not except ocrtext. Can you give a small example?
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!