public class AlchemyVision extends AlchemyService
| Modifier and Type | Field and Description | 
|---|---|
| static String | FORCE_SHOW_ALLThe Constant FORCE_SHOW_ALL. | 
| static String | HTMLThe Constant HTML. | 
| static String | IMAGEThe Constant IMAGE. | 
| static String | IMAGE_POST_MODEThe Constant IMAGE_POST_MODE. | 
| static String | KNOWLEDGE_GRAPHThe Constant KNOWLEDGE_GRAPH. | 
| static String | NOT_RAWThe Constant NOT_RAW. | 
| static String | RAWThe Constant RAW. | 
| static String | URLThe Constant URL. | 
ENDPOINT, JSONP, OUTPUT_MODEVERSION| Constructor and Description | 
|---|
| AlchemyVision() | 
| Modifier and Type | Method and Description | 
|---|---|
| ImageKeywords | getImageKeywords(File image,
                Boolean forceShowAll,
                Boolean knowledgeGraph)Extracts keywords from an image | 
| ImageKeywords | getImageKeywords(URL url,
                Boolean forceShowAll,
                Boolean knowledgeGraph)Extracts keywords from a URL. | 
| ImageLink | getImageLink(String html)Extracts the main image link from a HTML page. | 
| ImageLink | getImageLink(URL url)Extracts main image link from a URL. | 
| ImageFaces | recognizeFaces(File image,
              Boolean knowledgeGraph)Recognizes faces from an image. For each face detected returns: Bounding box Gender Approximate age Name (if celebrity is detected) Here is an example of how to recognize faces in an image: | 
| ImageFaces | recognizeFaces(URL url,
              Boolean knowledgeGraph)Recognizes faces from a URL. For each face detected returns: Bounding box Gender Approximate age Name (if celebrity is detected) Here is an example of how to recognize faces in an image: | 
execute, executeRequest, getInputFormat, setAuthenticationconfigureHttpClient, executeWithoutResponse, getApiKey, getEndPoint, getName, getToken, setApiKey, setDefaultHeaders, setEndPoint, setUsernameAndPassword, toStringpublic static final String FORCE_SHOW_ALL
public static final String HTML
public static final String IMAGE
public static final String IMAGE_POST_MODE
public static final String KNOWLEDGE_GRAPH
public static final String NOT_RAW
public static final String RAW
public static final String URL
public ImageKeywords getImageKeywords(File image, Boolean forceShowAll, Boolean knowledgeGraph)
image - the image fileforceShowAll - Includes lower confidence tagsknowledgeGraph - Include knowledge graph information in the the results.ImageKeywordspublic ImageKeywords getImageKeywords(URL url, Boolean forceShowAll, Boolean knowledgeGraph)
url - the image URLforceShowAll - Includes lower confidence tagsknowledgeGraph - Include knowledge graph information in the the results.ImageKeywordspublic ImageLink getImageLink(URL url)
url - the image URLImageLinkpublic ImageLink getImageLink(String html)
html - the HTMLImageLinkpublic ImageFaces recognizeFaces(File image, Boolean knowledgeGraph)
 AlchemyVision service = new AlchemyVision();
 service.setApiKey("<api_key>");
 
 File image = new File("obama.jpg");
 ImageFaces faces = service.recognizeFaces(image, true);
 
 System.out.println(faces);
 image - the imageknowledgeGraph - provide extra metadata for detected celebritiesImageFacespublic ImageFaces recognizeFaces(URL url, Boolean knowledgeGraph)
 AlchemyVision service = new AlchemyVision();
 service.setApiKey("<api_key>");
 
 URL image = new URL("http://foo.com/the-image.png");
 ImageFaces faces = service.recognizeFaces(image, true);
 
 System.out.println(faces);
 url - the image URLknowledgeGraph - provide extra metadata for detected celebritiesImageFacesCopyright © 2015–2016. All rights reserved.