Using TIOVX APIs, I ran vx_experiment_image_scale_1280x960_1024x768 (void) described below to resize the image.
When I executed this with the settings to be processed by VPAC, there was an error in the output image.
Like the inserted image, the output image looks like being shaded.
How can I get correct output image with VPAC?
Below is the code.
void vx_experiment_image_scale_1280x960_1024x768(void)
{
/**
* - Define objects that we wish to create in the OpenVX application.
*
* A vx_context object is defined which is used as input parameter for all subesquent
* OpenVX object create APIs
*/
vx_context context;
vx_graph graph = NULL;
vx_node node0 = NULL;
vx_image y_image_1280x960 = NULL;
vx_image y_image_1024x768 = NULL;
vx_status status;
vx_uint32 width;
vx_uint32 height;
/**
* - Create OpenVX context.
*/
context = vxCreateContext();
/**
* - Create OpenVX graph.
*/
graph = vxCreateGraph(context);
vxSetReferenceName((vx_reference)graph, "MY_GRAPH");
/**
* - Create image object.
*/
y_image_1280x960 = tivx_utils_create_vximage_from_bmpfile(context, OUT_FILE_NAME_1280x960, (vx_bool)vx_false_e);
vxSetReferenceName((vx_reference)y_image_1280x960, "Y_IMAGE_1280X960");
/**
* - Query image object.
*/
vxQueryImage(y_image_1280x960, (vx_enum)VX_IMAGE_WIDTH, &width, sizeof(vx_uint32));
vxQueryImage(y_image_1280x960, (vx_enum)VX_IMAGE_HEIGHT, &height, sizeof(vx_uint32));
/**
* - Create OpenVX image Object.
*/
y_image_1024x768 = vxCreateImage(context, (vx_uint32)(width*0.8), (vx_uint32)(height*0.8), (vx_df_image)VX_DF_IMAGE_U8);
vxSetReferenceName((vx_reference)y_image_1024x768, "Y_IMAGE_1024x768");
/**
* - Create OpenVX node object.
* Creates an OpenVX image scale node with y_image_1280x960 input and y_image_1024x768 output.
*/
node0 = vxScaleImageNode(graph, y_image_1280x960, y_image_1024x768, VX_INTERPOLATION_NEAREST_NEIGHBOR);
vxSetNodeTarget(node0, VX_TARGET_STRING, "VPAC_MSC1");
vxSetReferenceName((vx_reference)node0, "SCALE");
/**
* - Verify and Process graph object
*/
status = vxVerifyGraph(graph);
if(status==(vx_status)VX_SUCCESS) {
vxProcessGraph(graph);
}
/**
* - Save image object to bitmap file
*/
tivx_utils_save_vximage_to_bmpfile(OUT_FILE_NAME_1024x768, y_image_1024x768);
/**
* - Release image object.
*/
vxReleaseImage(&y_image_1280x960);
vxReleaseImage(&y_image_1024x768);
/**
* - Release node object.
*/
vxReleaseNode(&node0);
/**
* - Release graph object.
*/
vxReleaseGraph(&graph);
/**
* - Release context object.
*/
vxReleaseContext(&context);
/** \endcode */
}
Below is the Input image (1024x960).

Below is the output image (1280x768).

Best Regards,
Takanori Sakata