How to handle the crop, resize, nomalize and permute of png images on vic?

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
[✅] other

Target Operating System
[✅] Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
[✅] other

SDK Manager Version
1.9.2.10884
[✅] other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
[✅] other

Are you asking for which platform?
DRIVE AGX Orin?

yes, the platform is DRIVE AGX Orin

Software Version
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
[✅]DRIVE OS 6.0.4 SDK
other

Target Operating System
[✅] Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
[✅]DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.2.10884
[✅] other

Host Machine Version
[✅]native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

the sdk manager version is not sure

yes, the platform is DRIVE AGX Orin

Software Version
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
[✅]DRIVE OS 6.0.4 SDK
other

Target Operating System
[✅] Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
[✅]DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.2.10884
[✅] other

Host Machine Version
[✅]native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

the sdk manager version is not sure

Dear @yaonuli123,
You can not use PNG images as input directly. If the pixels are in RGBA format, you may pass RAW rgba file an input in img_2d sample. You can use ImageMagick to convert png to rgba

the operators like resize, crop, normalize and permute you both support?

and i don’t know if the vic device supports BGR format, not use A component?

Dear @yaonuli123,
You can set Alpha as 255 and check using SrcLayerXPlaneYColorFormat = B8G8R8A8 in config file.

ok, thanks, and i want to know if the operators like resize, crop, normalize and permute are both supported, i can not find some examples, can you give me some suggestions

ok, thanks, and i want to know if the operators like resize, crop, normalize and permute are both supported, i can not find some examples, can you give me some suggestions

Dear @yaonuli123,
You can use nvmimg_2d sample with config files.

For crop

For example If the image size is 512 * 512, If wants to crop image from (16,32) → (400, 500) beow params can be set to achieve this.
SrcLayer1SrcRectLeft = 16;
SrcLayer1SrcRectTop = 32;
SrcLayer1SrcRectRight=400;
SrcLayer1SrcRectBottom = 500;
DstPlane1Width = 500-32
DstPlane1height = 400-16

For resize

Setting DstPlaneYwidth and DstPlaneYwidth should work similar to upsameple cfg. downsampling filter can be selected with SrcLayer1Filtering

Normalization is not possible. What do yoi mean by permute?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.