User Manual
Print

Putting Object Detection Result Inside Image

Vision Analysis Result mark objects on photo

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>photo</variable><variable>visionAnalysisResult</variable></variables><block type=\"UnaAI_VisionAnalysisResult_hasObject\" disabled=\"true\" x=\"112\" y=\"337\"><value name=\"visionAnalysisResult\"><block type=\"variables_get\" disabled=\"true\"><field name=\"VAR\">visionAnalysisResult</field></block></value><value name=\"objName\"><shadow type=\"text\" disabled=\"true\"><field name=\"TEXT\"/></shadow></value></block></xml>"}
				
			

This is used to mark the boundary box inside the photo.

Parameters: AI Result (Object Detection from Azure)

Output: Photo
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>photo</variable><variable>visionAnalysisResult</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\">photo</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"Resources_getPhotoByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://www.magicubedu.com/una/AI5/samples/man1.jpg</field></shadow></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">visionAnalysisResult</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"UnaAI_detectObjects\"><value name=\"img\"><block type=\"variables_get\"><field name=\"VAR\">photo</field></block></value></block></value><next><block type=\"UnaAI_VisionAnalysisResult_markObjects\"><value name=\"visionAnalysisResult\"><block type=\"variables_get\"><field name=\"VAR\">visionAnalysisResult</field></block></value></block></next></block></next></block></statement></block></xml>"}
				
			

The output:

Vision Analysis Result Mark Object on Photo - Output