Semantic Segmentation

Capability Introduction

Image recognition, precise segmentation

Semantic segmentation allows for pixel-level recognition and segmentation of photographed images, for the purposes of obtaining the category and precise location of objects in the images. The basic information obtained from image semantics facilitates subsequent image enhancement. Currently, 10 object types can be identified and segmented, including people, sky, greenery (including grass and trees), foods, pets, buildings, flowers, water, beaches, and mountains. Semantic segmentation means that an object in an image is segmented at the pixel level, with each pixel identified as a certain type of object. Portions that do not belong to the supported types are marked as background.
Scenarios

Smart image enhancement, automated driving

This API performs pixel-level recognition and segmentation for objects in images, and provides for high-level comprehension of image content, suitable for auxiliary photography and street scene recognition.

Photography aid

In general, photography effects for different settings require the user to adjust the settings. This API provides independent judgment, with the selection of the optimal shooting in all conditions.

Street scene recognition

Street scenes are recognized and applied in an automated driving system.

Description

Request
Copy

<p>SegmentationConfiguration sc = new SegmentationConfiguration();
sc.setSegmentationType
 
 
 
(SegmentationConfiguration.TYPE_SEMANTIC);
ImageSegmentation ssEngine = new ImageSegmentation(mContext);
ssEngine.setSegmentationConfiguration(sc);
Frame frame = new Frame();
frame.setBitmap(mBitmap);
ImageResult srt = ssEngine.doSegmentation(frame, null);
Bitmap newbmp = srt.getBitmap();</p>

Response
Copy

{
  "resultCode":0
}

Start development here with Huawei

Service introduction

Service overview, application scenarios, and functions
Learn more

Access preparation

Preparation for access, such as registration, authentication, and agreement signing
Learn more

Sample code

Demonstration of sample code
Learn more

API description

Interface parameter definition, description, restrictions, and constraints
Learn more
FAQ
1Can I call the faceCompare() method without calling the prepare() method of the API?

Yes, you can. The engine is started by default in the faceCompare() method. If the engine has already been started, it will not restart.

2When should I call the release() method?

The release() method will uninstall a model that has been loaded to the NPU chip. If the app is no longer using face detection, uninstall the model in a timely manner to free up resources.