To configure Media Server to rotate images, follow these steps.
To rotate images
Create a new configuration to send to Media Server with the process
action, or open an existing configuration that you want to modify.
In the [Session]
section, add a new task by setting the EngineN
parameter. You can give the task any name, for example:
[Session] Engine0=Ingest ... Engine3=Rotation
Create a new configuration section to contain the task settings and set the following parameters:
Type
|
The transformation engine to use. Set this parameter to Rotate . |
Input
|
The name of the image track to process. |
Angle
|
(Set this or LuaScript ) The rotation to apply to the input image, in degrees, clockwise. |
LuaScript
|
(Set this or |
For example:
[Rotation] Type=Rotate Input=FaceDetect.ResultWithSource LuaScript=Rotate.Lua
A suitable Lua script is included below:
function getAngle(record) if (record.OCRResultAndImage) then return -record.OCRResultAndImage.angle elseif (record.FaceResultAndImage) then return -record.FaceResultAndImage.face.ellipse.angle elseif (record.FaceRecognitionResultAndImage) then return -record.FaceRecognitionResultAndImage.face.ellipse.angle elseif (record.DemographicsResultAndImage) then return -record.DemographicsResultAndImage.face.ellipse.angle elseif (record.FaceStateResultAndImage) then return -record.FaceStateResultAndImage.face.ellipse.angle end return 0 end
Save and close the configuration file. Micro Focus recommends that you save your configuration files in the location specified by the ConfigDirectory
parameter.
|