The image conversion sample execution scripts are located in the ucp_tutorial/vp/vp_samples/script/02_transformation directory.
The sample mainly shows the application effect of different conversion classes of operators, including picture scaling, up and down sampling,
rotation, flip, transpose, affine, perspective, the detailed implementation method, please combine with the sample source code to compare the practice.
In this sample, executing the sample script directly will execute the default picture transformation sample: generate a picture comparing the effect of resize and purUp. If you want to change the processing method of the picture, you can control the flow of execution by appending parameters when executing the sample script, the rules for appending parameters are as follows:
Among these, transform operate is an optional parameter, sample algorithm.
A list of all available append parameters can also be obtained with the append -help command.
The result of the picture processing is saved in the vp_samples/script/02_transformation directory after the algorithm is executed,
and the contents of the generated object for this sample are as follows:
Different append parameters will cause the sample to call different interfaces and generate different processing results, which are implemented as follows:
compare_resize_pyrUp
The input picture is divided into left and right parts, and half of the input picture is processed through the hbVPPyrUp and hbVPResize interfaces respectively,
and the result is stitched into the output picture.
The left side of the output picture is the effect of pyrUp processing, and the right side is the effect of resize processing, the specific output is as follows:
compare_pyrDown_rotate_flip_transpose
In this sample flow, the input picture is divided into four parts, in which the upper left part is processed by hbVPPyrDown, the upper right part is processed by hbVPTranspose, the lower left part is processed by hbVPRotate, and the lower right part is processed by hbVPFlip, and finally the results are combined into the output picture according to the parts. The specific output is shown below:
affine
This sample flow of the input picture affine transformation, the picture is rotated 45 ° counterclockwise, and the rotated picture is placed in the length and width of the input picture are twice the memory, the specific output is shown as belows:
perspective
This sample flow of the input picture perspective transformation, the picture will be transformed in accordance with a specific transformation matrix, if you need to change the form of the change, please manually change the relevant source code in the transformation matrix, the specific output is shown as belows:
