![]() |
|
اكتشاف الشعارات على الصور باستخدام Google Cloud Vision API - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : دلفي للعرب - القسم العام (https://delphi4arab.net/forum/forumdisplay.php?fid=10) +--- الموضوع : اكتشاف الشعارات على الصور باستخدام Google Cloud Vision API (/showthread.php?tid=11371) |
اكتشاف الشعارات على الصور باستخدام Google Cloud Vision API - Delphi4Us - 27-05-2021 Detecting Logos On Images Using Google Cloud Vision API ![]() كود : POST https://vision.googleapis.com/v1/images:annotate
{
"requests": [
{
"features": [
{
"type": "LOGO_DETECTION"
}],
"image": {
"source": {
"imageUri": "https://images.pexels.com/photos/791942/pexels-photo-791942.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"
}}}]}
procedure TForm1.Button1Click(Sender: TObject);
var
APIkey: String;
begin
FDMemTable1.Active := False;
RESTClient1.ResetToDefaults;
RESTClient1.Accept := 'application/json, text/plain; q=0.9, text/html;q=0.8,';
RESTClient1.AcceptCharset := 'UTF-8, *;q=0.8';
RESTClient1.BaseURL := 'https://vision.googleapis.com';
RESTClient1.HandleRedirects := True;
RESTClient1.RaiseExceptionOn500 := False;
//APIkey := 'put here your Google API key';
RESTRequest1.Resource := Format('v1/images:annotate?key=%s', [APIkey]);
RESTRequest1.Client := RESTClient1;
RESTRequest1.Response := RESTResponse1;
RESTRequest1.SynchronizedEvents := False;
RESTResponse1.ContentType := 'application/json';
RESTRequest1.Params[0].Value := Format(
'{"requests": [{"features": [{"maxResults": %s,"type": "LOGO_DETECTION"}],"image": {'+
'"source": {"imageUri": "%s"}}}]}', [Edit2.text, Edit1.text]);
RESTResponse1.RootElement := 'responses[0].logoAnnotations';
RESTRequest1.Execute;
memo2.Lines := RESTResponse1.Headers;
memo3.Lines.text := RESTResponse1.Content;
end;RE: اكتشاف الشعارات على الصور باستخدام Google Cloud Vision API - larbiparadox - 27-05-2021 APIkey ليست مجانية |