Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
engine:7.8:api [2017/04/21 12:26]
pdufour [SearchImageByUpload]
engine:7.8:api [2018/02/01 17:13]
pdufour [SearchImageByDna]
Line 324: Line 324:
 **Note**: in the interest of brevity the //​result_info//​ is shown as empty in all the following sections. **Note**: in the interest of brevity the //​result_info//​ is shown as empty in all the following sections.
  
 +<​html>​
 +<​pagebreak>​
 +</​html>​
 +
 +=== SearchImageById ====
 +Runs an image search on an application,​ taking an image from the database as the query.
 +\\
 +  * **Request type :​**''​GET''​
 +  * **Required Parameters :**
 +    * application_key (string): the unique key of the application to query
 +    * image_id (string): The unique identifier of the image.
 +  * **Optional Parameters :**
 +    * color_weight (integer): how important is color in the search - only for //​Similarity//​ applications
 +    * starting_index (integer): index of the first image to be returned in the list of results
 +    * nb_results (integer): number of results to return
 +    * ids_list (string): list of //​image_id//​s among which to search
 +  * **Response**:​
 +    * status (object):
 +      * message (string): comprehensive message regarding the status of your query
 +      * code (integer): a specific status code, 0 means success
 +    * nb_results_found (integer): the **total** number of reference images that matched the query
 +    * images (list of object):
 +      * keywords (list of string): the keywords linked to the image
 +      * score (float): the confidence matching score - smaller is better
 +      * id (string): image_id with which the image has been added to your reference database
 +      * result_info (string): give more information about the result
 +
 +**CURL query**
 +<sxh php; title: Sample query>
 +curl -sL 
 +'​http://​hostaddress:​8080/​api/​v2.0/​ltuquery/​json/​SearchImageById?​application_key=PXly9fRUfUt0oizKTcmpzFS8AAtqrTgI&​image_id=pinpin'​
 +</​sxh>​
 +
 +
 +\\ 
 +**JSON response**
 +<sxh jscript; title: Sample result>
 +{
 +  "​images":​[
 +    {
 +     "​keywords":​[],​
 +     "​score":​0,​
 +     "​id":"​some_image.jpg",​
 +     "​result_info":""​
 +    },
 +    {
 +     "​keywords":​[],​
 +     "​score":​0.719954,​
 +     "​id":"​some_other_image.jpg",​
 +     "​result_info":""​
 +    }],
 + "​status":​
 +  {
 +   "​message":"​No error",​
 +   "​code":​0
 +  },
 + "​nb_results_found":​100
 +}
 +</​sxh>​
 +
 +**Note that SearchImageById is not available for Mobile Matching applications. You will receive -2609 error code instead.**
 +
 +<​html>​
 +<​pagebreak>​
 +</​html>​
 +
 +==== SearchImageByDna ====
 +The equivalent of a SearchImageByUpload,​ but where the DNA is precomputed on the client side, and send directly instead the image.
 +\\
 +
 +  * **Request type :​**''​POST'' ​
 +  * **Required Parameters :**
 +    * application_key (string): the unique key of the application to query
 +    * dna (string): a byte array representing the precomputed DNA for the image.
 +  * **Optional Parameters :**
 +    * keywords (list of strings): one or more keywords that will be associated to this image.
 +    * color_weight (integer): how important is color in the search - only for //​Similarity//​ applications
 +    * starting_index (integer): index of the first image to be returned in the list of results
 +    * nb_results (integer): number of results to return
 +    * ids_list (string): list of //​image_id//​s among which to search
 +  * **Response**:​
 +    * status (object):
 +      * message (string): comprehensive message regarding the status of your query
 +      * code (integer): a specific status code, 0 means success
 +    * nb_results_found (integer): the **total** number of reference images that matched the query
 +    * images (list of object):
 +      * keywords (list of string): the keywords linked to the image
 +      * score (float): the confidence matching score - smaller is better
 +      * id (string): image_id with which the image has been added to your reference database
 +      * result_info (string): give more information about the result
 + 
 +\\ 
 +**For information concerning pre-computed DNA's, please contact LTU Tech support.**
 +\\ 
 +\\ 
 +**JSON response**
 +<sxh jscript; title: Sample result>
 +{
 +  "​images":​[
 +    {
 +     "​keywords":​[],​
 +     "​score":​0,​
 +     "​id":"​some_image.jpg",​
 +     "​result_info":""​
 +    },
 +    {
 +     "​keywords":​[],​
 +     "​score":​0.719954,​
 +     "​id":"​some_other_image.jpg",​
 +     "​result_info":""​
 +    }],
 + "​status":​
 +  {
 +   "​message":"​No error",​
 +   "​code":​0
 +  },
 + "​nb_results_found":​100
 +}
 +</​sxh>​
 <​html>​ <​html>​
 <​pagebreak>​ <​pagebreak>​