Image batch processing method, electronic equipment and computer readable storage medium
By selecting images that meet the hardware requirements for hardware processing before batch processing, and processing images that do not meet the requirements by software, the problem of resource waste caused by hardware processing failure is solved, and processing performance and efficiency are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2025-12-10
- Publication Date
- 2026-05-12
AI Technical Summary
In batch image processing, hardware processing failures cause the entire batch of images to be returned to software processing, wasting hardware computing resources and reducing processing performance and efficiency.
Before batch processing of images, images that meet the hardware processing requirements are selected for hardware processing, while images that do not meet the requirements are processed by software. Batch processing of images is carried out by utilizing the computing resources of both hardware and software.
It improves the performance and efficiency of batch image processing, makes full use of hardware and software resources, and avoids the waste of hardware computing resources.
Smart Images

Figure CN122019814A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image batch processing method, electronic device, and computer-readable storage medium. Background Technology
[0002] In image batch processing, considering performance issues, hardware processing is usually preferred. However, during actual batch processing, some unsupported features may cause hardware processing failures. If hardware processing fails for any image in the middle, the entire batch of images needs to be returned and processed by software. Although this can eventually yield the correct batch processing result, it wastes some hardware computing resources and reduces the performance and efficiency of batch processing. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide an image batch processing method, electronic device, and computer-readable storage medium that can improve the efficiency of image batch processing.
[0004] To address the aforementioned technical problems, the first aspect of this application provides an image batch processing method, comprising: acquiring a plurality of original images; selecting at least one original image from the plurality of original images that meets hardware processing requirements as a first image, and using the remaining original images from the plurality of original images as second images; performing batch processing on each of the first images using hardware; and performing batch processing on each of the second images using software.
[0005] The process of selecting at least one original image from a plurality of original images that meets the hardware processing requirements as the first image includes: for each original image, determining whether the original image meets the hardware processing requirements using the original image description information and the target image description information of the original image; wherein the original image description information is used to describe the original image, and the target image description information is used to describe the target image obtained after processing the original image; in response to the original image meeting the hardware processing requirements, the original image is selected as the first image.
[0006] The original image description information includes at least one of the following: first description information about the original image and second description information about the effective region in the original image. The first description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The second description information includes at least one of the following: width and height. The destination image description information includes at least one of the following: third description information about the destination image and fourth description information about the effective region in the destination image. The third description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The fourth description information includes at least one of the following: width and height.
[0007] The image batch processing method further includes, before batch processing of each first image using hardware or batch processing of each second image using software, the following steps: First, constructing several initial information groups using the descriptive information of each original image. The descriptive information of each original image includes original image descriptive information and target image descriptive information. The original image descriptive information includes first descriptive information about the original image and second descriptive information about the effective regions in the original image. The target image descriptive information includes third descriptive information about the target image obtained after processing the original images and fourth descriptive information about the effective regions in the target image. Each initial information group includes the same type of descriptive information for each original image, and the different descriptive information of an original image is arranged in the same order within each initial information group. Second, reorganizing the information in each initial information group yields a target information group corresponding to each initial information group. In the target information group, the descriptive information of each original image that meets the hardware processing requirements is arranged continuously, and / or the descriptive information of each original image that does not meet the hardware processing requirements is arranged continuously. The different descriptive information corresponding to an original image is arranged in the same order within the corresponding target information group.
[0008] The process of reorganizing the initial information groups to obtain target information groups corresponding to each initial information group includes: using the positional order of the descriptive information corresponding to each original image that meets the hardware processing requirements in the initial information groups as the first index value of the descriptive information corresponding to each original image that meets the hardware processing requirements, and using each first index value to form a first index group; and using the positional order of the descriptive information corresponding to each original image that does not meet the hardware processing requirements in the initial information groups as the second index value of the descriptive information corresponding to each original image that does not meet the hardware processing requirements, and using each second index value to form a second index group; and using the first index group and the second index group to reorganize the initial information groups to obtain target information groups corresponding to each initial information group, wherein in the target information groups, the positions of the descriptive information corresponding to the first index group are arranged consecutively, and / or, the positions of the descriptive information corresponding to the second index group are arranged consecutively.
[0009] The initial information groups are stored in the corresponding first memory. Using the first index group and the second index group, the initial information groups are reorganized to obtain the target information groups corresponding to each initial information group. This includes: for each initial information group, using one index group as the target index group, extracting the description information corresponding to each index value in the target index group from the initial information group, and storing the target description information in the second memory; using another index group as the new target index value, and re-executing the steps of extracting the description information corresponding to each index value in the target index group from the initial information group and subsequent steps, wherein the target description information stored in the second memory each time is concatenated to form the target information group corresponding to the initial information group.
[0010] In the target information group, the position order of the target description information corresponding to the first index group is before the position order of the target description information corresponding to the second index group.
[0011] The image batch processing also includes: in response to the existence of original images that meet the hardware processing requirements and the existence of original images that do not meet the hardware processing requirements, performing information recombination on each initial information group to obtain the target information group corresponding to each initial information group and its subsequent steps.
[0012] The process involves batch processing of each first image using hardware, or batch processing of each second image using software, including: sending the storage address and target quantity of each target information group to the image processing unit, so that the image processing unit can acquire each target image and perform batch processing based on each target information group and the target quantity; wherein, when the description information of the target image is located before the target information group and the description information of other images is located after the target information group, the target quantity includes the number of target images; when the description information of other images is located before the target information group and the description information of the target image is located after the target information group, the target quantity includes the number of target images and the number of other images; the image processing unit is hardware, and the target image is the first image and the other images are the second image, or the image processing unit is software, and the target image is the second image and the other images are the first image.
[0013] To solve the above-mentioned technical problems, a second aspect of this application provides an electronic device, which includes a memory and a processor. The memory is used to store program instructions, and the processor is used to execute the program instructions to implement the above-mentioned image batch processing method.
[0014] To address the aforementioned technical problems, a third aspect of this application provides a computer-readable storage medium for storing program instructions that can be executed to implement the aforementioned image batch processing method.
[0015] The above technical solution pre-judges or distinguishes several original images before batch processing them, in order to identify the original images that meet the hardware processing requirements and those that do not. This allows for batch processing of the original images that meet the hardware processing requirements using hardware and batch processing of the original images that do not meet the hardware processing requirements using software. This fully utilizes the hardware and software computing resources of the device for batch image processing, improving the performance and efficiency of batch image processing without wasting hardware computing resources. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an embodiment of the image batch processing method provided in this application; Figure 2 yes Figure 1 The flowchart of step S12 shown is a schematic diagram of one embodiment; Figure 3 This is a flowchart illustrating another embodiment of the image batch processing method provided in this application; Figure 4 yes Figure 3 The flowchart of step S34 shown is a schematic diagram of one embodiment. Figure 5 This is a schematic diagram of an embodiment of information reconstruction provided in this application; Figure 6 This is a schematic diagram of another embodiment of the information provided in this application being reconstructed; Figure 7 This is a schematic diagram of an embodiment of the image batch processing apparatus provided in this application; Figure 8 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application; Figure 9 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0017] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0018] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0019] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0020] Please see Figure 1 , Figure 1 This is a schematic flowchart of an embodiment of the image batch processing method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily replace it with a similar method. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes: Step S11: Obtain several original images.
[0021] In this embodiment, several original images are acquired.
[0022] In one embodiment, several raw images can be obtained from local storage or cloud storage. Of course, in other embodiments, an image acquisition device can be used to acquire images in real time to obtain several raw images.
[0023] Step S12: Select at least one original image that meets the hardware processing requirements from a number of original images as the first image, and use the remaining original images from the number of original images as the second image.
[0024] Using hardware (such as GPUs, NPUs, etc.) for batch image processing allows for the processing of more images per unit of time (high throughput) while reducing power consumption. Therefore, using hardware for batch image processing can improve the performance and efficiency of batch image processing and reduce power consumption.
[0025] In image batch processing, considering performance issues, hardware processing is usually preferred. However, during actual batch processing, some unsupported features may cause hardware processing failures. If hardware processing fails for any image in the middle, the entire batch of images needs to be returned and processed by software. Although this can eventually yield the correct batch processing result, it wastes some hardware computing resources and reduces the performance and efficiency of batch processing.
[0026] Therefore, in this embodiment, at least one original image that meets the hardware processing requirements is selected from a plurality of original images and designated as the first image, while the remaining original images are designated as the second image. In other words, before batch processing the plurality of original images, a pre-judgment is performed, or rather, the plurality of original images are distinguished to determine the original images that meet the hardware processing requirements and those that do not. This allows for subsequent batch processing of the original images that meet the hardware processing requirements using hardware and batch processing of the original images that do not meet the hardware processing requirements using software. This fully utilizes the hardware and software computing resources of the device for batch image processing, improving the performance and efficiency of batch image processing without wasting hardware computing resources.
[0027] Step S13: Perform batch processing on each first image using hardware.
[0028] In this embodiment, hardware is used to perform batch processing on each first image. Each first image is an original image that meets the hardware processing requirements from a plurality of original images; therefore, using hardware to perform batch processing on each first image fully utilizes the hardware computing resources of the device for batch image processing, thereby improving the performance and efficiency of batch image processing without wasting hardware computing resources.
[0029] It should be noted that batch image processing using hardware refers to using dedicated physical hardware within a device optimized for a specific computing task to perform batch image processing. The hardware described herein includes, but is not limited to, graphics processing units (GPUs), digital signal processors (DSPs), neural network processors (NPUs), image signal processors (ISPs), and video processors (VPUs), etc., and is not limited thereto.
[0030] Step S14: Use software to batch process each second image.
[0031] In this embodiment, software is used to batch process each of the second images. Each of the second images is an original image that does not meet the hardware processing requirements from a plurality of original images; therefore, by using software to batch process each of the first images, the software computing resources of the device are fully utilized for batch image processing, thereby improving the performance and efficiency of batch image processing.
[0032] It should be noted that batch image processing using software refers to using the central processing unit (CPU) in the device to perform batch image processing.
[0033] Furthermore, the execution order of steps S13 and S14 is not limited and can be set according to actual usage needs. For example, step S13 can be executed first, followed by step S14. Or, step S14 can be executed first, followed by step S13. Or, steps S13 and S14 can be executed simultaneously.
[0034] Furthermore, if all the acquired original images meet the hardware processing requirements, since there are no original images that do not meet the hardware processing requirements, step S14 does not need to be executed, and only step S13 needs to be executed; if none of the acquired original images meet the hardware processing requirements, since there are no original images that meet the hardware processing requirements, step S13 does not need to be executed, and only step S14 needs to be executed.
[0035] Please see Figure 2 , Figure 2 yes Figure 1 The flowchart shown is a schematic diagram of one embodiment of step S12. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 2 The illustrated process sequence is limited. For example... Figure 2 As shown, this embodiment includes: Step S21: For each original image, use the original image description information and the target image description information to determine whether the original image meets the hardware processing requirements.
[0036] In this embodiment, for each original image, the original image description information and the target image description information are used to determine whether the original image meets the hardware processing requirements; wherein, the original image description information is used to describe the original image, and the target image description information is used to describe the target image obtained after processing the original image.
[0037] In one embodiment, if both the original image description information of the original image and the target image description information of the corresponding target image satisfy the hardware computation limitations, then the original image is determined to meet the hardware processing requirements.
[0038] In one embodiment, the original image description information includes at least one of the following: first description information about the original image and second description information about the effective regions in the original image. The first description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The second description information includes at least one of the following: width and height. The destination image description information includes at least one of the following: third description information about the destination image and fourth description information about the effective regions in the destination image. The third description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The fourth description information includes at least one of the following: width and height.
[0039] The width and height in the first description information refer to the dimensions of the original image; the color space in the first description information determines the encoding method, range, and interrelationship of colors in the original image; the span in the first description information refers to the actual number of bytes occupied by each row of pixels in memory; the address alignment in the first description information is used to check whether the memory starting address of the image pixel data of the original image meets the memory alignment granularity required by the hardware (e.g., 4KB, 64 bytes, etc.); the address range in the first description information is used to check whether the memory region of the image pixel data of the original image is located within the physical address space accessible by the hardware.
[0040] The width and height in the third description information refer to the dimensions of the target image; the color space in the third description information determines the encoding method, range, and interrelationship of colors in the target image; the span in the third description information refers to the actual number of bytes occupied by each row of pixels in memory; the address alignment in the third description information is used to check whether the memory starting address of the image pixel data of the target image meets the memory alignment granularity required by the hardware (e.g., 4KB, 64 bytes, etc.); the address range in the third description information is used to check whether the memory region of the image pixel data of the target image is located within the physical address space accessible by the hardware.
[0041] The effective region in an image refers to the local area in the image that actually needs to be processed. The width and height in the second descriptive information refer to the dimensions of the effective region in the original image. The width and height in the fourth descriptive information refer to the dimensions of the effective region in the destination image.
[0042] It should be noted that if the original image description information includes first description information about the original image and second description information about the effective regions in the original image, and the destination image description information includes third description information about the destination image and fourth description information about the effective regions in the destination image, and all of the first description information about the original image, the second description information about the effective regions in the original image, the third description information about the destination image, and the fourth description information about the effective regions in the destination image satisfy the hardware computation limitations, then the original image is determined to meet the hardware processing requirements.
[0043] Step S22: In response to the original image meeting the hardware processing requirements, the original image is used as the first image.
[0044] In this embodiment, in response to the original image meeting the hardware processing requirements, the original image is designated as the first image. By designating the original image as the first image based on its compliance with hardware processing requirements, original images that meet the requirements and those that do not are identified. This allows for subsequent batch processing of the compliant images using hardware and batch processing of the non-compliant images using software. This fully utilizes the device's hardware and software computing resources for batch image processing, improving the performance and efficiency of image batch processing without wasting hardware computing resources.
[0045] Please see Figure 3 , Figure 3 This is a schematic flowchart of another embodiment of the image batch processing method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 3 The illustrated process sequence is limited. For example... Figure 3 As shown, this embodiment includes: Step S31: Obtain several original images.
[0046] Step S31 is similar to step S11, and will not be described again here.
[0047] Step S32: Select at least one original image that meets the hardware processing requirements from a number of original images as the first image, and use the remaining original images from the number of original images as the second image.
[0048] Step S32 is similar to step S12, and will not be described again here.
[0049] Step S33: Construct several initial information groups using the descriptive information of each original image.
[0050] In this embodiment, several initial information groups are constructed using the descriptive information of each original image. The descriptive information of each original image includes original image descriptive information and target image descriptive information. The original image descriptive information includes first descriptive information about the original image and second descriptive information about the effective region in the original image. The target image descriptive information includes third descriptive information about the target image obtained after processing the original image and fourth descriptive information about the effective region in the target image. An initial information group includes the same descriptive information for each original image, and the different descriptive information of an original image is arranged in the same order in each initial information group.
[0051] Specifically, the description information of the original image includes the original image description information of the original image, which includes the first description information about the original image. The first description information corresponding to each original image constitutes an initial information group, denoted as src_image[i]. Each element i in src_image[i] represents the first description information corresponding to an original image.
[0052] The descriptive information of the original image includes the original image description information and the target image description information. The original image description information includes the second description information about the effective region in the original image. The second description information corresponding to each original image constitutes an initial information group, denoted as src_rect[i]. Each element i in src_rect[i] represents the second description information corresponding to an original image.
[0053] Each descriptive information of the original image includes the descriptive information of the target image. The descriptive information of the target image includes the third descriptive information of the target image obtained after processing the original image. The third descriptive information of the target image corresponding to each original image constitutes an initial information group, denoted as dst_image[i]. Each element i in dst_image[i] represents the third descriptive information of the target image corresponding to an original image.
[0054] The description information of the original image includes the description information of the target image. The description information of the target image includes the fourth description information about the effective region in the target image. The fourth description information corresponding to each target image constitutes an initial information group, denoted as dst_rect[i]. Each element i in dst_rect[i] represents the fourth description information corresponding to a target image.
[0055] Step S34: Reorganize the information of each initial information group to obtain the target information group corresponding to each initial information group.
[0056] In this embodiment, each initial information group is reorganized to obtain a target information group corresponding to each initial information group; wherein, in the target information group, the positions of the description information of each original image that meets the hardware processing requirements are arranged continuously, and / or, the positions of the description information of each original image that does not meet the hardware processing requirements are arranged continuously, and the different description information corresponding to an original image are arranged in the same order in the corresponding target information group.
[0057] Batch processing in hardware or software requires that the input data be continuous in memory, or in other words, that the input data be physically stored contiguously, or that the input data be arranged contiguously in memory. This allows the hardware or software to acquire all or as much data as possible that meets its processing requirements at once, and to perform batch and centralized processing on the acquired data, thereby achieving efficient batch data processing.
[0058] In the first scenario, the descriptive information of each original image that meets the hardware processing requirements is arranged consecutively within the target information group. Therefore, the descriptive information of each original image that meets the hardware processing requirements is contiguous in memory, or physically stored contiguously. Thus, by reorganizing the initial information group, the descriptive information of each original image that meets the hardware processing requirements is made contiguous in memory, or physically stored contiguously. Subsequently, the hardware can acquire all or as many descriptive information of the original images that meet the hardware processing requirements at once. Based on this acquired descriptive information, batch processing and centralized processing of the original images that meet the hardware processing requirements can be performed, fully utilizing the device's hardware computing resources for batch image processing. This improves the performance and efficiency of batch image processing without wasting hardware computing resources.
[0059] The second scenario involves the descriptive information of the original images that do not meet hardware processing requirements being arranged consecutively within the target information group. Therefore, the descriptive information of these original images is contiguous in memory, or physically stored contiguously. Thus, by reorganizing the initial information group, the descriptive information of the original images that do not meet hardware processing requirements is made contiguous in memory, or physically stored contiguously. Subsequently, software can acquire the descriptive information of all or as many original images that do not meet hardware processing requirements at once, and based on this acquired information, batch and centralized processing can be performed on these images. This fully utilizes the device's software computing resources for batch image processing, improving the performance and efficiency of image batch processing.
[0060] The third scenario involves the following: within the target information group, the description information of each original image that meets the hardware processing requirements is arranged consecutively, as are the description information of each original image that does not meet the hardware processing requirements. Therefore, the description information of each original image that meets the hardware processing requirements is contiguous in memory, and the description information of each original image that does not meet the hardware processing requirements is also contiguous in memory; in other words, the description information of each original image that meets the hardware processing requirements is physically stored contiguously. Thus, by reorganizing the initial information group, the description information of each original image that does not meet the hardware processing requirements is made contiguous in memory, or in other words, physically stored contiguously. Therefore, it is possible to utilize hardware to acquire descriptive information of all or as many original images that do not meet hardware processing requirements at once, and based on the acquired descriptive information of each original image that does not meet hardware processing requirements, to perform batch processing and centralized processing on each original image that does not meet hardware processing requirements, so as to make full use of the device's software computing resources for image batch processing, thereby improving the performance and efficiency of image batch processing; in addition, it is also possible to utilize software to acquire descriptive information of all or as many original images that do not meet hardware processing requirements at once, and based on the acquired descriptive information of each original image that does not meet hardware processing requirements, to perform batch processing and centralized processing on each original image that does not meet hardware processing requirements, so as to make full use of the device's software computing resources for image batch processing, thereby improving the performance and efficiency of image batch processing.
[0061] In one embodiment, in the target information group, the descriptive information of each original image that meets the hardware processing requirements is arranged in a continuous sequence, and the descriptive information of each original image that does not meet the hardware processing requirements is arranged in a continuous sequence, with the order of the descriptive information of each original image that meets the hardware processing requirements preceding the order of the descriptive information of each original image that does not meet the hardware processing requirements.
[0062] Of course, in other embodiments, in the target information group, the description information of each original image that meets the hardware processing requirements is arranged in a continuous order, and the description information of each original image that does not meet the hardware processing requirements is also arranged in a continuous order. The order of the description information of each original image that meets the hardware processing requirements may also be after the order of the description information of each original image that does not meet the hardware processing requirements.
[0063] It should be noted that, in response to the existence of both original images that meet the hardware processing requirements and those that do not, information reorganization is performed on each initial information group to obtain the target information group corresponding to each initial information group and subsequent steps. That is, steps S33-S34 are only executed when both original images that meet and do not meet the hardware processing requirements exist among the acquired original images. This is because, when both original images that meet and do not meet the hardware processing requirements exist among the acquired original images, the descriptive information of the original images that meet the hardware processing requirements may not be arranged contiguously in the initial information group, and / or the descriptive information of the original images that do not meet the hardware processing requirements may not be arranged contiguously; that is, the descriptive information of the original images that meet the hardware processing requirements may not be contiguous in memory, and / or the descriptive information of the original images that do not meet the hardware processing requirements may not be contiguous in memory.
[0064] Step S35: Perform batch processing on each first image using hardware.
[0065] In this embodiment, hardware is used to perform batch processing on each first image.
[0066] Step S36: Use software to batch process each second image.
[0067] In this embodiment, software is used to process each second image in batches.
[0068] It should be noted that the execution order of steps S35 and S36 is not limited and can be set according to actual needs. For example, step S35 can be executed first, followed by step S36. Or, step S36 can be executed first, followed by step S35. Or, steps S35 and S36 can be executed simultaneously.
[0069] In one embodiment, batch processing of each first image is performed using hardware, or batch processing of each second image is performed using software. Specifically, the storage address and target quantity of each target information group are sent to the image processing unit, so that the image processing unit acquires each target image and performs batch processing based on each target information group and the target quantity. Wherein, when the description information of the target image is located before the target information group and the description information of other images is located after the target information group, the target quantity includes the number of target images; when the description information of other images is located before the target information group and the description information of the target image is located after the target information group, the target quantity includes the number of target images and the number of other images. The image processing unit is hardware, and the target image is the first image and the other images are the second image, or the image processing unit is software, and the target image is the second image and the other images are the first image.
[0070] When the description information of the images to be processed by the image processing software is located before each target information group, the storage address of each target information group and the number of target images are sent to the image processing software. Sending the storage address of each target information group to the image processing software allows the image processing software to retrieve each target information group based on its storage address, thereby enabling batch image processing based on the target information groups. Sending the target number of target images to the image processing software informs the image processing software of the number of images that need to be processed.
[0071] When the description information of the images to be processed by the image processing software is located after each target information group, the storage address of each target information group, the number of target images, and the number of other images are sent to the image processing software. Sending the storage address of each target information group to the image processing software allows the image processing software to obtain each target information group based on its storage address, thereby enabling batch image processing based on the target information group. Since the image processing software starts batch image processing based on the description information of the image at the first sequential position in each target information group, it needs to know which position in the target information group it should start batch image processing from. Therefore, sending the number of target images and the number of other images to the image processing software is to inform the image processing software of the number of images it needs to process and the starting position of the images to be processed.
[0072] In one implementation, if the memory used by the target image is a single block, the image processing software needs to synchronize the data in the virtual address of the entire memory block to the physical address after processing. If the memory used by the target image consists of several independent image memory blocks, the data in the virtual address of each block can be synchronized to the physical address separately.
[0073] Please see Figure 4 , Figure 4 yes Figure 3 The diagram shows a flowchart of one embodiment of step S34. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 4 The illustrated process sequence is limited. For example... Figure 4 As shown, this embodiment includes: Step S41: The position order of the description information corresponding to each original image that meets the hardware processing requirements in the initial information group is used as the first index value of the description information corresponding to each original image that meets the hardware processing requirements, and the first index value is used to form the first index group.
[0074] In this embodiment, the position order of the description information corresponding to each original image that meets the hardware processing requirements in the initial information group is used as the first index value of the description information corresponding to each original image that meets the hardware processing requirements, and the first index value is used to form a first index group.
[0075] For example, to obtain 8 original images: the image indices of the 8 original images are 0, 1, 2, ..., 7. Therefore, the position order of the description information corresponding to the 8 original images in the initial information group is 0, 1, 2, ..., 7 respectively. If the 1st, 3rd, 5th, and 7th original images among the 8 original images meet the hardware processing requirements, then the first index value is 1, 3, 5, 7, and the first index values 1, 3, 5, and 7 constitute the first index group.
[0076] In one embodiment, a first index group is formed using each first index value. Specifically, the first index values are stored in a first container to form the first index group. Specifically, a vector container—img_proc_use_hw—is allocated, and the first index values are stored in the img_proc_use_hw container. The mg_proc_use_hw container storing the first index values can be considered as the first index group.
[0077] Step S42: The position order of the description information corresponding to each original image that does not meet the hardware processing requirements in the initial information group is used as the second index value of the description information corresponding to each original image that does not meet the hardware processing requirements, and the second index value is used to form a second index group.
[0078] In this embodiment, the position order of the description information corresponding to each original image that does not meet the hardware processing requirements in the initial information group is used as the second index value of the description information corresponding to each original image that does not meet the hardware processing requirements, and the second index value is used to form a second index group.
[0079] For example, to obtain 8 original images: the image indices of the 8 original images are 0, 1, 2, ..., 7. Therefore, the position order of the description information corresponding to the 8 original images in the initial information group is 0, 1, 2, ..., 7 respectively. If the 0th, 2nd, 4th, and 6th original images do not meet the hardware processing requirements, then the second index value is 0, 2, 4, 6, and the second index values 0, 2, 4, and 6 constitute the second index group.
[0080] In one embodiment, a second index group is formed using each second index value. Specifically, the second index values are stored in a second container to form the second index group. Specifically, a vector container—img_proc_use_cpu—is allocated, and the second index values are stored in the img_proc_use_cpu container. The img_proc_use_cpu container storing the second index values can be considered as the second index group.
[0081] It should be noted that if either the img_proc_use_hw container or the img_proc_use_cpu container is empty, it means that all the acquired original images are either original images that meet the hardware processing requirements or all of them are original images that do not meet the hardware processing requirements. In this case, step S43 is no longer executed, and there is no need to reassemble the information of each initial information group.
[0082] Step S43: Using the first index group and the second index group, reorganize the information of each initial information group to obtain the target information group corresponding to each initial information group.
[0083] In this embodiment, the first index group and the second index group are used to reorganize the information of each initial information group to obtain the target information group corresponding to each initial information group. In the target information group, the positions of the description information corresponding to the first index group are arranged continuously, and / or the positions of the description information corresponding to the second index group are arranged continuously.
[0084] In the first scenario, the descriptive information corresponding to the first index group is arranged consecutively within the target information group. This descriptive information corresponds to the descriptions of each original image that meets the hardware processing requirements. Therefore, when the descriptive information corresponding to the first index group is arranged consecutively, the descriptive information of each original image that meets the hardware processing requirements is contiguous in memory, or physically stored contiguously. Consequently, the hardware can then acquire all or as many descriptive information of the original images that meet the hardware processing requirements at once. Based on this acquired descriptive information, batch processing and centralized processing of the original images that meet the hardware processing requirements can be performed. This fully utilizes the device's hardware computing resources for batch image processing, improving the performance and efficiency of batch image processing without wasting hardware computing resources.
[0085] The second scenario involves the description information corresponding to the second index group within the target information group being arranged consecutively. This description information corresponds to the description information of each original image that does not meet the hardware processing requirements. Therefore, when the description information corresponding to the second index group is arranged consecutively, the description information of each original image that does not meet the hardware processing requirements is contiguous in memory, or physically stored contiguously. Consequently, software can subsequently acquire the description information of all or as many original images that do not meet the hardware processing requirements at once. Based on this acquired description information, batch processing and centralized processing of these original images can be performed, fully utilizing the device's software computing resources for batch image processing. This improves the performance and efficiency of batch image processing without wasting hardware computing resources.
[0086] The third scenario is that, within the target information group, the descriptive information corresponding to the first index group is arranged consecutively, and the descriptive information corresponding to the second index group is also arranged consecutively. The descriptive information corresponding to the first index group is the descriptive information corresponding to each original image that meets the hardware processing requirements, while the descriptive information corresponding to the second index group is the descriptive information corresponding to each original image that does not meet the hardware processing requirements. Therefore, when the descriptive information corresponding to the first index group is arranged consecutively, the descriptive information of each original image that meets the hardware processing requirements is contiguous in memory, or in other words, physically stored consecutively. Similarly, when the descriptive information corresponding to the second index group is arranged consecutively, the descriptive information of each original image that does not meet the hardware processing requirements is contiguous in memory, or in other words, physically stored consecutively. Therefore, it is possible to utilize hardware to acquire descriptive information of all or as many original images that meet the hardware processing requirements at once, and then perform batch processing and centralized processing on each original image that meets the hardware processing requirements based on the acquired descriptive information. This fully utilizes the device's hardware computing resources for batch image processing, improving the performance and efficiency of batch image processing without wasting hardware computing resources. Alternatively, it is also possible to utilize software to acquire descriptive information of all or as many original images that do not meet the hardware processing requirements at once, and then perform batch processing and centralized processing on each original image that does not meet the hardware processing requirements based on the acquired descriptive information. This fully utilizes the device's software computing resources for batch image processing, improving the performance and efficiency of batch image processing.
[0087] In one embodiment, in the target information group, the positions of the description information corresponding to the first index group are arranged consecutively, and the positions of the description information corresponding to the second index group are arranged consecutively. The position order of the target description information corresponding to the first index group is before the position order of the target description information corresponding to the second index group. That is, the position order of the description information of each original image that meets the hardware processing requirements is before the position order of the description information of each original image that does not meet the hardware processing requirements.
[0088] Of course, in other embodiments, in the target information group, the positions of the description information corresponding to the first index group are arranged consecutively, and the positions of the description information corresponding to the second index group are arranged consecutively. The position order of the target description information corresponding to the first index group is after the position order of the target description information corresponding to the second index group. That is to say, the position order of the description information of each original image that meets the hardware processing requirements is after the position order of the description information of each original image that does not meet the hardware processing requirements.
[0089] In one embodiment, the initial information group is stored in the corresponding first memory; using the first index group and the second index group, the information of each initial information group is reorganized to obtain the target information group corresponding to each initial information group. Specifically, for each initial information group, one index group is used as the target index group, and the description information corresponding to each index value in the target index group is extracted from the initial information group as the target description information; the target description information is stored in the second memory; another index group is used as the new target index value, and the steps of extracting the description information corresponding to each index value in the target index group from the initial information group and subsequent steps are executed again, wherein the target description information stored in the second memory each time is concatenated to form the target information group corresponding to the initial information group.
[0090] The first descriptive information corresponding to each original image constitutes an initial information group, denoted as src_image[i]; the second descriptive information corresponding to each original image constitutes an initial information group, denoted as src_rect[i]; the third descriptive information corresponding to each original image constitutes an initial information group, denoted as dst_image[i]; and the fourth descriptive information corresponding to each destination image constitutes an initial information group, denoted as dst_rect[i]. The descriptive information in each initial information group is stored in the corresponding first memory. That is, the descriptive information in the first memory is concatenated to form the initial information group corresponding to that first memory. The order of the descriptive information in the initial information group reflects the storage order of the descriptive information in the corresponding first memory.
[0091] The first description information corresponding to each original image constitutes the initial information group src_image[i], and its corresponding target information group is denoted as src_imag[index]; the second description information corresponding to each original image constitutes the initial information group src_rect[i], and its corresponding target information group is denoted as src_rect[index]; the third description information of the target image corresponding to each original image constitutes the initial information group dst_image[i], and its corresponding target information group is denoted as dst_imag[index]; the fourth description information corresponding to each target image constitutes the initial information group dst_rect[i], and its corresponding target information group is denoted as dst_rect[index].
[0092] Before reorganizing the information in each initial information group, the second memory corresponding to each initial information group will be determined to ensure that the second memory corresponding to each initial information group can accommodate the description information in the corresponding initial information group.
[0093] Taking the initial information group src_image[i], which is composed of the first description information corresponding to each original image, as an example, the information recombination of the initial information group to obtain the corresponding target information group is explained. In this explanation, the description information of each original image that meets the hardware processing requirements and the description information of each original image that does not meet the hardware processing requirements are arranged in a continuous manner in the target information group as examples: Step 1: Take an index group as the target index group, extract the first description information corresponding to each index value in the target index group from the initial information group, use it as the target description information, and store the target description information in the second memory.
[0094] Specifically, the index values in the first position sequence of the target index group are obtained, and the first description information corresponding to the index value is extracted from src_image[i] as the target description information; then, the target description information is stored in the first sequential position in the corresponding second memory, that is, the target description information is assigned to the first sequential position in src_imag[index], where index starts from 0; then, the other index values in the target index group are obtained in sequence, so that the first description information corresponding to all index values in the target index group is stored in the corresponding second memory in sequence, that is, the first description information corresponding to all index values in the target index group is assigned to src_imag[index] in sequence.
[0095] For example, the first index group is first used as the target index group. The index values in the first index group are obtained in the first position order. The first description information corresponding to the index value is extracted from src_image[i] as the target description information. Then, the target description information is stored in the first sequential position in the corresponding second memory. That is, the target description information is assigned to the first sequential position in src_imag[index], where index starts from 0. Then, the other index values in the first index group are obtained in sequence, so that the first description information corresponding to all index values in the first index group is stored in the corresponding second memory in sequence. That is, the first description information corresponding to all index values in the first index group is assigned to src_imag[index] in sequence. Based on this method, in the target information group src_imag[index], the positions of the first description information of each original image that meets the hardware processing requirements are arranged continuously. Therefore, the first description information of each original image that meets the hardware processing requirements is continuous in memory, or in other words, the first description information of each original image that meets the hardware processing requirements is stored continuously in physical memory. Therefore, by reorganizing the initial information group src_image[i], the first description information of each original image that meets the hardware processing requirements is continuous in memory, or in other words, the first description information of each original image that meets the hardware processing requirements is physically stored continuously.
[0096] It should be noted that if the container img_proc_use_hw storing the first index value can be regarded as the first index group, then the index values in the img_proc_use_hw container are sequentially retrieved in a loop, and the first description information corresponding to all the index values in the img_proc_use_hw container is stored in the corresponding second memory in order. In other words, the first description information corresponding to all the index values in the img_proc_use_hw container is assigned to src_imag[index] in order.
[0097] For example, first, the second index group is used as the target index group. The index values in the first position sequence of the second index group are obtained, and the first description information corresponding to the index value is extracted from src_image[i] as the target description information. Then, the target description information is stored in the corresponding first sequential position in the second memory, that is, the target description information is assigned to the first sequential position in src_imag[index], where index starts from 0. Then, other index values in the second index group are obtained sequentially, so that the first description information corresponding to all index values in the second index group is stored sequentially in the corresponding second memory, that is, the first description information corresponding to all index values in the second index group is assigned sequentially to src_imag[index]. Based on this method, in the target information group src_imag[index], the positions of the first description information of each original image that does not meet the hardware processing requirements are arranged continuously; therefore, the first description information of each original image that does not meet the hardware processing requirements is continuous in memory, or in other words, the first description information of each original image that does not meet the hardware processing requirements is physically stored continuously. Therefore, by reorganizing the initial information group src_image[i], the first description information of each original image that does not meet the hardware processing requirements is made to be continuous in memory, or in other words, the first description information of each original image that does not meet the hardware processing requirements is physically stored continuously.
[0098] If the container img_proc_use_cpu that stores the second index value can be regarded as the second index group, then the index values in the img_proc_use_cpu container are sequentially retrieved in a loop, and the first description information corresponding to all the index values in the img_proc_use_cpu container is stored in the corresponding second memory in order. In other words, the first description information corresponding to all the index values in the img_proc_use_cpu container is assigned to src_imag[index] in order.
[0099] Step 2: Use another index group as the new target index value, and re-execute the descriptive information corresponding to each index value in the target index group from the initial information group and the subsequent steps.
[0100] Specifically, the index values in the first position sequence of the new target index group are obtained, and the first description information corresponding to the index value is extracted from src_image[i] as the target description information. Then, the target description information is stored in a corresponding location in the second memory, which is the location after the end of the loop in step one. That is, the target description information is assigned to the index position in src_imag[index], where the index starts from the index value after the end of the loop in step one. Then, the other index values in the new target index group are obtained in sequence, so that the first description information corresponding to all the index values in the new target index group is stored in the corresponding second memory in sequence. That is, the first description information corresponding to all the index values in the new target index group is assigned to src_imag[index] in sequence. The target description information in the second memory is concatenated to form a target information group.
[0101] For example, the first index group is then used as the target index group. The index values in the first index group, ordered by the first position, are obtained. The first description information corresponding to the index value is extracted from `src_image[i]` and used as the target description information. Then, the target description information is stored in a corresponding location in the second memory, which is the location after the loop in step one. That is, the target description information is assigned to the `index` position in `src_imag[index]`, where `index` starts from the `index` value after the loop in step one. Then, other index values in the first index group are sequentially obtained, and the first description information corresponding to all index values in the first index group is stored sequentially in the corresponding second memory. That is, the first description information corresponding to all index values in the first index group is assigned sequentially to `src_imag[index]`. Based on this method, the positions of the first description information of each original image that meets the hardware processing requirements are arranged continuously in the target information group `src_imag[index]`. Therefore, the first description information of each original image that meets the hardware processing requirements is continuous in memory, or in other words, the first description information of each original image that meets the hardware processing requirements is physically stored continuously. Therefore, by reorganizing the initial information group src_image[i], the first description information of each original image that meets the hardware processing requirements is continuous in memory, or in other words, the first description information of each original image that meets the hardware processing requirements is physically stored continuously.
[0102] It should be noted that if the container img_proc_use_hw storing the first index value can be regarded as the first index group, then the index values in the img_proc_use_hw container are sequentially retrieved in a loop, and the first description information corresponding to all the index values in the img_proc_use_hw container is stored in the corresponding second memory in order. In other words, the first description information corresponding to all the index values in the img_proc_use_hw container is assigned to src_imag[index] in order.
[0103] For example, the second index group is then used as the target index group. The index values in the second index group, ordered by the first position, are obtained. The first description information corresponding to the index value is extracted from `src_image[i]` and used as the target description information. Then, the target description information is stored in a corresponding location in the second memory, which is the location after the loop in step one. That is, the target description information is assigned to the `index` position in `src_imag[index]`, where `index` starts from the `index` value after the loop in step one. Then, the other index values in the second index group are obtained sequentially, so that the first description information corresponding to all index values in the second index group is stored sequentially in the corresponding second memory. That is, the first description information corresponding to all index values in the second index group is assigned sequentially to `src_imag[index]`. Based on this method, in the target information group `src_imag[index]`, the positions of the first description information of each original image that does not meet the hardware processing requirements are arranged continuously. Therefore, the first description information of each original image that does not meet the hardware processing requirements is continuous in memory, or in other words, the first description information of each original image that does not meet the hardware processing requirements is physically stored continuously. Therefore, by reorganizing the initial information group src_image[i], the first description information of each original image that does not meet the hardware processing requirements is made to be continuous in memory, or in other words, the first description information of each original image that does not meet the hardware processing requirements is physically stored continuously.
[0104] It should be noted that if the container img_proc_use_cpu storing the first index value can be regarded as the first index group, then the index values in the img_proc_use_cpu container are sequentially retrieved in a loop, and the first description information corresponding to all the index values in the img_proc_use_cpu container is stored in the corresponding second memory in order. In other words, the first description information corresponding to all the index values in the img_proc_use_cpu container is assigned to src_imag[index] in order.
[0105] The technical solution of this application will be illustrated below with two specific examples.
[0106] Example 1 Step 1: Obtain 8 original images. The image indices of the 8 original images are 0, 1, 2, ..., 7, and the position order of the description information corresponding to the 8 original images in the initial information group is 0, 1, 2, ..., 7, respectively. For example, Figure 5 As shown, Figure 5 This is a schematic diagram of an embodiment of information recombination provided in this application. The first description information corresponding to the 8 original images constitutes the initial information group src_image; the third description information corresponding to the 8 original images constitutes the initial information group dst_image; the second description information corresponding to the 8 original images constitutes the initial information group src_rect (initial); and the fourth description information corresponding to the 8 target images constitutes the initial information group dst_rect (initial).
[0107] Step Two: Assume that images 1, 3, 5, and 7 of the 8 original images meet the hardware processing requirements, while images 0, 2, 4, and 6 do not (e.g., ...). Figure 5 As shown, hw indicates compliance with hardware processing requirements, and cpu indicates non-compliance with hardware processing requirements. The position order of the description information corresponding to the 1st, 3rd, 5th, and 7th original images in the initial information group is used as the first index value and stored in the img_proc_use_hw container. The four values stored in the img_proc_use_hw container are 1, 3, 5, and 7. The position order of the description information corresponding to the 0th, 2nd, 4th, and 6th original images in the initial information group is used as the second index value and stored in the img_proc_use_cpu container. The four values stored in the img_proc_use_cpu container are 0, 2, 4, and 6.
[0108] Step 3: As Figure 5 As shown, the first descriptive information is extracted from positions 1, 3, 5, and 7 of the initial information group src_image and assigned to positions 0, 1, 2, and 3 of the target information group src_imag, corresponding to the initial information group src_image. Then, the first descriptive information is extracted from positions 0, 2, 4, and 6 of the initial information group src_image and assigned to positions 4, 5, 6, and 7 of the target information group src_imag, corresponding to the initial information group src_image. This completes the information reorganization of the initial information group src_image.
[0109] Extract the corresponding third description information from positions 1, 3, 5, and 7 of the initial information group dst_image, and assign them sequentially to positions 0, 1, 2, and 3 of the target information group dst_imag. Then, extract the corresponding third description information from positions 0, 2, 4, and 6 of the initial information group dst_image, and assign them sequentially to positions 4, 5, 6, and 7 of the target information group dst_imag. This completes the information reorganization of the initial information group dst_image.
[0110] Extract the corresponding second description information from positions 1, 3, 5, and 7 of the initial information group src_rect (initial), and assign them sequentially to positions 0, 1, 2, and 3 of the target information group src_rect (target). Then, extract the corresponding second description information from positions 0, 2, 4, and 6 of the initial information group src_rect (initial), and assign them sequentially to positions 4, 5, 6, and 7 of the target information group src_rect (target). This completes the information reorganization of the initial information group src_rect (initial).
[0111] Extract the corresponding fourth description information from positions 1, 3, 5, and 7 of the initial information group dst_rect (initial), and assign them sequentially to positions 0, 1, 2, and 3 of the target information group dst_rect (target). Then, extract the corresponding fourth description information from positions 0, 2, 4, and 6 of the initial information group dst_rect (initial), and assign them sequentially to positions 4, 5, 6, and 7 of the target information group dst_rect (target). This completes the information reorganization of the initial information group dst_rect (initial).
[0112] Step 4: Send the target information group src_imag, target information group dst_imag, target information group src_rect(target), dst_rect(target), and the number of target images (4 here) to the hardware; and send the target information group src_imag, target information group dst_imag, target information group src_rect(target), dst_rect(target), the number of target images (4 here), and the number of other images (4 here) to the software.
[0113] Example 2 Step 1: Obtain 8 original images. The image indices of the 8 original images are 0, 1, 2, ..., 7, and the position order of the description information corresponding to the 8 original images in the initial information group is 0, 1, 2, ..., 7, respectively. For example, Figure 6 As shown, Figure 6 This is a schematic diagram of another embodiment of information recombination provided in this application. The first description information corresponding to the 8 original images constitutes the initial information group src_image; the third description information of the target image corresponding to the 8 original images constitutes the initial information group dst_image; the second description information corresponding to the 8 original images constitutes the initial information group src_rect (initial); and the fourth description information corresponding to the 8 target images constitutes the initial information group dst_rect (initial).
[0114] Step 2: Assuming that images 1, 2, and 5 of the 8 original images meet the hardware processing requirements, while images 0, 3, 4, 6, and 7 do not, store the position order of the description information corresponding to images 1, 2, and 5 in the initial information group as the first index value in the container `img_proc_use_hw`. The three values stored in the `img_proc_use_hw` container are 1, 2, and 5. Also, store the position order of the description information corresponding to images 0, 3, 4, 6, and 7 in the initial information group as the second index value in the container `img_proc_use_cpu`. The five values stored in the `img_proc_use_cpu` container are 0, 3, 4, 6, and 7.
[0115] Step 3: As Figure 6 As shown, the first descriptive information is extracted from positions 1, 2, and 5 of the initial information group src_image and assigned sequentially to positions 0, 1, and 2 of the target information group src_imag. Then, the first descriptive information is extracted from positions 0, 3, 4, 6, and 7 of the initial information group src_image and assigned sequentially to positions 3, 4, 5, 6, and 7 of the target information group src_imag. This completes the information reorganization of the initial information group src_image.
[0116] Extract the corresponding third description information from positions 1, 2, and 5 of the initial information group dst_image, and assign them sequentially to positions 0, 1, and 2 of the target information group dst_imag. Then, extract the corresponding third description information from positions 0, 3, 4, 6, and 7 of the initial information group dst_image, and assign them sequentially to positions 3, 4, 5, 6, and 7 of the target information group dst_imag. This completes the information reorganization of the initial information group dst_image.
[0117] Extract the corresponding second description information from positions 1, 2, and 5 of the initial information group src_rect (initial), and assign them sequentially to positions 0, 1, and 2 of the target information group src_rect (target). Then, extract the corresponding second description information from positions 0, 3, 4, 6, and 7 of the initial information group src_rect (initial), and assign them sequentially to positions 3, 4, 5, 6, and 7 of the target information group src_rect (target). This completes the information reorganization of the initial information group src_rect (initial).
[0118] Extract the corresponding fourth description information from positions 1, 2, and 5 of the initial information group dst_rect (initial), and assign them sequentially to positions 0, 1, and 2 of the target information group dst_rect (target). Then, extract the corresponding fourth description information from positions 0, 3, 4, 6, and 7 of the initial information group dst_rect (initial), and assign them sequentially to positions 3, 4, 5, 6, and 7 of the target information group dst_rect (target). This completes the information reorganization of the initial information group dst_rect (initial).
[0119] Step 4: Send the target information group src_imag, target information group dst_imag, target information group src_rect(target), dst_rect(target), and the number of target images (4 here) to the hardware; and send the target information group src_imag, target information group dst_imag, target information group src_rect(target), dst_rect(target), the number of target images (4 here), and the number of other images (4 here) to the software.
[0120] Example 3 Step 1: Obtain 8 original images, with image indices of 0, 1, 2, ..., 7. The descriptive information corresponding to these 8 original images is also ordered in the initial information group as follows: The first descriptive information of the 8 original images constitutes the initial information group `src_image`; the third descriptive information of the target images constitutes the initial information group `dst_image`; the second descriptive information of the 8 original images constitutes the initial information group `src_rect` (initial); and the fourth descriptive information of the 8 target images constitutes the initial information group `dst_rect` (initial).
[0121] Step 2: Assuming that images 1, 3, 5, and 7 do not meet the hardware processing requirements, while images 0, 2, 4, and 6 do, store the description information corresponding to images 1, 3, 5, and 7 in the initial information group as the second index value in the `img_proc_use_cpu` container. The four values stored in the `img_proc_use_cpu` container are 1, 3, 5, and 7. Also, store the description information corresponding to images 0, 2, 4, and 6 in the initial information group as the first index value in the `img_proc_use_hw` container. The four values stored in the `img_proc_use_hw` container are 0, 2, 4, and 6.
[0122] Step 3: Extract the corresponding first description information from positions 1, 3, 5, and 7 of the initial information group src_image, and assign them sequentially to positions 0, 1, 2, and 3 of the target information group src_imag corresponding to the initial information group src_image. Then, extract the corresponding first description information from positions 0, 2, 4, and 6 of the initial information group src_image, and assign them sequentially to positions 4, 5, 6, and 7 of the target information group src_imag corresponding to the initial information group src_image. This completes the information reorganization of the initial information group src_image.
[0123] Extract the corresponding third description information from positions 1, 3, 5, and 7 of the initial information group dst_image, and assign them sequentially to positions 0, 1, 2, and 3 of the target information group dst_imag. Then, extract the corresponding third description information from positions 0, 2, 4, and 6 of the initial information group dst_image, and assign them sequentially to positions 4, 5, 6, and 7 of the target information group dst_imag. This completes the information reorganization of the initial information group dst_image.
[0124] Extract the corresponding second description information from positions 1, 3, 5, and 7 of the initial information group src_rect (initial), and assign them sequentially to positions 0, 1, 2, and 3 of the target information group src_rect (target). Then, extract the corresponding second description information from positions 0, 2, 4, and 6 of the initial information group src_rect (initial), and assign them sequentially to positions 4, 5, 6, and 7 of the target information group src_rect (target). This completes the information reorganization of the initial information group src_rect (initial).
[0125] Extract the corresponding fourth description information from positions 1, 3, 5, and 7 of the initial information group dst_rect (initial), and assign them sequentially to positions 0, 1, 2, and 3 of the target information group dst_rect (target). Then, extract the corresponding fourth description information from positions 0, 2, 4, and 6 of the initial information group dst_rect (initial), and assign them sequentially to positions 4, 5, 6, and 7 of the target information group dst_rect (target). This completes the information reorganization of the initial information group dst_rect (initial).
[0126] Step 4: Send the target information group src_imag, target information group dst_imag, target information group src_rect(target), dst_rect(target), and the number of target images (4 here) to the software; and send the target information group src_imag, target information group dst_imag, target information group src_rect(target), dst_rect(target), the number of target images (4 here), and the number of other images (4 here) to the hardware.
[0127] Please see Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the image batch processing apparatus provided in this application. The image batch processing apparatus 70 includes an acquisition module 71, a filtering module 72, and a processing module 73; the acquisition module 71 is used to acquire a plurality of original images; the filtering module 72 is used to filter at least one original image that meets the hardware processing requirements from the plurality of original images as a first image, and to use the remaining original images from the plurality of original images as second images; the processing module 73 is used to perform batch processing on each of the first images using hardware; and the processing module 73 is used to perform batch processing on each of the second images using software.
[0128] The filtering module 72 is used to filter at least one original image that meets the hardware processing requirements from a plurality of original images as the first image, including: for each original image, using the original image description information and the target image description information of the original image to determine whether the original image meets the hardware processing requirements; wherein the original image description information is used to describe the original image, and the target image description information is used to describe the target image obtained after processing the original image; in response to the original image meeting the hardware processing requirements, the original image is used as the first image.
[0129] The original image description information includes at least one of the following: first description information about the original image and second description information about the effective region in the original image. The first description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The second description information includes at least one of the following: width and height. The destination image description information includes at least one of the following: third description information about the destination image and fourth description information about the effective region in the destination image. The third description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The fourth description information includes at least one of the following: width and height.
[0130] The processing module 73 is used to perform batch processing on each first image using hardware, or batch processing on each second image using software, including: constructing several initial information groups using the descriptive information of each original image, wherein the descriptive information of each original image includes original image descriptive information and target image descriptive information, the original image descriptive information includes first descriptive information about the original image and second descriptive information about the effective area in the original image, the target image descriptive information includes third descriptive information about the target image obtained after processing the original image and fourth descriptive information about the effective area in the target image, an initial information group includes the same descriptive information for each original image, and the different descriptive information of an original image is arranged in the same order in each initial information group; reorganizing the information of each initial information group to obtain a target information group corresponding to each initial information group; wherein, in the target information group, the descriptive information of each original image that meets the hardware processing requirements is arranged in a continuous order, and / or the descriptive information of each original image that does not meet the hardware processing requirements is arranged in a continuous order, and the different descriptive information corresponding to an original image is arranged in the same order in the corresponding target information group.
[0131] The processing module 73 is used to reorganize the information of each initial information group to obtain the target information group corresponding to each initial information group. This includes: using the positional order of the descriptive information corresponding to each original image that meets the hardware processing requirements in the initial information group as the first index value of the descriptive information corresponding to each original image that meets the hardware processing requirements, and using each first index value to form a first index group; and using the positional order of the descriptive information corresponding to each original image that does not meet the hardware processing requirements in the initial information group as the second index value of the descriptive information corresponding to each original image that does not meet the hardware processing requirements, and using each second index value to form a second index group; and using the first index group and the second index group to reorganize the information of each initial information group to obtain the target information group corresponding to each initial information group. In the target information group, the positions of the descriptive information corresponding to the first index group are arranged continuously, and / or the positions of the descriptive information corresponding to the second index group are arranged continuously.
[0132] The initial information groups are stored in the corresponding first memory. The processing module 73 is used to reorganize the information of each initial information group using the first index group and the second index group to obtain the target information group corresponding to each initial information group. The process includes: for each initial information group, taking one index group as the target index group, extracting the description information corresponding to each index value in the target index group from the initial information group as the target description information; storing the target description information in the second memory; taking another index group as the new target index value, and re-executing the steps of extracting the description information corresponding to each index value in the target index group from the initial information group and the subsequent steps, wherein the target description information stored in the second memory each time is concatenated to form the target information group corresponding to the initial information group.
[0133] In the target information group, the position order of the target description information corresponding to the first index group is before the position order of the target description information corresponding to the second index group.
[0134] In response to the existence of original images that meet the hardware processing requirements and the existence of original images that do not meet the hardware processing requirements, information recombination is performed on each initial information group to obtain the target information group corresponding to each initial information group and its subsequent steps.
[0135] The processing module 73 is used to perform batch processing on each first image using hardware, or to perform batch processing on each second image using software. This includes sending the storage address and target quantity of each target information group to the image processing unit, so that the image processing unit acquires each target image and performs batch processing based on each target information group and the target quantity. Wherein, if the description information of a target image is located before the target information group and the description information of other images is located after the target information group, the target quantity includes the number of target images; if the description information of other images is located before the target information group and the description information of the target image is located after the target information group, the target quantity includes the number of target images and the number of other images. The image processing unit is hardware, and the target images are first images and the other images are second images; or the image processing unit is software, and the target images are second images and the other images are first images.
[0136] Please see Figure 8 , Figure 8 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 80 includes a memory 81 and a processor 82 coupled to each other. The processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-described image batch processing method embodiments. In a specific implementation scenario, the electronic device 80 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 80 may also include mobile devices such as laptops and tablets, which are not limited here.
[0137] Specifically, processor 82 controls itself and memory 81 to implement the steps of any of the above-described image batch processing method embodiments. Processor 82 can also be referred to as a CPU (Central Processing Unit). Processor 82 may be an integrated circuit chip with signal processing capabilities. Processor 82 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 82 can be implemented using integrated circuit chips.
[0138] Please see Figure 9 , Figure 9This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 90 of this application embodiment stores program instructions 91. When executed, these program instructions 91 implement the methods provided by any embodiment of the image batch processing method of this application and any non-conflicting combination thereof. The program instructions 91 can form a program file and be stored in the aforementioned computer-readable storage medium 90 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 90 includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0139] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0140] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for batch image processing, characterized in that, The method includes: Acquire several raw images; From the plurality of original images, at least one original image that meets the hardware processing requirements is selected as the first image, and the remaining original images from the plurality of original images are selected as the second image. The first images are processed in batches using hardware. Furthermore, the software is used to perform batch processing on each of the second images.
2. The method according to claim 1, characterized in that, The step of selecting at least one original image that meets the hardware processing requirements from the plurality of original images as the first image includes: For each of the original images, the original image description information and the destination image description information are used to determine whether the original image meets the hardware processing requirements; wherein, the original image description information is used to describe the original image, and the destination image description information is used to describe the destination image obtained after processing the original image; In response to the original image meeting the hardware processing requirements, the original image is used as the first image.
3. The method according to claim 2, characterized in that, The original image description information includes at least one of the following: first description information about the original image and second description information about the effective region in the original image. The first description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The second description information includes at least one of the following: width and height. The target image description information includes at least one of the following: third description information about the target image and fourth description information about the effective region in the target image. The third description information includes at least one of the following: color space, width, height, span, address alignment, and address range. The fourth description information includes at least one of the following: width and height.
4. The method according to claim 1, characterized in that, Before batch processing of each of the first images using hardware, or before batch processing of each of the second images using software, the method further includes: Several initial information groups are constructed using the descriptive information of each of the original images; wherein, the descriptive information of each original image includes original image description information and target image description information, the original image description information includes first descriptive information about the original image and second descriptive information about the effective region in the original image, the target image description information includes third descriptive information about the target image obtained after processing the original image and fourth descriptive information about the effective region in the target image, each initial information group includes the same type of descriptive information for each of the original images, and the different descriptive information of each original image is arranged in the same order in each initial information group; The initial information groups are reorganized to obtain target information groups corresponding to each initial information group; wherein, in the target information group, the descriptive information of each original image that meets the hardware processing requirements is arranged in a continuous manner, and / or the descriptive information of each original image that does not meet the hardware processing requirements is arranged in a continuous manner, and the different descriptive information corresponding to an original image is arranged in the same order in the corresponding target information group.
5. The method according to claim 4, characterized in that, The step of reorganizing the initial information groups to obtain the target information groups corresponding to each initial information group includes: The position order of the description information corresponding to each original image that meets the hardware processing requirements in the initial information group is used as the first index value of the description information corresponding to each original image that meets the hardware processing requirements, and the first index value is used to form a first index group. Furthermore, the position order of the description information corresponding to each original image that does not meet the hardware processing requirements in the initial information group is used as the second index value of the description information corresponding to each original image that does not meet the hardware processing requirements, and a second index group is formed using each of the second index values. Using the first index group and the second index group, information is reorganized from each initial information group to obtain a target information group corresponding to each initial information group. In the target information group, the positions of the description information corresponding to the first index group are arranged consecutively, and / or the positions of the description information corresponding to the second index group are arranged consecutively.
6. The method according to claim 5, characterized in that, The initial information groups are stored in corresponding first memory; the step of reorganizing the initial information groups using the first index group and the second index group to obtain the target information groups corresponding to each initial information group includes: For each of the initial information groups, an index group is taken as the target index group, and the description information corresponding to each index value in the target index group is extracted from the initial information group as the target description information; Store the target description information in the second memory; The other index group is used as the new target index value, and the steps of extracting the description information corresponding to each index value in the target index group from the initial information group and subsequent steps are executed again, wherein the target description information stored in the second memory each time is concatenated to form the target information group corresponding to the initial information group.
7. The method according to claim 6, characterized in that, In the target information group, the position order of the target description information corresponding to the first index group is before the position order of the target description information corresponding to the second index group.
8. The method according to claim 4, characterized in that, The method further includes: In response to the existence of an original image that meets the hardware processing requirements and the existence of an original image that does not meet the hardware processing requirements, the information recombination of each of the initial information groups is performed to obtain the target information group corresponding to each of the initial information groups and subsequent steps.
9. The method according to claim 4, characterized in that, The step of batch processing each of the first images using hardware, or the step of batch processing each of the second images using software, includes: The storage address and target quantity of each target information group are sent to the image processing unit, so that the image processing unit can acquire each target image and perform batch processing based on each target information group and the target quantity; wherein, when the description information of the target image is located before the target information group and the description information of other images is located after the target information group, the target quantity includes the number of target images; when the description information of other images is located before the target information group and the description information of the target image is located after the target information group, the target quantity includes the number of target images and the number of other images; the image processing unit is the hardware and the target image is the first image and the other images are the second image, or the image processing unit is the software and the target image is the second image and the other images are the first image.
10. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory being used to store program instructions, and the processor being used to execute the program instructions to implement the image batch processing method as described in any one of claims 1-9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed to implement the image batch processing method as described in any one of claims 1-9.