Examples of using the Image analysis BLOCK
Examples of using the Image analysis BLOCK
This document is a collection of several examples of image analysis from using the Image analysis BLOCK . The examples of each detection type listed below contain both the image used and the analysis results.
- Facial recognition example
- Landmark recognition example
- Logo recognition example
- Object recognition example
- OCR (text) example
- Adult content detection example
- Color analysis example
The results are shown as displayed in the Logs section by using an Output to log BLOCK.
check_box For a detailed example of using the Image analysis BLOCK, refer to Using the Google Cloud Vision API Machine Learning service .
Facial recognition example
Below are an image and the results from using facial recognition to analyze it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > Facial recognition ("faceAnnotations") .
{ "faceAnnotations": [ { "tiltAngle": 4.6994467, "underExposedLikelihood": "VERY_UNLIKELY", "fdBoundingPoly": { "vertices": [ { "y": 318, "x": 670 }, { "y": 318, "x": 959 }, { "y": 606, "x": 959 }, { "y": 606, "x": 670 } ] }, "landmarkingConfidence": 0.8396889, "joyLikelihood": "VERY_UNLIKELY", "detectionConfidence": 0.95103228, "surpriseLikelihood": "VERY_UNLIKELY", "angerLikelihood": "VERY_UNLIKELY", "headwearLikelihood": "VERY_UNLIKELY", "panAngle": 1.1417893, "boundingPoly": { "vertices": [ { "y": 203, "x": 605 }, { "y": 203, "x": 1017 }, { "y": 682, "x": 1017 }, { "y": 682, "x": 605 } ] }, "landmarks": [ { "position": { "y": 406.18475, "x": 755.82172, "z": -0.0019571674 }, "type": "LEFT_EYE" }, { "position": { "y": 411.55664, "x": 873.33008, "z": 2.2569208 }, "type": "RIGHT_EYE" }, { "position": { "y": 378.80887, "x": 712.91016, "z": 12.889206 }, "type": "LEFT_OF_LEFT_EYEBROW" }, { "position": { "y": 377.71161, "x": 787.5188, "z": -21.346836 }, "type": "RIGHT_OF_LEFT_EYEBROW" }, { "position": { "y": 380.31638, "x": 847.68329, "z": -20.1784 }, "type": "LEFT_OF_RIGHT_EYEBROW" }, { "position": { "y": 386.27527, "x": 920.77515, "z": 16.990841 }, "type": "RIGHT_OF_RIGHT_EYEBROW" }, { "position": { "y": 405.4343, "x": 815.85791, "z": -24.665674 }, "type": "MIDPOINT_BETWEEN_EYES" }, { "position": { "y": 474.37393, "x": 818.08716, "z": -67.114952 }, "type": "NOSE_TIP" }, { "position": { "y": 527.74731, "x": 813.43134, "z": -41.542439 }, "type": "UPPER_LIP" }, { "position": { "y": 558.07959, "x": 810.74756, "z": -36.031929 }, "type": "LOWER_LIP" }, { "position": { "y": 538.40521, "x": 758.57562, "z": -9.306365 }, "type": "MOUTH_LEFT" }, { "position": { "y": 545.70831, "x": 864.68909, "z": -7.6972365 }, "type": "MOUTH_RIGHT" }, { "position": { "y": 541.5047, "x": 812.28436, "z": -33.855068 }, "type": "MOUTH_CENTER" }, { "position": { "y": 490.774, "x": 848.905, "z": -19.081556 }, "type": "NOSE_BOTTOM_RIGHT" }, { "position": { "y": 486.44943, "x": 781.81824, "z": -20.955832 }, "type": "NOSE_BOTTOM_LEFT" }, { "position": { "y": 494.91971, "x": 815.83813, "z": -39.895447 }, "type": "NOSE_BOTTOM_CENTER" }, { "position": { "y": 399.35587, "x": 754.37134, "z": -7.7445889 }, "type": "LEFT_EYE_TOP_BOUNDARY" }, { "position": { "y": 410.89209, "x": 777.84955, "z": 0.76056117 }, "type": "LEFT_EYE_RIGHT_CORNER" }, { "position": { "y": 414.91089, "x": 754.63379, "z": -1.8167982 }, "type": "LEFT_EYE_BOTTOM_BOUNDARY" }, { "position": { "y": 408.99341, "x": 729.02216, "z": 10.692088 }, "type": "LEFT_EYE_LEFT_CORNER" }, { "position": { "y": 408.29578, "x": 751.95062, "z": -3.1911113 }, "type": "LEFT_EYE_PUPIL" }, { "position": { "y": 403.79346, "x": 878.7066, "z": -5.291678 }, "type": "RIGHT_EYE_TOP_BOUNDARY" }, { "position": { "y": 415.23694, "x": 902.60089, "z": 14.143926 }, "type": "RIGHT_EYE_RIGHT_CORNER" }, { "position": { "y": 419.31335, "x": 874.99078, "z": 0.52098614 }, "type": "RIGHT_EYE_BOTTOM_BOUNDARY" }, { "position": { "y": 414.07681, "x": 851.71515, "z": 2.097218 }, "type": "RIGHT_EYE_LEFT_CORNER" }, { "position": { "y": 412.89627, "x": 879.66083, "z": -0.84396207 }, "type": "RIGHT_EYE_PUPIL" }, { "position": { "y": 362.69925, "x": 750.49707, "z": -11.22148 }, "type": "LEFT_EYEBROW_UPPER_MIDPOINT" }, { "position": { "y": 367.53323, "x": 885.549, "z": -8.5894537 }, "type": "RIGHT_EYEBROW_UPPER_MIDPOINT" }, { "position": { "y": 479.10718, "x": 669.34882, "z": 146.48503 }, "type": "LEFT_EAR_TRAGION" }, { "position": { "y": 489.83243, "x": 951.98108, "z": 152.26144 }, "type": "RIGHT_EAR_TRAGION" }, { "position": { "y": 377.32367, "x": 817.88141, "z": -25.309021 }, "type": "FOREHEAD_GLABELLA" }, { "position": { "y": 621.589, "x": 809.107, "z": -22.926865 }, "type": "CHIN_GNATHION" }, { "position": { "y": 555.0899, "x": 681.2428, "z": 89.758865 }, "type": "CHIN_LEFT_GONION" }, { "position": { "y": 564.30884, "x": 936.77637, "z": 94.8158 }, "type": "CHIN_RIGHT_GONION" } ], "blurredLikelihood": "VERY_UNLIKELY", "rollAngle": 1.9417542, "sorrowLikelihood": "VERY_UNLIKELY" } ], "gcs_url": "gs://vision-api-samples/face_detection_sample.jpg", "timestamp": 1475731991.0 }
Landmark recognition example
Below are an image and the results from using landmark recognition to analyze it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > Landmark recognition ("landmarkAnnotations") .
{ "landmarkAnnotations": [ { "mid": "/m/072p8", "description": "Statue of Liberty", "score": 0.87311679, "boundingPoly": { "vertices": [ { "y": 63, "x": 240 }, { "y": 63, "x": 365 }, { "y": 467, "x": 365 }, { "y": 467, "x": 240 } ] }, "locations": [ { "latLng": { "latitude": 40.689261, "longitude": -74.044482 } } ] } ], "gcs_url": "gs://vision-api-samples/landmark_detection_sample.jpg", "timestamp": 1475664897.0 }
Logo recognition example
Below are an image and the results from using logo recognition to analyze it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > Logo recognition ("logoAnnotations") .
{ "logoAnnotations": [ { "mid": "/m/05nrd2", "description": "Coca-Cola Zero", "score": 0.19073276, "boundingPoly": { "vertices": [ { "y": 69, "x": 337 }, { "y": 69, "x": 395 }, { "y": 119, "x": 395 }, { "y": 119, "x": 337 } ] } } ], "gcs_url": "gs://vision-api-samples/logo_detection_sample.jpg", "timestamp": 1475730505.0 }
Object recognition sample
Below are an image and the results from using object recognition to analyze it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > Object recognition ("labelAnnotations") .
{ "labelAnnotations": [ { "mid": "/m/0kpqd", "description": "watermelon", "score": 0.92826855 }, { "mid": "/m/016rbg", "description": "melon", "score": 0.92359751 }, { "mid": "/m/02wbm", "description": "food", "score": 0.91787922 }, { "mid": "/m/01f5gx", "description": "eating", "score": 0.8840431 }, { "mid": "/m/02xwb", "description": "fruit", "score": 0.88381821 } ], "gcs_url": "gs://vision-api-samples/label_detection_sample.jpg", "timestamp": 1475723844.0 }
OCR ("textAnnotations") example
Below are an image and the results from using OCR (text) to analyze it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > OCR ("textAnnotations") .
{ "textAnnotations": [ { "description": "ATTENZIONE\nParcheggio non custodito\norario apertura:\n07.30 20.00\nCHIUSURA AUTOMATICA\nDEI CANCELLI\nALLE ORE 20.00\n", "locale": "it", "boundingPoly": { "vertices": [ { "y": 257, "x": 115 }, { "y": 257, "x": 417 }, { "y": 536, "x": 417 }, { "y": 536, "x": 115 } ] } }, { "description": "ATTENZIONE", "boundingPoly": { "vertices": [ { "y": 257, "x": 139 }, { "y": 257, "x": 394 }, { "y": 289, "x": 394 }, { "y": 289, "x": 139 } ] } }, { "description": "Parcheggio", "boundingPoly": { "vertices": [ { "y": 314, "x": 115 }, { "y": 314, "x": 243 }, { "y": 339, "x": 243 }, { "y": 339, "x": 115 } ] } }, { "description": "non", "boundingPoly": { "vertices": [ { "y": 314, "x": 255 }, { "y": 314, "x": 295 }, { "y": 339, "x": 295 }, { "y": 339, "x": 255 } ] } }, { "description": "custodito", "boundingPoly": { "vertices": [ { "y": 314, "x": 307 }, { "y": 314, "x": 417 }, { "y": 339, "x": 417 }, { "y": 339, "x": 307 } ] } }, { "description": "orario", "boundingPoly": { "vertices": [ { "y": 348, "x": 174 }, { "y": 348, "x": 243 }, { "y": 375, "x": 243 }, { "y": 375, "x": 174 } ] } }, { "description": "apertura:", "boundingPoly": { "vertices": [ { "y": 349, "x": 252 }, { "y": 349, "x": 359 }, { "y": 374, "x": 359 }, { "y": 374, "x": 252 } ] } }, { "description": "07.30", "boundingPoly": { "vertices": [ { "y": 382, "x": 183 }, { "y": 382, "x": 251 }, { "y": 405, "x": 251 }, { "y": 405, "x": 183 } ] } }, { "description": "20.00", "boundingPoly": { "vertices": [ { "y": 382, "x": 277 }, { "y": 382, "x": 350 }, { "y": 405, "x": 350 }, { "y": 405, "x": 277 } ] } }, { "description": "CHIUSURA", "boundingPoly": { "vertices": [ { "y": 435, "x": 140 }, { "y": 435, "x": 253 }, { "y": 459, "x": 253 }, { "y": 459, "x": 140 } ] } }, { "description": "AUTOMATICA", "boundingPoly": { "vertices": [ { "y": 435, "x": 266 }, { "y": 435, "x": 393 }, { "y": 459, "x": 393 }, { "y": 459, "x": 266 } ] } }, { "description": "DEI", "boundingPoly": { "vertices": [ { "y": 472, "x": 196 }, { "y": 472, "x": 231 }, { "y": 500, "x": 231 }, { "y": 500, "x": 196 } ] } }, { "description": "CANCELLI", "boundingPoly": { "vertices": [ { "y": 471, "x": 241 }, { "y": 470, "x": 338 }, { "y": 498, "x": 338 }, { "y": 499, "x": 241 } ] } }, { "description": "ALLE", "boundingPoly": { "vertices": [ { "y": 510, "x": 181 }, { "y": 510, "x": 228 }, { "y": 536, "x": 228 }, { "y": 536, "x": 181 } ] } }, { "description": "ORE", "boundingPoly": { "vertices": [ { "y": 510, "x": 240 }, { "y": 510, "x": 278 }, { "y": 536, "x": 278 }, { "y": 536, "x": 240 } ] } }, { "description": "20.00", "boundingPoly": { "vertices": [ { "y": 510, "x": 290 }, { "y": 510, "x": 354 }, { "y": 536, "x": 354 }, { "y": 536, "x": 290 } ] } } ], "gcs_url": "gs://vision-api-samples/text_detection_sample.jpg", "timestamp": 1475662827.0 }
Adult content detection example
Below are an image and the results from using adult content detection to analyze it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > Adult content detection ("safeSearchAnnotation") .
{ "safeSearchAnnotation": { "medical": "VERY_UNLIKELY", "spoof": "VERY_UNLIKELY", "violence": "UNLIKELY", "adult": "VERY_UNLIKELY" }, "gcs_url": "gs://vision-api-samples/safe_search_detection_sample.jpg", "timestamp": 1475719652.0 }
Color analysis example
Below are an image and the results from using color analysis on it. For details on data format, refer to BLOCKS Reference > Output specifications > Image analysis > Color analysis ("imagePropertiesAnnotation") .
{ "imagePropertiesAnnotation": { "dominantColors": { "colors": [ { "pixelFraction": 0.03975622, "color": { "green": 23, "blue": 24, "red": 19 }, "score": 0.15343559 }, { "pixelFraction": 0.25660831, "color": { "green": 213, "blue": 130, "red": 156 }, "score": 0.089890622 }, { "pixelFraction": 0.0071575367, "color": { "green": 243, "blue": 245, "red": 234 }, "score": 0.044020534 }, { "pixelFraction": 0.0072284034, "color": { "green": 165, "blue": 124, "red": 131 }, "score": 0.030882463 }, { "pixelFraction": 0.02898448, "color": { "green": 52, "blue": 54, "red": 46 }, "score": 0.10213716 }, { "pixelFraction": 0.027141945, "color": { "green": 85, "blue": 89, "red": 76 }, "score": 0.085689932 }, { "pixelFraction": 0.018425342, "color": { "green": 119, "blue": 122, "red": 109 }, "score": 0.053121205 }, { "pixelFraction": 0.17454468, "color": { "green": 209, "blue": 101, "red": 144 }, "score": 0.036085345 }, { "pixelFraction": 0.0090000713, "color": { "green": 116, "blue": 136, "red": 107 }, "score": 0.033624593 }, { "pixelFraction": 0.028913613, "color": { "green": 237, "blue": 153, "red": 184 }, "score": 0.030864337 } ] } }, "gcs_url": "gs://vision-api-samples/image_properties_sample.jpg", "timestamp": 1475666193.0 }