Computer Vision APIs et Fonctions python
Computer Vision API
The cloud-based Computer Vision API gives developers access to advanced algorithms for processing images and returning information. By uploading an image or specifying an image URL, Microsoft Computer Vision algorithms can analyze visual content differently based on inputs and user choices.

Computer vision works much the same as human vision, except humans have a head start. Human sight has the advantage of lifetimes of context to train how to tell objects apart, how far away they are, whether they are moving, and whether something is wrong in an image.

Computer vision trains machines to perform these functions, but it has to do it in much less time with cameras, data, and algorithms rather than retinas, optic nerves, and the visual cortex. Because a system trained to inspect products or watch a production asset can analyze thousands of products or processes a minute, noticing imperceptible defects or issues, it can quickly surpass human capabilities.

Computer Vision Functions
Introduction
PictoBlox’s Computer Vision class/extension allows you to make AI projects in PictoBlox. Using this class you can create projects to identify celebrities, brands, landmarks, and objects in images.
By analyzing the images for image features, you can recognize the following things:
- Brands: Brand detection uses a database of thousands of global logos to identify commercial brands in images. The Computer Vision service detects if there are brand logos in a given image; if so, it returns the brand name; else, it returns NULL.

- Celebrity: Celebrity detection uses a database to identify celebrities in images. The Computer Vision service detects if there is a celebrity in a given image; if so, it returns their name; else, it returns NULL.

- Objects: Computer vision detects if there are objects in a given image; if so, it returns their name; else, it returns NULL.

- Landmarks: Landmark detection uses a database of thousands of global landmarks to identify them in images, e.g., the Taj Mahal.

- Image Tags: Computer vision returns the taxonomy-based categories detected in an image. Computer Vision can categorize an image broadly or specifically according to the 86 categories given in the following diagram:

- Image Description: Human-readable sentence that describes the contents of the image.
Functions
- video(): This function helps turn the video on/off on the stage with a defined level of transparency.
- Syntax: video(video_state = “on”, transparency = 1)
- Parameters:
- video_state = {“on”, “off”, “on flipped”}
- transparency = 0 to 100, in Percentage(%)
- analysecamera(): This function is used to analyze the image received as input from the camera, for the feature.
- Syntax: analysecamera()
- analysestage(): This function is used to analyze the image received as input from the stage, for the feature.
- Syntax: analysestage()
- analysebackdrop(): This function is used to analyze the image received as input from the current backdrop image, for the feature.
- Syntax: analysebackdrop()
- analysecostume(): This function is used to analyze the image received as input from the current costume, for the feature.
- Syntax: analysecostume()
- analyseURL(): This function is used to analyze the image received as input from the specified URL of the image, for the feature. Using this function you can analyse many things from the image, like Brands, Celebrity, Objects, Landmarks, Image Tags, Image Description.
- Syntax: analyseURL(url = “https://ai.thestempedia.com/wp-content/uploads/2022/02/Robert-and-Chris.jpg”)
- Parameters:
- url = Any url
- imagefeaturecount(): The function reports the number of specified features to count in the image. The options are celebrities, brands, objects, and image tags in a single image can be reported.
- Syntax: imagefeaturecount(feature_type = “object”)
- Parameters:
- feature_type = {“celebrity”, “brand”, “object”, “image tag”}
- imagefeatureinfo(): The function reports the name/ x-position/ y-position/ width/ height or confidence of the recognized celebrity/brand/object/image tag.
If the number is out of range, then the function will return NULL.- Syntax: imagefeatureinfo(feature_type = “object”, number = 1, information = “name”)
- Parameters:
- feature_type = {“celebrity”, “brand”, “object”, “image tag”}
- number = 1 to 100
- information = {“name”, “xPos”, “yPos”, “width”, “height”, “confidence”}
Note: “name” is the default parameter so no need to pass it as parameter. If you input “name” as parameter, then it will not work.
- landmark(): The function reports the landmark identified in the image on analysis.
- Syntax: landmark()
- imagedescription(): The function reports the image description identified in the image on analysis – a Human-readable sentence that describes the contents of the image.
Using these functions, we can now build very exciting computer vison programs and applications that can be very useful in daily life.