The Image Comparison REST API makes use of the Image Comparison Manager library to analyze and compare two images.
Compare two different images contained in a layer, returning the number of matched points and their goodness.
Petition:
http://site:port/.../compareImages/compare/
Restrictions:
- Needs teh following GET parameters:
- photo1: the ID of the first photo (mandatory)
- photo2: the ID of the second photo (mandatory)
- layer_id: the ID of the layer that contains the photos. If it’s not specified, the LibreGeoSocial official layer is got by default (optional)
Returned data:
Json Format
{"code": "200",
"goodness": "goodness",
"matched": "number of matched points"}
XML Format
compare_nodes
200
"Number of matched points"
"Goodness of the matching"
Make an image search of a given photograph in the different LibreGeosocial photo nodes of a specified layer.
Petition:
http://site:port/.../compareImages/social/compare/
Restrictions:
- Needs the following POST parameters to get the photos list we want to search into:
- layer_id: the ID of the layer that contains the photos list. If it’s not specified, the LibreGeoSocial official layer is got by default (optional)
- latitude: the latitude of the user. (mandatory)
- longitude: the longitude of the user. (mandatory)
- radius: the geographical radius that we use to get the photos. (mandatory)
- It also needs a photo FILE parameter, which have to contain the image raw data that we will use in the search. (mandatory)
Returned data:
Json Format
{
"layer_id": "the id of the layer we have search into",
"code": "200",
"photo_id": "the id of the matched photo",
"goodness": "the goodness value of the matching",
"matched": "the number of matched points between the two photos"
}
XML Format
compare_social_nodes
200
"the id of the layer we have search into"
"the id of the matched photo"
"the number of matched points between the two photos"
"the goodness value of the matching"