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 default0.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 default0.0
,width
- Value from 0 to 1. Indicates the width of the overlay in the image in % relative to thewidth
of the output image. Giving thewidth
only means that theheight
will be calculated keeping the aspect ratio of the content, by default0.0
,height
- Value from 0 to 1. Indicates the width of the overlay in the image in % relative to theheight
of the output image. Giving theheight
only means that thewidth
will be calculated keeping the aspect ratio of the content, by default0.0
,sendToBack
- true/false -the flag determines whether the overlay should be behind or in front of the car, by defaultfalse
.
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 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 defaulttrue
- the output image will be cropped to the car, iffalse
- 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 } ]