user3614104
user3614104

Reputation: 60

What format to submit raw images in for Cloud Vision Engine

I'm trying to run OCR on an image by calling the Computer Vision API and passing it data but it isn't working. I've tried data in Base64 and Binary formats, neither work. What format should be to "application/octet-stream"?

Upvotes: 0

Views: 649

Answers (1)

realbart
realbart

Reputation: 3994

The Azure computer vision API does not support raw, it only supports these file formats: JPEG, PNG, GIF, BMP (see https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/home) If you want to send RAW, you need to first convert it to one of the supported file formats.

(If you want another format, like 'raw', you can build an Azure Function, containing a one-line batch file and an existing image conversion program like ImageMagick or GraphicsMagick to do the conversion for you. Then you'd be able to support a wide range of image formats.)

The way to send an image from a C# program is described here: https://learn.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts/csharp It sends the image as an octet-stream, basically as a HTTP-form post. (The same way data would be sent if you'd submitted a form.)

Upvotes: 0

Related Questions