pastec_response: Parse Pastec image search results

Description Usage Arguments Functions Examples

Description

These functions access the different components of the response to a successful Pastec image query.

Usage

1
2
3
4
5
6
7
8
9

Arguments

pastec_response

The list returned by search_image.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## 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)

bounding_rects(search_results)
#>   height width  x   y
#> 1    827   592 53 142
#> 2    803   567 64 159
#> 3    796   575 56 173
image_ids(search_results)
#> [1] 1 3 2
scores(search_results)
#> [1] 964  62  59
tags(search_results)
#> [1] NA NA NA
#' 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.