Image processing method, device and equipment and computer storage medium
By creating segmentation and stitching nodes in the software development toolkit of the autonomous driving chip and using two parallel scaling nodes to scale the image, the problem of excessive time-consuming large-size image scaling is solved, and image processing efficiency and real-time performance are improved.
Patent Information
- Application Number
- CN202411171892.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-03-04
AI Technical Summary
In autonomous driving scenarios, using existing APIs to scale large-size images takes too long and cannot meet real-time requirements, resulting in low image processing efficiency.
By creating segmentation nodes and stitching nodes in the software development toolkit of the autonomous driving chip, the image to be processed is divided into two parts and passed to two parallel scaling nodes for size scaling, and finally stitching into the final image through the stitching nodes.
Through parallel scaling processing, the time-consuming image scaling operation is significantly reduced, the efficiency of image processing is improved, and the real-time requirements of autonomous driving scenarios can be better met.
Smart Images

Figure CN119559041A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to an image processing method, apparatus, device and computer storage medium. Background Art
[0002] Image scaling is a common operation in image algorithms. In autonomous driving, it takes longer for the algorithm to process a large image than a small image. Autonomous driving scenarios have high real-time requirements, so the original large image is generally scaled before algorithm reasoning.
[0003] Different autonomous driving chips have their corresponding acceleration hardware and corresponding APIs (application programming interfaces) for developers to call. For example, some autonomous driving chips use a multi-core heterogeneous architecture with multiple core processors of different architectures. Each core is set for different needs, and each core can run in parallel. In addition, the autonomous driving chip has a dedicated visual processing accelerator, including an image signal processor (ISP) and multiple visual auxiliary accelerators, which can accelerate the image processing algorithm.
[0004] Although the above-mentioned visual processing accelerator can speed up image scaling, due to the large image size and the high real-time requirements of the algorithm, the time taken to scale an image using the provided API still cannot meet the project requirements, resulting in low image processing efficiency. Summary of the invention
[0005] To solve the above technical problems, the embodiments of the present application propose an image processing method, apparatus, device and computer storage medium.
[0006] In order to solve the above technical problems, the present application embodiment proposes an image processing method, which includes:
[0007] Creating a segmentation node and a splicing node based on a software development kit of an autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling an image;
[0008] Passing the image to be processed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image;
[0009] The first segmented image and the second segmented image are transmitted to the first scaling node and the second scaling node respectively, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image;
[0010] The first zoomed image and the second zoomed image are spliced into a final image through the splicing node.
[0011] In some embodiments, the autonomous driving chip includes a TI tda4vm autonomous driving chip.
[0012] In some embodiments, the first scaling node runs on a first visual preprocessing accelerator of the autonomous driving chip, the second scaling node runs on a second visual preprocessing accelerator of the autonomous driving chip, and the first visual preprocessing accelerator and the second visual preprocessing accelerator run in parallel on the autonomous driving chip.
[0013] In some embodiments, the step of transferring the image to be processed to the segmentation node to segment the image to be processed into a first segmented image and a second segmented image comprises:
[0014] Extracting a first input image object and two first output image objects pre-created by the segmentation node, wherein the first input image object has a first size, the first output image object has a second size, and the first size is larger than the second size;
[0015] Assigning the image to be processed to the first input image object, and running the segmentation node to call an image segmentation function to segment the image to be processed, wherein the image segmentation function segments the first input image through zero copy and address offset when performing image segmentation and assigns the segmentation results to each of the first output image objects;
[0016] In some embodiments, the segmentation result includes the first segmented image and the second segmented image.
[0017] In some embodiments, the first segmented image and the second segmented image are respectively the upper and lower parts, or the left and right parts, of the image to be processed.
[0018] In some embodiments, assigning the image to be processed to the first input image object includes:
[0019] The image to be processed is initialized to the first size and used as the value of the first input image object.
[0020] In some embodiments, stitching the first scaled image and the second scaled image into a final image through the stitching node includes:
[0021] Extracting two second input image objects and one second output image object created by the splicing node;
[0022] Assigning the first segmented image and the second segmented image to the two second input image objects respectively, and running the stitching node to call the image stitching function to stitch the first scaled image and the second scaled image, wherein the image stitching function performs image stitching through zero copy when executing image stitching and assigns the stitching result to the second output image object;
[0023] The stitching result is the final image.
[0024] In order to solve the above technical problems, the embodiment of the present application further proposes an image processing device, the image processing device comprising:
[0025] A creation module is configured to create a segmentation node and a splicing node based on a software development kit of an autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling an image;
[0026] A segmentation module, configured to pass the image to be processed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image;
[0027] a scaling module, configured to transfer the first segmented image and the second segmented image to the first scaling node and the second scaling node respectively, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image;
[0028] The stitching module is configured to stitch the first zoomed image and the second zoomed image into a final image through the stitching node.
[0029] In order to solve the above technical problems, an embodiment of the present application also proposes an image processing device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the image processing method as described above.
[0030] In order to solve the above technical problems, an embodiment of the present application further proposes a computer storage medium, wherein the computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the above image processing method.
[0031] The image processing method of the embodiment of the present application creates a segmentation node and a splicing node based on the software development kit of the autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling the image; the image to be processed is passed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image; the first segmented image and the second segmented image are respectively transferred to the first scaling node and the second scaling node, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image; the first scaled image and the second scaled image are spliced into a final image through the splicing node. The above-mentioned image processing method of the embodiment of the present application can effectively reduce the time consumption of image processing and improve the efficiency of image processing by running the size scaling operation of the segmented image in parallel after segmenting the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] in:
[0034] Figure 1 It is a flowchart of an embodiment of the image processing method provided by the present application;
[0035] Figure 2 It is a schematic diagram of the framework of the processing graph structure provided by this application;
[0036] Figure 3 is a structural schematic diagram of an embodiment of an image processing device provided by the present application;
[0037] Figure 4 is a structural schematic diagram of an embodiment of an image processing device provided by the present application;
[0038] Figure 5 It is a structural schematic diagram of an embodiment of the computer storage medium provided by the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] The embodiment of the present application is directed to an autonomous driving chip, and utilizes the characteristic that two or more visual preprocessing accelerators of the autonomous driving chip can run in parallel to perform parallel scaling processing on two or more images obtained after segmenting the original image. For example, for the TI tda4vm chip, it takes too long to use the API to perform image scaling operations. By using the OpenVX framework and zero-copy operations, two visual preprocessing accelerators TIVX_TARGET_VPAC_MSC1 and TIVX_TARGET_VPAC_MSC2 are controlled to perform parallel processing, thereby achieving the effect of reducing the time consumption of image scaling operations.
[0042] Autonomous driving chips usually provide corresponding SDKs (Software Development Kit) and APIs (Application Programming Interface). Taking the autonomous driving chip TItda4vm chip as an example, the SDK it provides is used to develop the OpenVX framework. OpenVX is an open cross-platform acceleration standard for computer vision applications, which can achieve performance and power optimized computer vision processing, especially in embedded and real-time application cases, such as face, body and gesture tracking, intelligent video surveillance, advanced driving assistance systems (ADAS), object and scene reconstruction, augmented reality, visual detection, robotics, etc. Some embodiments of the present application use the OpenVX data stream scheduling framework to enable heterogeneous multi-cores to operate in parallel and accelerate the processing flow.
[0043] Please refer to Figure 1 , Figure 1 It is a flowchart of an embodiment of an image processing method provided by the present application.
[0044] The image processing method of the embodiment of the present application is applied to an image processing device, wherein the execution subject of the image processing method of the embodiment of the present application can be a server, a terminal device, or a system in which the server and the terminal device cooperate with each other. Accordingly, the execution subject of the image processing method includes various parts, such as various units, sub-units, modules, and sub-modules, which can be all set in the server, or all set in the terminal device, or can be set in the server and the terminal device respectively.
[0045] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here.
[0046] like Figure 1 As shown, the specific steps of the image processing method in the embodiment of the present application are as follows:
[0047] Step S11: Create a segmentation node and a stitching node based on the software development kit of the autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling the image.
[0048] In the embodiment of the present application, the image processing method is run on an autonomous driving chip, and the software development kit of the autonomous driving chip includes two scaling nodes for performing image scaling operations. The software development kit of the autonomous driving chip can be used to create a Figure 2 The execution subject of the image processing method, such as an image processing device, extracts a scaling node for scaling an image from a software development kit of an autonomous driving chip, wherein the scaling node specifically includes a parallel first scaling node userScaleNode1, such as Figure 2 The Image Scale1 and the second scaling node userScaleNode2 are shown, as Figure 2 Image Scale2 shown.
[0049] like Figure 2 As shown, the node connection method of the processing graph structure of the embodiment of the present application can be: the image is input into the segmentation node userCropNode, the segmentation results of the segmentation node userCropNode are respectively input into each scaling node userScaleNode, and the scaling results of all scaling nodes userScaleNode are input into the splicing node userMergeNode for splicing processing to obtain the final required image.
[0050] The number of scaling nodes userScaleNode in the embodiment of the present application can be any number of 2 or more, and the scaling ratio of each scaling node userScaleNode is the same. The number of scaling nodes userScaleNode can be determined according to the segmentation scheme of the segmentation node userCropNode, that is, the number of sub-images formed by segmentation. Figure 2 As shown, the embodiment of the present application is subsequently described using two scaling nodes userScaleNode.
[0051] It should be noted that the segmentation methods of the segmentation node userCropNode in the embodiment of the present application include but are not limited to: up and down segmentation, left and right segmentation, diagonal segmentation, etc.
[0052] Specifically, the autonomous driving chip involved in this application may be a TI tda4vm autonomous driving chip, or other types of chips, which are not listed here one by one.
[0053] In the TI tda4vm autonomous driving chip, taking the segmentation mode of the segmentation node userCropNode as upper and lower segmentation as an example, the first scaling node can be Below image Scale, which is used to scale the lower part of the input image, and the second scaling node can be Above image Scale, which is used to scale the upper part of the input image.
[0054] The creation process is as follows:
[0055] Based on the OpenVX framework, a new userCropNode is created to implement zero copy and split the image into two parts, namely the split node. Based on the OpenVX framework, a new userMergeNode is created to implement zero copy and splice the two parts of the image, namely the splicing node. Based on the OpenVX framework, userScaleNode1 and userScaleNode2 are extracted to implement the scaling operation and scale the image to a preset size, namely the first scaling node and the second scaling node.
[0056] The autonomous driving chip may have two parallel vision preprocessing accelerators. For example, in the TItda4vm autonomous driving chip, there are two vision preprocessing accelerators TIVX_TARGET_VPAC_MSC1 and TIVX_TARGET_VPAC_MSC2. The first scaling node runs on the first vision preprocessing accelerator, and the second scaling node runs on the second vision preprocessing accelerator. Figure 2 As shown, TIVX_TARGET_VPAC_MSC1 and TIVX_TARGET_VPAC_MSC2 run in parallel on the TI chip.
[0057] Specifically, when the autonomous driving chip receives two parts of the image transmitted from the segmentation node userCropNode, it starts the first scaling node through the first visual preprocessing accelerator and starts the second scaling node through the second visual preprocessing accelerator.
[0058] Step S12: The image to be processed is passed into a segmentation node to segment the image to be processed into a first segmented image and a second segmented image.
[0059] In the embodiment of the present application, the image processing device inputs the image to be processed into Figure 2In the graph structure shown in the figure, the image to be processed is divided into the first segmented image and the second segmented image by the segmentation node userCropNode. The segmentation node can encapsulate a function for dividing an image into two or more parts, and its input and output are the image to be processed and the segmented image after segmentation, respectively. input, output1 and output2 are all vx_image objects pre-created according to the width and height. Specifically, the vx_image object includes the first input image object (input) and two output image objects (output1 and output2) of the segmentation node.
[0060] Among them, input is the original image, output1 and output2 are the upper and lower parts of the image after segmentation.
[0061] Specifically, the code for the segmentation node to implement the image segmentation operation is as follows:
[0062] The abCrop function is called, which belongs to an instance of the AbCropWorkshop class. static_cast is used to convert arg to the AbCropWorkshop* type, and then its member function abCrop is called. The parameters array contains the function's parameters, which are converted to the vximage type.
[0063] Define the abCrop function, which accepts three parameters: input (input image), outputo and outputl (two output images). The return type of the function is vxstatus, which is usually an enumeration type indicating the success or failure of the operation.
[0064] Declare a reference to the return value of findBuffer(outputo). The findBuffer function may be used to find or create a buffer associated with outputo.
[0065] Define two pointer arrays: inputptrs and outputptrs. Inputptrs is initialized to two nullptrs, while outputptrs points to the y and uv members of imgbuffer.
[0066] Calls the vxSwapImageHandle function, which is used to swap the handle or pointer of the image. VXSTATUS_CHECK_RETURN_STATUS is a macro used to check the return status of vxSwapImageHandle and return the corresponding error status if the operation fails.
[0067] Reinterpret the pointers in the inputptrs array as uint8_t* types and assign them to the y and uv members of imgbuffer.
[0068] Call the vxSwapImageHandle function to assign the value of input (input image) to outputo and outputl (two output images) respectively, and update the image handle or pointer.
[0069] Finally, the function returns VXSUCCESS, indicating that the operation was completed successfully.
[0070] The main function of the above code is to process images by calling VX library functions, especially to perform cropping operations. Pointers and buffers are used in the code to manage image data, and the return status is checked to ensure the successful execution of the operation.
[0071] It should be noted that in the implementation code of the split node, output1 and output2 can also be the left and right parts of the image after splitting.
[0072] Specifically, an embodiment of the present application extracts a first input image object and two first output image objects pre-created by a segmentation node, wherein the first input image object has a first size, the first output image object has a second size, and the first size is larger than the second size.
[0073] The first input image object is input in the above code implementation, and the two first output image objects are outputo and outputl in the above code implementation. The first input image object and the first output image object are respectively pre-set with size parameters, and the size parameter of the first input image object is greater than the size parameter of the first output image object.
[0074] In an embodiment of the present application, the image to be processed is assigned to the first input image object, and the segmentation node is run to call the image segmentation function to segment the image to be processed, wherein the image segmentation function segments the first input image object through zero copy and address offset when performing image segmentation and assigns the segmentation results to each of the first output image objects.
[0075] Specifically, as implemented in the above code, the image data are stored respectively through the pointer array, and the image data of the first input image object are assigned to the pointer array of the first output image object respectively through the vxSwapImageHandle function assignment method.
[0076] The split node can achieve zero copy by exchanging image pointers through the vxSwapImageHandle function. The core of zero copy is that the operating system shares the kernel buffer with the application and maps a section of user space memory to the kernel space. When the mapping is successful, the user's modification of this memory area can be directly reflected in the kernel space; similarly, the kernel space's modification of this area is also directly reflected in the user space. Because of this mapping relationship, there is no need to copy data between user state and kernel state.
[0077] The segmentation node uses cropVxImage as a callback function, and its function address is passed to node as a parameter of node. Each time the image processing device runs UserCropNode, it will call cropVxImage to segment the image.
[0078] In a specific implementation, an image with a width and height of 3840×2160 is scaled to an image with a width and height of 1024×576. The segmentation node initializes the input image src_image (3840×2160) according to the image size, and generates the upper half image above_image (3840×1080) and the lower half image below_image (3840×1080) by segmentation. src_image is passed as an input parameter to UserCropNode, and above_image and below_image are passed as output parameters to UserCropNode.
[0079] Step S13: transferring the first segmented image and the second segmented image to the first scaling node and the second scaling node respectively, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain the first scaled image and the second scaled image.
[0080] In the embodiment of the present application, the scaling node initializes the two images output1 and output2 after scaling, and passes the two images as output parameters to the corresponding scaling nodes Image Scale1 and Image Scale2. The two scaling nodes ScaleNode are respectively placed on TIVX_TARGET_VPAC_MSC1 and TIVX_TARGET_VPAC_MSC2 for operation, so that the two scaling operations can be run in parallel. The specific code implementation is as follows:
[0081] Create a scaled image node located above. graph is the graph object, above_src_image is the source image, and above_scaled_image is the scaled image. The remaining parameters are set to NULL, indicating no additional input or parameters.
[0082] Create a scaled image node, positioned below, containing the cropped image cropped_image. The remaining parameters are set to NULL.
[0083] Set the target of the upper node to TI_VX_TARGET_VPAC_MSC1. VX_STATUS_CHECK_RETURN is a macro that checks the status returned by a function and returns an error if it fails.
[0084] Set the target of the node below to TI_VX_TARGET_VPAC_MSC2. Also use the VX_STATUS_CHECK_RETURN macro to check the status.
[0085] This way, the code becomes clearer and easier to read, while also ensuring compliance with best practices and coding standards.
[0086] Step S14: stitching the first zoomed image and the second zoomed image into a final image through a stitching node.
[0087] In the embodiment of the present application, the splicing node initializes and creates the spliced scaled image output_image (1024×576), and passes the image as an output parameter to UserMergeNode for splicing into the final image. The specific code implementation is as follows:
[0088] Merge the two input images (input_o and input_1) into one output image (output) by calling the merge method of the MergeWorkshop class.
[0089] Use the API of the VX (VisionX) library to manage the memory of image data, including the exchange of image handles and the reinterpretation of memory pointers.
[0090] The data of the input image is swapped to the memory space of the output image through the vxSwapImageHandle function. This is used to efficiently manage memory during image processing and avoid unnecessary memory copying.
[0091] Reinterpret the input pointer as a pointer of type uint8_t to facilitate subsequent image data processing.
[0092] After each critical operation, a status check is performed using the VX_STATUS_CHECK_RETURN_STATUS macro to ensure that the operation was successfully performed. If the operation failed, the code will return the appropriate error status.
[0093] After the merge operation, set the width and height of the output image to ensure the correctness of the image data.
[0094] The core function implemented by the above code is to merge images and manage memory through the VX library to ensure the efficiency and correctness of image processing. Key operations include image merging, memory swapping, pointer reinterpretation, and status checking.
[0095] In an embodiment of the present application, the execution subject of the image processing method creates a segmentation node and a splicing node based on the software development kit of the autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling the image; the image to be processed is passed to the segmentation node to segment the image to be processed into a first segmented image and a second segmented image; the first segmented image and the second segmented image are respectively transferred to the first scaling node and the second scaling node, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image; the first scaled image and the second scaled image are spliced into a final image through the splicing node. The above-mentioned image processing method of the embodiment of the present application can effectively reduce the time consumption of image processing and improve the efficiency of image processing by running the image resizing operation in parallel after segmenting the image.
[0096] The image processing method of the present application can use TI chips to implement CPU-based zero-copy segmentation operations and splicing operations; it can also use the OpenVX framework and VPAC parallel operations to reduce the time consumption of scaling operations by half and improve image processing efficiency.
[0097] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0098] In order to implement the above image processing method, the present application also proposes an image processing device, for details, please refer to Figure 3 , Figure 3 It is a structural schematic diagram of an embodiment of the image processing device provided by the present application.
[0099] The image processing device 300 of this embodiment includes a creation module 31 , a segmentation module 32 , a scaling module 33 and a stitching module 34 .
[0100] Among them, the creation module is configured to create segmentation nodes and stitching nodes based on the software development kit of the autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling the image.
[0101] The segmentation module is configured to pass the image to be processed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image.
[0102] The scaling module is configured to transfer the first segmented image and the second segmented image to the first scaling node and the second scaling node respectively, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image.
[0103] The stitching module is configured to stitch the first zoomed image and the second zoomed image into a final image through the stitching node.
[0104] To implement the above image processing method, this application also proposes an image processing device, please refer to Figure 4 , Figure 4 It is a structural schematic diagram of an embodiment of the image processing device provided by the present application.
[0105] The image processing device 400 of this embodiment includes a processor 41 , a memory 42 , an input / output device 43 , and a bus 44 .
[0106] The processor 41 , the memory 42 , and the input / output device 43 are respectively connected to the bus 44 . The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the image processing method described in the above embodiment.
[0107] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having the ability to process signals. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 41 may also be any conventional processor, etc.
[0108] This application also provides a computer storage medium, please continue to refer to Figure 5 , Figure 5 It is a schematic diagram of the structure of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the above-mentioned embodiment.
[0109] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0110] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image processing method, characterized in that: The image processing method comprises: Creating a segmentation node and a splicing node based on a software development kit of an autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling an image; Passing the image to be processed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image; The first segmented image and the second segmented image are transmitted to the first scaling node and the second scaling node respectively, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image; The first zoomed image and the second zoomed image are spliced into a final image through the splicing node.
2. The image processing method according to claim 1, characterized in that: The autonomous driving chip includes the TI tda4vm autonomous driving chip.
3. The image processing method according to claim 1 or 2, characterized in that: The first scaling node runs on a first visual preprocessing accelerator of the autonomous driving chip, the second scaling node runs on a second visual preprocessing accelerator of the autonomous driving chip, and the first visual preprocessing accelerator and the second visual preprocessing accelerator run in parallel on the autonomous driving chip.
4. The image processing method according to any one of claims 1 to 3, characterized in that: The step of transferring the image to be processed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image comprises: Extracting a first input image object and two first output image objects pre-created by the segmentation node, wherein the first input image object has a first size, the first output image object has a second size, and the first size is larger than the second size; Assigning the image to be processed to the first input image object, and running the segmentation node to call an image segmentation function to segment the image to be processed, wherein the image segmentation function segments the first input image through zero copy and address offset when performing image segmentation and assigns the segmentation results to each of the first output image objects; The segmentation result includes the first segmented image and the second segmented image.
5. The image processing method according to claim 4, characterized in that: The first segmented image and the second segmented image are respectively the upper and lower parts, or the left and right parts, of the image to be processed.
6. The image processing method according to claim 4, characterized in that: The step of assigning the image to be processed to the first input image object comprises: The image to be processed is initialized to the first size and used as the value of the first input image object.
7. The image processing method according to any one of claims 1 to 3, characterized in that: The step of stitching the first scaled image and the second scaled image into a final image through the stitching node includes: Extracting two second input image objects and one second output image object created by the splicing node; Assigning the first segmented image and the second segmented image to the two second input image objects respectively, and running the stitching node to call the image stitching function to stitch the first scaled image and the second scaled image, wherein the image stitching function performs image stitching through zero copy when executing image stitching and assigns the stitching result to the second output image object; The stitching result is the final image.
8. An image processing device, characterized in that: The image processing device comprises: A creation module is configured to create a segmentation node and a splicing node based on a software development kit of an autonomous driving chip, wherein the software development kit of the autonomous driving chip includes a first scaling node and a second scaling node for scaling an image; A segmentation module, configured to pass the image to be processed into the segmentation node to segment the image to be processed into a first segmented image and a second segmented image; a scaling module, configured to transfer the first segmented image and the second segmented image to the first scaling node and the second scaling node respectively, so as to scale the first segmented image and the second segmented image in parallel through the first scaling node and the second scaling node to obtain a first scaled image and a second scaled image; The stitching module is configured to stitch the first zoomed image and the second zoomed image into a final image through the stitching node.
9. An image processing device, characterized in that: The image processing device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the image processing method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the image processing method according to any one of claims 1 to 7.