I've hit a roadblock with this dilemma that has been perplexing me for quite some time now. My goal is to determine the dominant color of an image using Microsoft's Computer Vision service. A snippet of my code can be seen below:
import {VisualFeatureTypes} from "@azure/cognitiveservices-computervision/esm/models";
...
let visualFeatures: VisualFeatureTypes[] = ['Color'];
const caption = (await computerVisionClient.analyzeImageInStream(describeURL, visualFeatures));
Upon executing console.log(caption)
, I receive the following JSON object:
{
"categories": [
{
"name": "others_",
"score": 0.15625
}
],
"requestId": "5a24115f-8095-4a77-8aa9-2d719dce99e6",
"metadata": {
"width": 500,
"height": 500,
"format": "Jpeg"
}
}
The fact that the Computer Vision service functions correctly is evident when I modify the method from analyzeImageInStream
to describeImageInStream
and observe the appropriate response.
Throughout my testing phase, I've been utilizing this image here, as well as Computer Vision's Demo. Interestingly, the demo provides color information while my API call does not yield the same results.
I would greatly appreciate any assistance on this matter.