I have a picture below. For some reason, C# code below for Google Cloud Vision API Works on sample picture in Object Localizer Resource:
https://cloud.google.com/vision/docs/object-localizer
However, it does not work for my picture below. How can this be fixed?
I want it to detect two rectangles at least.
static void Main(string[] args)
{
System.Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", @"C:Usersjohn.smithDesktopConsoleApp1ProjectTest.json");
var client = ImageAnnotatorClient.Create();
var image = Image.FromFile(@"C:Usersjohn.smithDesktopestpicture.jpg");
var response = client.DetectLocalizedObjects(image);
Console.WriteLine($"Number of objects found {response.Count}");
foreach (var localizedObject in response)
{
Console.Write($"
{localizedObject.Name}");
Console.WriteLine($" (confidence: {localizedObject.Score})");
Console.WriteLine("Normalized bounding polygon vertices: ");
foreach (var vertex
in localizedObject.BoundingPoly.NormalizedVertices)
{
Console.WriteLine($" - ({vertex.X}, {vertex.Y})");
}
}
Console.ReadKey();
}
Results: (only detects 1 outer whiteboard, no inner rectangles or polygon)
Whiteboard (confidence: 0.5879682)
Normalized bounding polygon vertices:
- (0, 0.0076482575)
- (0.9673452, 0.0076482575)
- (0.9673452, 0.9902978)
- (0, 0.9902978)
Related question: Does Amazon Rekognition Detect Shapes like Squares, Triangles, Circles?
question from:
https://stackoverflow.com/questions/65866127/google-cloud-vision-api-not-detecting-objects-shapes 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…