/** * Draws a verification graphic for the base image and the passed image. * * @param candidateImageAsUrl - the passed image as an URL. * @param verificationSet - a verification set to be drawn. * @return this * @throws ImageNotFoundException if the image can't be downloaded */ @NotNull public ImageOverlayBuilder verify(@NotNull String candidateImageAsUrl, @NotNull VerificationSet verificationSet) { try { verify(ImageIO.read(new URL(candidateImageAsUrl)), verificationSet); } catch (IOException e) { throw new ImageNotFoundException(candidateImageAsUrl); } return this; }
public static void main(String[] args) throws IOException { FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"), getProperty("azure.cognitive.emotion.subscriptionKey")); ImageOverlayBuilder imageOverlayBuilder = ImageOverlayBuilder.builder(CANDIDATE_1); imageOverlayBuilder.verify(CANDIDATE_2, faceScenarios.verifyFaces(CANDIDATE_1, CANDIDATE_2)).launchViewer(); } }