Skip to content

Finishing

AddStickersProcessor

It is used to add overlays and posters to a photo. Overlays should be uploaded previously as poster type content (check adding content).

Proper Scope

  • To make the sticker transparent, you need to upload an image in PNG format with transparency set.
Parameters
  • photo - content name (check list of Poster),
  • x - Value from 0 to 1. Indicate the position of the overlay in the image. A value of 0 indicates the overlay is placed on the left side a value of 1 on the right side. The position is counted relative to the center of the overlay, by default 0.0,
  • y - Value from 0 to 1. Indicates the position of the overlay in the image. The value 0 indicates the placement of the overlay at the top of the image the value 1 at the bottom of the image. The position is counted relative to the center of the overlay, by default 0.0,
  • width - Value from 0 to 1. Indicates the width of the overlay in the image in % relative to the width of the output image. Giving the width only means that the height will be calculated keeping the aspect ratio of the content, by default 0.0,
  • height - Value from 0 to 1. Indicates the width of the overlay in the image in % relative to the height of the output image. Giving the height only means that the width will be calculated keeping the aspect ratio of the content, by default 0.0,
  • sendToBack - true/false -the flag determines whether the overlay should be behind or in front of the car, by default false.
Example of usage

[
    {
        "processorName": "DetectCarMaskProcessor"
    },
     {
        "processorName": "ChangePlateProcessor",
        "background": "original",
        "blurKernelSize": 0.5
    },
    {
        "processorName": "AddStickersProcessor",
        "stickers": [
            {
                "photo": "sticker_1",
                "x": 1,
                "y": 1,
                "height": 0.5
            },   {
                "photo": "sticker_2",
                "x": 0.2,
                "y": 0,
                "width": 0.3
            }
        ]
    }
]

Example result

Example result of using the x and y parameters

When adding a photo as a sticker, it is recommended to use parameters as photos may have varying resolutions, potentially resulting in a change in the image's position.

SavePngProcessor

It is used to save the output image with a png extension. Processors for changing the background should not be used because an image with a transparent background will be returned. The image can contain the shadow and SemiTransparentWindows.

Parameters
  • cropCar - true/false - by default true - the output image will be cropped to the car, if false - the image in its original resolution will be returned.
Example of usage

[
    {
        "processorName": "DetectCarMaskProcessor"
    },
    {
        "processorName": "DetectCarShadowProcessor"
    },      
{ "processorName": "WindowSegmentationProcessor", "confidenceThreshold": 0.3 }, { "processorName": "SemiTransparentWindowsProcessor", "windowTransparency": 0.15, "windowBrightness": 0.0 }, { "processorName": "PlaceShadowProcessor", "background": "original", "shadowOpacity": 0.9, "shadowSize": 0.5, "advancedShadowEnabled": false, "advancedShadowShift": 0.25, "advancedShadowStrength": 0.5 }, { "processorName": "SavePngProcessor", "cropCar": true } ]

Example result