Description Usage Arguments Functions Examples
These functions access the different components of the response to a successful Pastec image query.
1 2 3 4 5 6 7 8 9 |
pastec_response |
The list returned by search_image. |
bounding_rects: A data.frame with the bounding box dimensions and origin for the match.
image_ids: A vector of returned IDs.
scores: A vector of similarity scores.
tags: A vector of tags.
results_as_data_frame: A data.frame with one row per search result:
heightinteger. The height of the bounding box in the matched image.
widthinteger. The width of the bounding box in the matched image.
xinteger. The origin the bounding box in the matched image.
yinteger. The origin of the bounding box in the matched image.
image_idinteger. The Pastec image IDs matched.
scoresinteger. The image match score.
tagslist. A character list with any tags associated with the image.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.