How can I write the results of my 'Video OCR' script to an excel document in the following format?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Dima Lisin
el 8 de Feb. de 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 comentarios
ayesha abbassi
el 13 de Mzo. de 2018
thank you man... (y) this helps me..
1 comentario
ayça kepçe
el 3 de Jul. de 2019
Hi there, I am stuck with the same thing but csvwrite does not except ocrtext. Can you give a small example?
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!