-
Notifications
You must be signed in to change notification settings - Fork 118
Add metadata aspect ratio transformation #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
c64c975
b0380d5
0f6b15c
b496827
4ddddac
6a2dce7
7280587
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,6 +291,7 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO | |
| <xs:element name="Extension" type="tt:FrameExtension" minOccurs="0"/> | ||
| <xs:element name="SceneImageRef" type="xs:anyURI" minOccurs="0"/> | ||
| <xs:element name="SceneImage" type="xs:base64Binary" minOccurs="0"/> | ||
| <xs:element name="AspectRatioTranformation" type="tt:AspectRatioTransformation" minOccurs="0"/> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest to add the same as optional element inside object also, to keep it consistent with "ObjectTrack" Event.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are referring to A.10 Object Track Aggregation. |
||
| <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> <!-- reserved for ONVIF --> | ||
| </xs:sequence> | ||
| <xs:attribute name="UtcTime" type="xs:dateTime" use="required"/> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to include an example here, since this scale differs from the normalization scale used in the transformation.
Ratio = ProfileResolutionWidth / ProfileResolutionHeight
Scale X = VideoSourceWidth / ProfileWidth
Scale Y = VideoSourceHeight / ProfileHeight
Currently this assumes a centered crop (equal offsets on top and bottom, right and left). If the crop offset is not equal, should we consider applying an optional Translate to reposition the cropped region correctly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the Translate is optional, but needed if it is not a centered crop. Do you recommend having one Frame example for centered use-case and one whole Frame example for a non-centered crop ?
I think a device should not have both for a video source.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the Scale for the centered case, we concluded 2 simple formulas.
When Resolution aspect ratio is greater than video source aspect ratio,
ScaleX = 1 and ScaleY = ResolutionAspectRatio / VideoSourceAspectRatio.
When Resolution aspect ratio is greater than video source aspect ratio,
ScaleY = 1 and ScaleX = VideoSourceAspectRatio / ResolutionAspectRatio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cemond-genetec,
Thanks for the clarification.
Request to add an example also for clarity, please check if this kind of example is ok ?
Aspect Ratio Based Scaling
If ProfileAspectRatio > VideoSourceAspectRatio → the profile is wider than the source
If VideoSourceAspectRatio > ProfileAspectRatio → the source is wider than the profile
Example
Suppose:
Since VideoSourceAspectRatio > ProfileAspectRatio:
ScaleX = 1.78/1.33 = Appx 1.34