Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
36 lines (28 loc) · 679 Bytes

File metadata and controls

36 lines (28 loc) · 679 Bytes
services platforms author
data-lake-analytics
dotnet
saveenr

U-SQL: Cognitive Imaging OCR Hello World

REFERENCE ASSEMBLY ImageCommon;
REFERENCE ASSEMBLY FaceSdk;
REFERENCE ASSEMBLY ImageEmotion;
REFERENCE ASSEMBLY ImageTagging;
REFERENCE ASSEMBLY ImageOcr;

@imgs =
    EXTRACT 
        FileName string, 
        ImgData byte[]
    FROM @"/usqlext/samples/cognition/{FileName}.jpg"
    USING new Cognition.Vision.ImageExtractor();

@ocrs =
    PROCESS @imgs
    PRODUCE FileName,
            Text string
    READONLY FileName
    USING new Cognition.Vision.OcrExtractor();

OUTPUT @ocrs
    TO "/ocr.csv"
    USING Outputters.Csv( outputHeader: true );