.. _ev74_graph_8_sima_resize: |graph| ======================= Description ----------- |ev74_synopsys| taking in a frame and resizing it to the desired size. Different algorightms are available for this operation. Graph Info ---------- .. list-table:: |graph| :widths: 12 20 :stub-columns: 1 * - Graph Name - |graph| * - Graph ID - 8 * - Operations Supported - SIMA_RESIZE_NEAREST(0) SIMA_RESIZE_BILINEAR(1) SIMA_RESIZE_BICUBIC(2) * - Important Parameters to configure - "input_width" → Width of Input Image "input_height" → Height of Input Image "output_width" → Width of Output Image (same as input width) "output_height" → Height of Output Image (same as input height) "batch_size" → No:of input images "rsz_type" → Resize interpolation type- 0 to 2 (Refer to Operations Supported column) * - Available Since Yocto Build - B745 Example Config -------------- |ev74_example_config_text| .. code-block:: { "version": 0.1, "node_name": "ev-atomic-resize", "simaai__params": { "params": 15, "index": 0, "cpu": 1, "next_cpu": 2, "graph_id": 8, "input_width": 800, "input_height": 800, "output_width": 400, "output_height": 400, "batch_size": 1, "rsz_type": 2, "format": 1, "in_type": 0, "no_of_outbuf": 1, "out_type": 2, "out_sz": 480000, "ibufname": "in-img-source", "debug": 0, "dump_data": 1 } } .. note:: Please note that, the ``out_sz`` in above json needs to be calculated based on your output format. Ex. If the output format is RGB, then the ``out_sz`` will be ``output_height * output_width * 3``. Here, ``3`` is the number of channels |dependent_app| --------------- |ev74_dependent_app_brief| .. code-block:: cpp :caption: Sample |dependent_app| Function to configure Parameters :linenos: #define SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE (8) #define INPUT_WIDTH (1) #define INPUT_HEIGHT (2) #define OUTPUT_WIDTH (3) #define OUTPUT_HEIGHT (4) #define BATCH_SIZE (5) #define RSZ_TYPE (6) void configure_resize(const char *json_in) { simaai_params_t *params = parser_node_struct_init(); uint8_t *buf = (uint8_t *)calloc(1, sizeof(uint8_t) * 16); int val = *((int *)parser_get_int(params, "img_height")); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, INPUT_HEIGHT, buf, val); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, INPUT_HEIGHT, buf, val); val = *((int *)parser_get_int(params, "img_width")); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, INPUT_WIDTH, buf, val); val = *((int *)parser_get_int(params, "output_width")); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, OUTPUT_WIDTH, buf, val); val = *((int *)parser_get_int(params, "output_height")); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, OUTPUT_HEIGHT, buf, val); val = *((int *)parser_get_int(params, "batch_size")); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, BATCH_SIZE, buf, val); val = *((int *)parser_get_int(params, "rsz_type")); send_i32_param(2, SIMA_IPC_CODE_GRAPH_SIMA_ATOMIC_RESIZE, RSZ_TYPE, buf, val); std::cout << "Completed Resize Graph Configure \n"; free(buf); } |ev74_dependent_app_footer| .. |graph| replace:: SIMA_RESIZE