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:25]
pdufour
engine:7.8:api [2018/02/01 18:15] (current)
Line 327: Line 327:
 <​pagebreak>​ <​pagebreak>​
 </​html>​ </​html>​
-==== SearchImageByUpload ​==== + 
-Runs an image search on an application, ​using an uploaded ​image as the query.+=== SearchImageById ​==== 
 +Runs an image search on an application, ​taking ​an image from the database ​as the query.
 \\ \\
-  * **Request type :** ''​POST''​+  * **Request type :​**''​GET''​
   * **Required Parameters :**   * **Required Parameters :**
     * application_key (string): the unique key of the application to query     * application_key (string): the unique key of the application to query
-    * image_content ​(string): ​the content ​of the image file i.e. the raw array of bytes in the image.+    * image_id ​(string): ​The unique identifier ​of the image.
   * **Optional Parameters :**   * **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     * 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     * starting_index (integer): index of the first image to be returned in the list of results
Line 350: Line 350:
       * id (string): image_id with which the image has been added to your reference database       * id (string): image_id with which the image has been added to your reference database
       * result_info (string): give more information about the result       * result_info (string): give more information about the result
-\\+
 **CURL query** **CURL query**
 <sxh php; title: Sample query> <sxh php; title: Sample query>
-curl -sL -F "​image_content=@pinpin.jpg" ​ +curl -sL  
-'​http://​hostaddress:​8080/​api/​v2.0/​ltuquery/​json/​SearchImageByUpload?​application_key=PXly9fRUfUt0oizKTcmpzFS8AAtqrTgI'​+'​http://​hostaddress:​8080/​api/​v2.0/​ltuquery/​json/​SearchImageById?​application_key=PXly9fRUfUt0oizKTcmpzFS8AAtqrTgI&​image_id=pinpin'
 </​sxh>​ </​sxh>​
  
-\\ +
 \\  \\ 
 **JSON response** **JSON response**
- 
 <sxh jscript; title: Sample result> <sxh jscript; title: Sample result>
 { {
Line 384: Line 383:
 } }
 </​sxh>​ </​sxh>​
 +
 +**Note that SearchImageById is not available for Mobile Matching applications. You will receive -2609 error code instead.**
 +
 <​html>​ <​html>​
 <​pagebreak>​ <​pagebreak>​
 </​html>​ </​html>​
-=== SearchImageById ​==== + 
-Runs an image search on an applicationtaking an image from the database as the query.+==== SearchImageByDna ​==== 
 +The equivalent of a SearchImageByUploadbut where the DNA is precomputed on the client side, and send directly instead the image.
 \\ \\
-  ​* **Request type :​**''​GET''​+ 
 +  ​* **Request type :​**''​POST'' ​
   * **Required Parameters :**   * **Required Parameters :**
     * application_key (string): the unique key of the application to query     * application_key (string): the unique key of the application to query
-    * image_id ​(string): ​The unique identifier of the image.+    * dna (string): ​a byte array representing the precomputed DNA for the image.
   * **Optional Parameters :**   * **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     * 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     * starting_index (integer): index of the first image to be returned in the list of results
Line 409: Line 414:
       * id (string): image_id with which the image has been added to your reference database       * id (string): image_id with which the image has been added to your reference database
       * result_info (string): give more information about the result       * result_info (string): give more information about the result
- +  
-**CURL query** +\\  
-<sxh php; title: Sample query> +**For information concerning pre-computed DNA's, please contact LTU Tech support.** 
-curl -sL  +\\ 
-'http://​hostaddress:​8080/​api/​v2.0/​ltuquery/​json/​SearchImageById?​application_key=PXly9fRUfUt0oizKTcmpzFS8AAtqrTgI&​image_id=pinpin'​ +
-</​sxh>​ +
- +
 \\  \\ 
 **JSON response** **JSON response**
Line 442: Line 443:
 } }
 </​sxh>​ </​sxh>​
- 
-**Note that SearchImageById is not available for Mobile Matching applications. You will receive -2609 error code instead.** 
- 
 <​html>​ <​html>​
 <​pagebreak>​ <​pagebreak>​