search_image: Search Pastec index by image

Description Usage Arguments Value See Also Examples

View source: R/pastec_api.R

Description

Upload an image to the Pastec server to search the index for similar images.

Usage

1
search_image(image_path, server)

Arguments

image_path

Path to an image to upload.

server

Pastec server.

Value

On a successful search, returns a list generated from Pastec's JSON response.

See Also

pastec_response

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
nightwatch <- system.file("img", "SK-C-5.jpg", package = "PastecR")
erasmus1 <- system.file("img", "RP-P-1906-1485.jpg", package = "PastecR")
erasmus2 <- system.file("img", "RP-P-1906-1486.jpg", package = "PastecR")
erasmus3 <- system.file("img", "RP-P-1906-1487.jpg", package = "PastecR")

ps <- open_pastec_server()
add_image(erasmus1, 1, ps)
add_image(erasmus2, 2, ps)
search_results <- search_image(erasmus1, ps)

results_as_data_frame(search_results)
#>   height width  x   y image_id scores tags
#> 1    827   592 53 142        1    964   NA
#> 2    803   567 64 159        3     62   NA
#> 3    796   575 56 173        2     59   NA

## End(Not run)

mdlincoln/PastecR documentation built on May 22, 2019, 4:03 p.m.