WO2022021695A1 - 图像处理方法、用于图像处理的指令的生成方法及装置 - Google Patents
图像处理方法、用于图像处理的指令的生成方法及装置 Download PDFInfo
- Publication number
- WO2022021695A1 WO2022021695A1 PCT/CN2020/131057 CN2020131057W WO2022021695A1 WO 2022021695 A1 WO2022021695 A1 WO 2022021695A1 CN 2020131057 W CN2020131057 W CN 2020131057W WO 2022021695 A1 WO2022021695 A1 WO 2022021695A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- size
- split
- roi
- splitting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/2163—Partitioning the feature space
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
- G06T7/74—Determining position or orientation of objects or cameras using feature-based methods involving reference images or patches
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/32—Normalisation of the pattern dimensions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20016—Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20021—Dividing image into blocks, subimages or windows
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
Definitions
- the present disclosure relates to the technical field of image processing, and in particular, to an image processing method, a method and apparatus for generating instructions for image processing.
- a region of interest (ROI) image for a specific task will be generated, and then the ROI image can be scaled by the image scaling module, and the scaled image is obtained.
- the image is input to the image processing model for processing.
- the image scaling module does not perform scaling processing for some ROI images, but only outputs an error prompt, which will cause the subsequent processes involved in the visual image processing technology to fail to execute normally.
- Embodiments of the present disclosure provide an image processing method, a method and apparatus for generating an instruction for image processing.
- an image processing method including:
- the plurality of scaled image blocks are sequentially input to the image processing model.
- a method for generating an instruction for image processing including:
- the hardware output size of the image scaling module does not match the first image size supported by the image processing model, based on the hardware output size and the first image size, determine whether to use the template image with the first image size
- the splitting mode information is used to split the template image into multiple image blocks, and the image size of each image block in the multiple image blocks is the same as that of the The hardware output size matches;
- an instruction for image processing is generated, and the instruction for image processing is used to execute the above-mentioned image processing method.
- an image processing apparatus including:
- a splitting module is used to split to obtain a plurality of image blocks based on the first image size supported by the image processing model, the first split data, and the obtained ROI image when the ROI image of the region of interest is obtained;
- Each of the multiple image sizes obtained by splitting the first image size based on the first split data matches the hardware output size of the image scaling module;
- an image scaling module for performing image scaling on each of the multiple image blocks obtained by the splitting module, respectively, to obtain multiple scaling image blocks;
- the multiple scaling image blocks The multiple image sizes of , and the multiple image sizes obtained by splitting the first image size based on the first split data are consistent in one-to-one correspondence;
- the input module is used for sequentially inputting the plurality of scaled image blocks obtained by the image scaling module to the image processing model.
- an apparatus for generating an instruction for image processing including:
- a determining module configured to determine a pair with the first image size based on the hardware output size and the first image size in the case that the hardware output size of the image scaling module does not match the first image size supported by the image processing model
- the splitting mode information of the template image of the image size; the splitting mode information is used to split the template image into multiple image blocks, and the image of each image block in the multiple image blocks
- the dimensions all match the hardware output dimensions
- an acquisition module configured to acquire first split data based on the split mode information determined by the determination module
- a generating module configured to generate an instruction for image processing based on the first split data obtained by the acquiring module, where the instruction for image processing is used to execute the above image processing method.
- a computer-readable storage medium stores a computer program, and the computer program is used for executing the above image processing method, or for executing the above image processing method. command generation method.
- an electronic device comprising:
- a memory for storing the processor-executable instructions
- the processor is configured to read the executable instructions from the memory and execute the instructions to implement the above-mentioned image processing method, or to execute the above-mentioned method for generating instructions for image processing.
- an instruction for image processing can be obtained based on the first method supported by the image processing model when the ROI image is obtained.
- the image size, the first split data, and the obtained ROI image are split to obtain a plurality of image blocks.
- image scaling may be performed on each of the plurality of image blocks to obtain a plurality of scaled image blocks.
- each scaled image block matches the hardware output size, and each scaled image block can be normally output from the image scaling module, and then multiple scaled image blocks can be normally input to the image processing model in sequence .
- FIG. 1 is a general schematic diagram of an embodiment of the present disclosure.
- FIG. 2 is a schematic flowchart of an image processing method provided by an exemplary embodiment of the present disclosure.
- FIG. 3 is a schematic diagram of a disassembly of a running phase in an embodiment of the present disclosure.
- FIG. 4 is a schematic flowchart of an image processing method provided by another exemplary embodiment of the present disclosure.
- FIG. 5A is a working flowchart of a system for implementing a visual image processing technology in the related art.
- FIG. 5B is a work flow diagram of a system for implementing visual image processing techniques in an embodiment of the present disclosure.
- FIG. 6 is a schematic flowchart of a method for generating an instruction for image processing provided by an exemplary embodiment of the present disclosure.
- FIG. 7 is a schematic flowchart of a method for generating an instruction for image processing provided by another exemplary embodiment of the present disclosure.
- FIG 8 is another general schematic diagram of an embodiment of the present disclosure.
- FIG. 9 is a schematic structural diagram of an image processing apparatus provided by an exemplary embodiment of the present disclosure.
- FIG. 10 is a schematic structural diagram of an image processing apparatus provided by another exemplary embodiment of the present disclosure.
- FIG. 11 is a schematic structural diagram of an apparatus for generating an instruction for image processing provided by an exemplary embodiment of the present disclosure.
- FIG. 12 is a schematic structural diagram of an apparatus for generating an instruction for image processing provided by another exemplary embodiment of the present disclosure.
- FIG. 13 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure.
- Embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with numerous other general-purpose or special-purpose computing system environments or configurations.
- Examples of well-known terminal equipment, computing systems, environments and/or configurations suitable for use with terminal equipment, computer systems, servers, etc. electronic equipment include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients computer, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the foregoing, among others.
- Electronic devices such as terminal devices, computer systems, servers, etc., may be described in the general context of computer system-executable instructions, such as program modules, being executed by the computer system.
- program modules may include routines, programs, object programs, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types.
- Computer systems/servers may be implemented in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network.
- program modules may be located on local or remote computing system storage media including storage devices.
- the visual image processing technology can be implemented by an artificial intelligence (Artificial Intelligence, AI) visual image processing system, and the operations performed by the system can include: image acquisition, image signal processing (Image Signal Processing, ISP), image pyramid generation, full image detection, ROI processing, post-processing, output results, etc.
- AI Artificial Intelligence
- ROI images for specific tasks will be generated, such as ROI images for face detection tasks (which are the face images detected from the full map), ROI images for pedestrian detection tasks, etc.
- the ROI image generated by the whole image detection needs to be provided to the image processing model, so that the ROI processing is performed by the image processing model; wherein, the image processing model may be a convolutional neural network model.
- the image processing model Since the ROI image generated by the full-image detection is generated when the system is running, there is no way to predict the position and size in advance, and due to the setting of the model designer, the image processing model generally has requirements for the input image.
- the input image has size requirements, therefore, it is necessary to scale the ROI image generated by full-image detection to the same size.
- the scaling of the ROI image may be implemented by a hardware module, which may be called an image scaling module or a Resizer module.
- the input size of the image scaling module is the size of the ROI image generated by full-image detection
- the output size of the image scaling module is consistent with the size of the input image required by the image processing model.
- the embodiments of the present disclosure may mainly include two stages, namely, a compilation stage and a running stage; wherein, in the compilation stage, the method for generating instructions for image processing provided by the embodiments of the present disclosure may be executed. , to generate instructions for executing the image processing methods provided by the embodiments of the present disclosure; in the running phase, for any ROI image obtained through full-image detection, the instructions generated in the compilation phase can be executed based on the instructions provided by the embodiments of the present disclosure.
- the image processing method is used to solve the problem that the subsequent processes involved in the visual image processing technology cannot be executed normally due to the limited output of the image scaling module.
- FIG. 2 is a schematic flowchart of an image processing method provided by an exemplary embodiment of the present disclosure.
- the method shown in FIG. 2 includes step 201 , step 202 and step 203 , and each step will be described below.
- Step 201 under the situation of obtaining the ROI image, based on the first image size supported by the image processing model, the first split data, and the obtained ROI image, split to obtain a plurality of image blocks; the first image size is based on the first image block.
- the multiple image sizes obtained by splitting the split data matches the hardware output size of the image scaling module.
- the ROI image may be obtained through full-image detection first. Specifically, the entire image shown in the left part in FIG. 3 can be detected to obtain an image with a height dimension h in FIG. 3 .
- the first image size supported by the image processing model and the first split data determined in the compilation stage can be obtained.
- the first image size is based on the multiple image sizes obtained by splitting the first split data. Each image size in matches the hardware output size of the image scaling module.
- the first image size supported by the image processing model can represent the size requirements of the image processing model for the input image, and the first image size supported by the image processing model can be 244 ⁇ 244;
- the hardware output size of the image scaling module can be Indicates the maximum image size that the image scaling module can output.
- the hardware output size of the image scaling module can be 128 ⁇ 72; any image size that matches the hardware output size of the image scaling module can mean that the image size is smaller than the image scaling module’s hardware output size.
- the hardware output size for example, the hardware output size of the image scaling module is 128 ⁇ 72, and the image size is 76 ⁇ 76.
- the first image size is the image size of the image whose height size is H as shown in the right part of FIG. 3
- the first split data can be used to split the first image size into 6 image sizes , are the image size of ROI 0 '', the image size of ROI 1 '', the image size of ROI 2 '', the image size of ROI 3 '', the image size of ROI 4 '', the image size of ROI 5 '', the image size of ROI 5 '' .
- the hardware output size of the image scaling module is 128 ⁇ 72
- the image sizes from ROI 0 '' to ROI 5 '' need to be smaller than 128 ⁇ 72.
- the splitting object and how to split the splitting object can be determined based on the first image size, the first splitting data, and the obtained ROI image, and according to the This does the actual splitting, resulting in multiple image blocks. If the multiple image sizes obtained by splitting the first image size based on the first split data are N image sizes, the multiple image blocks obtained through actual splitting may be N image blocks, N image sizes There can be one-to-one correspondence with N image blocks.
- Step 202 carry out image scaling to each image block in a plurality of image blocks respectively, to obtain a plurality of scaled image blocks; a plurality of image sizes of a plurality of scaled image blocks, and the first image size is based on the first
- the sizes of multiple images obtained by splitting the data are consistent in one-to-one correspondence.
- the image scaling module can be called to perform image scaling on each image block in the plurality of image blocks, and the image size of the scaled image block obtained after scaling any image block needs to be ensured , and among the plurality of image sizes obtained by splitting the first image size based on the first split data, the image size corresponding to the image block is consistent.
- the first split data is used to split the first image size into 6 image sizes, and the 6 image sizes are respectively the image sizes from ROI 0 '' to ROI 5 '', in step 201
- the multiple image blocks obtained by splitting are ROI 00 ' ⁇ ' to ROI0 5 ''.
- ROI 00 '' can be scaled to the image size of ROI 0 ''
- ROI 01 '' can be scaled to ROI 1 '' image size
- scale ROI 02 '' to the image size of ROI 2 ''
- scale ROI 03 '' to the image size of ROI 3 ''
- scale ROI 04 '' to the image size of ROI 4 '' size
- scale ROI 05 '' to the image size of ROI 5 '' to get the corresponding scaled image blocks from ROI 00 '' to ROI0 5 '', so that a total of 6 scaled image blocks can be obtained.
- Step 203 sequentially inputting a plurality of scaled image blocks into the image processing model.
- a plurality of scaled image blocks can be sequentially input into the image processing model, so that the image processing model can process each scaled image block, such as face detection processing or pedestrian detection processing, etc., to The processing result of each scaled image block is obtained, and the processing result of each scaled image block can form a final processing result. Since the multiple image sizes of the multiple zoomed image blocks and the multiple image sizes obtained by splitting the first image size based on the first split data are consistent in one-to-one correspondence, the final processing result is equivalent to the image processing model pair The result obtained after processing an image of a first image size, the final processing result can then be used for other processes involved in the visual image processing technology.
- a plurality of image blocks may be obtained by splitting based on the first image size supported by the image processing model, the first split data, and the obtained ROI image. Afterwards, image scaling may be performed on each of the plurality of image blocks to obtain a plurality of scaled image blocks. Since the multiple image sizes of the multiple scaled image blocks and the multiple image sizes obtained by splitting the first image size based on the first split data are consistent in one-to-one correspondence, then, the multiple scaled image blocks in the The image size of each scaled image block matches the hardware output size, and each scaled image block can be normally output from the image scaling module, and then multiple scaled image blocks can be normally input to the image processing model in sequence .
- step 201 includes step 2011 , step 2022 and step 2023 .
- Step 2011 in the case that the obtained ROI image satisfies the specified image alignment condition, the obtained ROI image is used as the ROI image to be split; otherwise, image adjustment is performed based on the obtained ROI image to obtain the specified image alignment condition.
- the ROI image to be split in the case that the obtained ROI image satisfies the specified image alignment condition, the obtained ROI image is used as the ROI image to be split; otherwise, image adjustment is performed based on the obtained ROI image to obtain the specified image alignment condition.
- the ROI image to be split in the case that the obtained ROI image satisfies the specified image alignment condition, the obtained ROI image is used as the ROI image to be split; otherwise, image adjustment is performed based on the obtained ROI image to obtain the specified image alignment condition.
- the ROI image to be split in the case that the obtained ROI image satisfies the specified image alignment condition, the obtained ROI image is used as the ROI image to be split; otherwise, image adjustment is performed based on the obtained ROI image to obtain the specified image alignment condition.
- the ROI image to be split in the case that
- the ROI image After the ROI image is obtained, it can be determined whether the obtained ROI image satisfies the specified image alignment condition, and the specific determination method is described below with an example.
- the method further includes:
- the first target value is determined based on the divisor of the value of the size of the preset direction specified by the image scaling module, and the value of the size of the preset direction in the first image size;
- the first target value may be a value determined in the compilation stage based on the divisor of the size of the preset direction specified by the image scaling module, and the value of the size of the preset direction in the first image size,
- This value is used to represent a user alignment requirement (for convenience of distinction, it will be referred to as the first user alignment requirement hereinafter, and the first user alignment requirement may be considered as a size alignment requirement), and here, the user alignment may also be referred to as user_alignment.
- the specific determination process of the first target value please refer to the description of the corresponding part of the compilation stage below, and will not be expanded here.
- the preset direction may include at least one of the width direction and the height direction. Since the operation and processing procedures for the width direction and the height direction may be similar, in the embodiments of the present disclosure, only the preset direction is the height direction. Taking an example to illustrate, at this time, the size of the preset direction is specifically the height size.
- a runtime application program interface (Runtime Application Programming Interface, Runtime API) can be called to obtain the first target value determined in the compilation stage, and it is judged whether the height dimension of the obtained ROI image is equal to the first target value. Integer multiples to obtain the first judgment result. If the first judgment result indicates that the height size of the obtained ROI image is an integer multiple of the first target value, it can be considered that the obtained ROI image meets the first user alignment requirement, and the obtained ROI image can be If it is correctly split, it can be determined that the obtained ROI image satisfies the specified image alignment condition; otherwise, it can be determined that the obtained ROI image does not meet the specified image alignment condition.
- Runtime API Runtime Application Programming Interface
- the method further includes:
- the coordinate attribute specified by the image scaling module may represent another user alignment requirement (for convenience of distinction, it is hereinafter referred to as the second user alignment requirement, and the second user alignment requirement may be regarded as a coordinate alignment requirement).
- the coordinate attribute specified by the image scaling module may be: the coordinate of the preset position is an even number; wherein, the preset position may be the upper left corner position, the upper right corner position or other positions.
- the second judgment result indicates that the coordinates of the preset position have the coordinate attribute specified by the image scaling module, it can be considered that the obtained ROI image satisfies the second user alignment requirement, and the obtained ROI image can be normally processed by the image scaling module, so it can be determined The obtained ROI image satisfies the specified image alignment condition; otherwise, it can be determined that the obtained ROI image does not meet the specified image alignment condition.
- the above two implementations of determining whether the obtained ROI image meets the specified image alignment conditions can also be combined with each other.
- the height dimension of the obtained ROI image can be an integer multiple of the first target value
- the obtained ROI image can be directly used as the ROI image to be split; if the determination result is no, the obtained ROI image can be On this basis, image adjustment is performed to obtain the ROI image to be split that satisfies the specified image alignment conditions.
- a new ROI image can be taken on the whole image as the image to be split according to the position of the obtained ROI image on the whole image, or the obtained ROI image can be slightly cropped, The cropped ROI image is used as the ROI image to be split.
- Step 2012 Determine second split data based on the first image size, the first split data, and the second image size of the ROI image to be split.
- step 2012 includes:
- the second split data is determined based on each split position in the preset direction of the ROI image to be split.
- the first split data may include coordinate information of each split position in the height direction; and/or, the first split data may include the proportional relationship of each size segment split in the height direction (for example, 3:3 : 2, 3: 4: 3, etc.). In this way, based on the first split data, each split position in the height direction of the template image having the first image size can be located conveniently and reliably.
- the proportional relationship between the height size of the ROI image to be split and the height size in the first image size can also be determined. Assuming that the ROI image to be split is the image shown in the left part of FIG. 3, the height size is h, the template image with the first image size is the image shown in the right part in FIG. 3, the height size is H, then determine The resulting proportional relationship is h/H.
- each splitting position in the height direction of the template image and the proportional relationship between the height size of the ROI image to be split and the height size in the first image size are determined, the Each splitting position in the height direction is mapped to the ROI image to be split, so as to obtain each mapping position in the height direction of the ROI image to be split, and each obtained mapping position can be used as the ROI image to be split.
- a split position in the height direction is mapped to the ROI image to be split, so as to obtain each mapping position in the height direction of the ROI image to be split, and each obtained mapping position can be used as the ROI image to be split.
- position P11 can be mapped to the ROI image to be split, and the corresponding mapping position It can be the position P21, and the position P12 can also be mapped to the ROI image to be split, and the corresponding mapping position can be the position P22.
- the second split data can be determined accordingly.
- the second split data may include the split position coordinate information of each split position in the height direction of the ROI image to be split; and/or, the second split data may be included in the ROI image to be split.
- the proportional relationship of each size segment split in the height direction such as h 1 : h 2 : h-h 1 -h 2 .
- the split position on the template image with the first image size can be accurately and reliably located, and then combined with the proportional relationship between the ROI image to be split and the first image size, The split position on the ROI image to be split can be accurately and reliably located, so as to obtain the second split data accordingly.
- Step 2013, according to the second split data, split the ROI image to be split to obtain a plurality of image blocks.
- each split position in the height direction of the ROI image to be split is closely related to the second split data, according to the second split data, it can be split at each split position in the height direction, In a similar manner, it is also possible to perform splitting in the width direction, so as to obtain multiple image blocks based on the splitting in the height direction and the width direction.
- a to-be-split ROI image that satisfies the specified image alignment condition can be obtained, and then the second split data for indicating how to split can be determined, and then the second split data can be determined according to the second split data.
- the workflow of the AI visual image processing system can be as follows: image acquisition, ISP, image pyramid generation and full image detection are sequentially performed to generate ROI images for specific tasks. ; Next, before providing the ROI image generated by the full-image detection to the image scaling module, first predict whether the ROI image generated by the full-image detection is scaled by the image scaling module, whether the obtained zoomed image (assuming it is represented as ROI') is not If the limit is met, the ROI image generated by the full-image detection will be sent to the image scaling module to perform the scaling operation to obtain the ROI', and the image processing model will process the ROI', and then the post-processing and output results will also be performed.
- the workflow of the AI visual image processing system may be somewhat different, specifically: if the predicted ROI' does not meet the limit, an alignment process (with meet the above-mentioned user alignment requirements) and split processing (for example, split into several parts of the size that the image scaling module can output), in this way, the embodiments of the present disclosure can ensure visual image processing when the output of the image scaling module is limited. The normal execution of subsequent processes involved in the technology.
- any of the image processing methods provided by the embodiments of the present disclosure may be executed by any appropriate device with data processing capabilities, including but not limited to: terminal devices and servers.
- any of the image processing methods provided by the embodiments of the present disclosure may be executed by a processor, for example, the processor executes any of the image processing methods mentioned in the embodiments of the present disclosure by invoking corresponding instructions stored in the memory. No further description will be given below.
- FIG. 6 is a schematic flowchart of a method for generating an instruction for image processing provided by an exemplary embodiment of the present disclosure.
- the method shown in FIG. 6 includes step 601 , step 602 and step 603 , and each step will be described separately below.
- Step 601 in the case where the hardware output size of the image scaling module does not match the first image size supported by the image processing model, based on the hardware output size and the first image size, determine the splitting of the template image with the first image size Mode information; the split mode information is used to split the template image into multiple image blocks, and the image size of each image block in the multiple image blocks matches the hardware output size.
- the hardware output size of the image scaling module can represent the maximum image size that the image scaling module can output;
- the first image size supported by the image processing model can represent the size requirement of the image processing model for the input image;
- the mismatch between the hardware output size and the first image size supported by the image processing model may mean that the hardware output size of the image scaling module is smaller than the first image size supported by the image processing model, for example, the hardware output size of the image scaling module is 128 ⁇ 72 , and the first image size supported by the image processing model is 244 ⁇ 244; any image size matching the hardware output size of the image scaling module may mean that the image size is smaller than the hardware output size of the image scaling module.
- the hardware output size of the image scaling module does not match the first image size supported by the image processing model, it may be determined, based on the hardware output size and the first image size, how to adjust the template image of the first image size (for example, in FIG. 3 ).
- the image shown in the right part, the height size is H) is split, and it can be guaranteed that the image size of each image block in the multiple image blocks obtained by splitting all matches the hardware output size of the image scaling module, Thereby, the corresponding splitting method information is obtained.
- the splitting method information may include each splitting position coordinate information in the width direction and each splitting position coordinate information in the height direction; and/or, the splitting method information may include splitting in the width direction.
- the split method information in addition to referring to the hardware output size of the image scaling module and the first image size supported by the image processing model, other factors can also be referred to, such as referring to the specific instruction type of the template image, The storage location of the template image in memory, the allocation and management rules of the compiler at runtime, etc.
- Step 602 Obtain first split data based on the split method information.
- the data including all the information in the splitting method information can be directly used as the first splitting data; or, part of the information can be extracted from the splitting method information, and the data including the extracted partial information can be taken as the first splitting data
- the splitting method information includes both the splitting position coordinate information and the proportional relationship of the size segment
- the splitting position coordinate information can be extracted from the splitting method information, and the extracted splitting position coordinate information can be included.
- the data of the position coordinate information is used as the first split data.
- Step 603 based on the first split data, generate an instruction for image processing, and the instruction for image processing is used to execute an image processing method (specifically, the image processing method disclosed in the above embodiment).
- steps 601 to 603 may all be executed by a compiler.
- the hardware output size of the image scaling module in the case where the hardware output size of the image scaling module does not match the first image size supported by the image processing model, it may be determined based on the hardware output size and the first image size for the image scaling module with the first image size.
- first splitting data is obtained based on the splitting method information, and then, based on the first splitting data, an instruction for image processing can be generated, and the instruction can be used to execute the above image processing method.
- the first split data can be utilized, and the image splitting operation and the image scaling operation can be combined to ensure the normal execution of the subsequent processes involved in the visual image processing technology.
- step 601 includes step 6011 , step 6012 and step 6013 .
- Step 6011 when the image scaling module specifies the divisor of the size of the preset direction, calculate a first product; the first product is the product of the divisor and the numerical value of the size in the preset direction in the first image size.
- the preset direction may include at least one of the width direction and the height direction. Since the operation and processing procedures for the width direction and the height direction may be similar, in the embodiments of the present disclosure, only the preset direction is the height direction. Taking an example to illustrate, at this time, the size of the preset direction is specifically the height size.
- the divisor of the height size specified by the image scaling module can be represented by c
- the value of the first image size can be represented by H in FIG. 3
- the first product can be represented as cH; where c can be considered as the image scaling module hardware alignment requirements.
- Step 6012 based on the first product, determine each split position on the template image with the first image size.
- Step 6012 including:
- the first target value and the second target value are determined; the product of the first target value and the second target value and the first product satisfy a preset relationship;
- the method also includes:
- any product and the first product satisfy the preset relationship may mean that any product is equal to the first product.
- the first target data can be recorded, so that the recorded first target value can be obtained during the running phase, so that the first target value can be obtained based on the first target product.
- the target data is used to determine the specified image alignment conditions.
- each splitting position on the template image with the first image size can be determined based on the second target value, and it is necessary to ensure that each splitting position divided by the determined splitting positions in the height direction of the template image is determined.
- the values of the size of the size segment are all integer multiples of the second target value. For example, for FIG. 3 , it is necessary to ensure that H 1 , H 2 , and H-H 1 -H 2 are all integer multiples of the second target value.
- the image scaling module proportionally scales the image with the height size h as shown in the left part.
- A can be considered as the size alignment value of the compiler split point (which corresponds to the split position), and a can be considered as the ROI image provided to the image scaling module (for example, the ROI image to be split above)
- a can be considered as the ROI image provided to the image scaling module (for example, the ROI image to be split above)
- a can be used as the first target numerical value, and A can be used as the second target numerical value, to ensure that in the running phase, the ROI image to be split can be correctly split, and each image block obtained by splitting can meet the size.
- Alignment requirements that is, the height size of each image block obtained by splitting is an integer multiple of a which is the first target value.
- Step 6013 Determine, based on each of the determined splitting positions, information on the splitting manner of the template image having the first image size.
- each splitting position is determined, the corresponding splitting position coordinate information can be obtained, so as to obtain the splitting method information including the obtained splitting position coordinate information.
- the proportional relationship of each size segment can also be obtained, so as to obtain Including information on the splitting method of the obtained proportional relationship.
- the image scaling module when the image scaling module specifies the divisor of the size of the preset direction, the calculation of the first product (ie, cH in the above) can be performed, and the first product is used as guiding information , and determine the appropriate first target value and second target value to ensure that image splitting can be performed correctly in the running phase, and that the splitting result meets the size alignment requirements.
- the first product ie, cH in the above
- determining the first target value and the second target value based on the first product includes:
- each reference parameter group in the at least one reference parameter group includes two values, and the product of the two values in any reference parameter group and the first product satisfies a predetermined establish relationship;
- One value in the first reference parameter group is taken as the first target value, and another value in the first reference parameter group is taken as the second target value.
- At least one reference parameter group may be determined first, each reference parameter group includes two values, and the product of the two values in any reference parameter group is equal to the first product.
- the at least one reference parameter group may be obtained by factoring the first product.
- a first reference parameter group may be selected from at least one reference parameter group.
- one reference parameter group may be selected from at least one reference parameter group as the first reference parameter group according to the setting rule, and at this time, the first reference parameter group selected from the at least one reference parameter group may include:
- the reference parameter group with the smallest corresponding total alignment cost is selected as the first reference parameter group.
- the total alignment cost value of each reference parameter group may be calculated separately, and the total alignment cost value may include the alignment cost value of the compiler and the alignment cost value of the user.
- the reference parameter group with the smallest corresponding total alignment cost value can be filtered out, and then the filtered reference parameter group can be used as the first reference parameter group.
- the cost can be minimized under the condition that both the compiler and the user meet the corresponding alignment requirements.
- one reference parameter group may be randomly selected from at least one reference parameter group as the first reference parameter group.
- the first target value and the second target value can be conveniently determined. Since the first reference parameter group is selected from at least one reference parameter group, and at least one reference parameter group is determined based on the product, it can ensure that both the compiler and the user meet the corresponding alignment requirements.
- the total alignment cost value of each reference parameter group in the at least one reference parameter group is calculated separately, including:
- the larger value of the two values included in the reference parameter group may be determined first; then, you can Using A', determine each split position in the height direction of the template image.
- the value of the size of each size segment divided by the determined split positions is Integer multiple of A'; after that, the alignment cost value of each split position in the height direction of the template image can be calculated.
- the alignment cost value of each split position is calculated, including:
- the remainder result and the difference are weighted and summed to obtain the alignment cost value of any split position.
- the preset value may be 1, 2, 3 or other values, and the preset adjustment factor may be expressed as p.
- any reference parameter group as the reference parameter group S, and the larger value of the two values included in any reference parameter group is A' as an example, assuming that the height direction of the template image determined by A', In the coordinates of a split position, the coordinate in the height direction is represented as y, then the remainder result of y and A' can be calculated, and the remainder result can be represented as roi.y%A'.
- the ratio of the first product cH to A' can also be calculated, and the difference between the ratio and the preset value (assuming it is 1) can be calculated, and the difference can be expressed as After that, based on the preset adjustment factor p, the remainder result roi.y%A' and the difference Perform weighted summation, specifically, in the weighted summation, p can be used as the weight of the remainder result roi.y%A', and p-1 can be used as the difference to obtain the alignment cost value of a split position, the alignment cost value of the split position can be expressed as f(A′), and the alignment cost value of the split position can be calculated using the following cost function:
- the operand before "+” is the alignment cost value of the compiler
- the operand after "+” is the user's alignment cost value in the theoretical worst case.
- the alignment cost value of each split position in the G split positions can be calculated according to the above method, so as to obtain G split positions.
- the sum of the G alignment cost values can be calculated, and the sum can be used as the total alignment cost value of the reference parameter group S. It should be pointed out that the total alignment cost value of each reference parameter group can be compared later. If the total alignment cost value of the reference parameter group S is the smallest, the reference parameter group S can be used as the first reference parameter group.
- A' can be used as the second target value or A in the above, Can be used as the second target value or a above.
- the total alignment cost value of each reference parameter group can be obtained conveniently and reliably, thereby facilitating the determination of a reasonable first target value and a second target value.
- the first image size supported by the image processing model is 66 ⁇ 68, that is, the width size is 66 and the height size is 68.
- the image scaling module requires that the upper left corner coordinate, height size and width size of the input image are all If the number is even, when splitting, the size alignment value A of the compiler split point and the size alignment value a of the ROI image provided to the image scaling module should satisfy:
- A may be specifically 4, that is, the compiler satisfies 4 alignment, and the user satisfies 33 alignment.
- the alignment requirements that the image scaling module needs to meet (for example, the upper left corner coordinates, the requirement that the height and width dimensions are even numbers, etc.)
- the hardware output size and the first image size supported by the image processing model are provided to the compiler, and the compiler calculates the alignment A that the compiler needs to meet, and calculates the alignment a that the user needs to meet, records a, and performs the first image size.
- the user can obtain a through the Runtime API, and then perform the corresponding alignment processing to obtain the ROI image to be split and perform subsequent processing, so as to ensure the correct and effective splitting of the ROI image to be split.
- the compiler can calculate how to meet the hardware constraints at a small cost by analyzing the hardware constraints of the image scaling module and the input requirements of the image processing model; the compiler can also give According to the split and alignment strategy, reasonable splitting and alignment can be carried out to ensure that the entire AI visual image processing system can operate correctly and efficiently when the hardware resources of the image scaling module are limited, so as to better ensure the user's Use experience.
- Any method for generating an instruction for image processing provided by the embodiments of the present disclosure may be executed by any appropriate device with data processing capabilities, including but not limited to: terminal devices and servers.
- any method for generating an instruction for image processing provided by the embodiments of the present disclosure may be executed by a processor, for example, the processor executes any one of the methods mentioned in the embodiments of the present disclosure by invoking corresponding instructions stored in the memory.
- a method of generating instructions for image processing No further description will be given below.
- FIG. 9 is a schematic structural diagram of an image processing apparatus provided by an exemplary embodiment of the present disclosure.
- the apparatus shown in FIG. 9 includes a splitting module 901 , an image scaling module 902 , and an input module 903 .
- the splitting module 901 is used to split and obtain a plurality of image blocks based on the first image size supported by the image processing model, the first split data, and the obtained ROI image when the ROI image is obtained; the first Each image size in the multiple image sizes obtained by splitting the image size based on the first split data matches the hardware output size of the image scaling module 902;
- the image scaling module 902 is used to perform image scaling on each image block in the multiple image blocks obtained by the splitting module 901 respectively, to obtain multiple scaled image blocks; multiple images of the multiple scaled image blocks size, and the multiple image sizes obtained by splitting the first image size based on the first split data are consistent in a one-to-one correspondence;
- the input module 903 is used for sequentially inputting the multiple scaled image blocks obtained by the image scaling module 902 into the image processing model.
- the splitting module 901 includes:
- the first acquisition sub-module 9011 is used to use the obtained ROI image as the ROI image to be split under the condition that the obtained ROI image satisfies the specified image alignment condition; otherwise, perform image adjustment based on the obtained ROI image to Obtain the ROI image to be split that satisfies the specified image alignment condition;
- the determination submodule 9012 is used to determine the second split data based on the first image size, the first split data, and the second image size of the ROI image to be split obtained by the first acquisition submodule 9011;
- the second acquisition sub-module 9013 is configured to split the ROI image to be split obtained by the first acquisition sub-module 9011 according to the second split data determined by the determination sub-module 9012 to obtain a plurality of image blocks.
- the determination sub-module 9012 includes:
- a first determining unit for determining, based on the first splitting data, each splitting position in a preset direction of the template image having the first image size
- a second determining unit configured to determine the size of the preset direction in the second image size of the ROI image to be split, and the proportional relationship of the size of the preset direction in the first image size
- the third determination unit is configured to determine, based on the proportional relationship determined by the second determination unit and each split position in the preset direction of the template image determined by the first determination unit, the preset direction of the ROI image to be split each split position;
- the fourth determination unit is configured to determine the second split data based on each split position in the preset direction of the ROI image to be split determined by the third determination unit.
- the device also includes:
- the first acquisition module 904 is used to acquire the first target value; the first target value is based on the divisor of the value of the size of the preset direction specified by the image scaling module 902, and the value of the size of the preset direction in the first image size Sure;
- the second obtaining module 905 is used to judge whether the value of the size of the obtained ROI image in the preset direction is an integer multiple of the first target value obtained by the first obtaining module 904, so as to obtain the first judgment result;
- the first determining module 906 is configured to determine whether the obtained ROI image satisfies the specified image alignment condition based on the first judgment result obtained by the second obtaining module 905;
- the device also includes:
- the third obtaining module 907 is used for obtaining the coordinates of the preset position on the obtained ROI image
- the fourth obtaining module 908 is used to judge whether the coordinates of the preset position obtained by the third obtaining module 907 have the coordinate attribute specified by the image scaling module 902, so as to obtain the second judgment result;
- the second determining module 909 is configured to determine whether the obtained ROI image satisfies the specified image alignment condition based on the second judgment result obtained by the fourth obtaining module 908 .
- FIG. 11 is a schematic structural diagram of an apparatus for generating an instruction for image processing provided by an exemplary embodiment of the present disclosure.
- the apparatus shown in FIG. 11 includes a determination module 1101 , an acquisition module 1102 , and a generation module 1103 .
- the determining module 1101 is configured to, in the case where the hardware output size of the image scaling module does not match the first image size supported by the image processing model, based on the hardware output size and the first image size, determine whether to select a template image with the first image size
- the splitting mode information is used to split the template image into a plurality of image blocks, and the image size of each image block in the multiple image blocks is matched with the hardware output size;
- an obtaining module 1102 configured to obtain the first splitting data based on the splitting method information determined by the determining module 1101;
- the generating module 1103 is configured to generate an instruction for image processing based on the first split data obtained by the acquiring module 1102, and the instruction for image processing is used to execute the above-mentioned image processing method.
- the determining module 1101 includes:
- the calculation sub-module 11011 is used to calculate the first product when the image scaling module specifies the divisor of the size of the preset direction; the first product is the divisor and the size of the preset direction in the first image size. product of values;
- the first determination sub-module 11012 is configured to determine each split position on the template image with the first image size based on the first product calculated by the calculation sub-module 11011;
- the second determination sub-module 11013 is configured to determine, based on each of the split positions determined by the first determination sub-module 11012, information on the split mode of the template image having the first image size.
- the first determination sub-module 11012 includes:
- the fifth determination unit is used to determine the first target value and the second target value based on the first product; the product of the first target value and the second target value and the first product satisfy a preset relationship;
- the sixth determination unit is used to determine each split position on the template image with the first image size based on the second target value determined by the fifth determination unit;
- the value of the size of each size segment divided by position is an integer multiple of the second target value;
- the device also includes:
- the recording module is used for recording the first target value determined by the fifth determining unit.
- the fifth determining unit includes:
- a first determination subunit configured to determine at least one reference parameter group based on the first product; each reference parameter group in the at least one reference parameter group includes two values, and two values in any reference parameter group The product of , and the first product satisfy the preset relationship;
- a selection subunit for selecting a first reference parameter group from at least one reference parameter group determined by the first determination subunit
- the second determination subunit is configured to use one value in the first reference parameter group selected by the selection subunit as the first target value, and use another value in the first reference parameter group selected by the selection subunit as the second value target value.
- a subunit is selected, which is specifically configured to calculate the total alignment cost value of each reference parameter group in the at least one reference parameter group respectively; select the reference parameter group with the smallest corresponding total alignment cost value as the first reference parameter group.
- the selection subunit is specifically configured to determine, based on the larger value of two values included in any reference parameter group in the at least one reference parameter group, each split in the preset direction of the template image divide the positions, and calculate the alignment cost value of each split position; calculate the sum of the obtained alignment cost values to obtain the total alignment cost value of any reference parameter group.
- selecting a subunit is specifically used to obtain the coordinates of a preset direction among the coordinates of any split position; calculate the obtained coordinates and the larger of the two values included in any reference parameter group The remainder result of the numerical value; calculate the first product and the ratio of the larger of the two values included in any reference parameter group; calculate the difference between the ratio and the preset value; based on the preset adjustment factor, the remainder result is calculated A weighted summation of the difference is performed to obtain the alignment cost at any split position.
- the electronic device may be either or both of the first device and the second device, or a stand-alone device independent of them that can communicate with the first device and the second device to receive the collected data from them input signal.
- FIG. 13 illustrates a block diagram of an electronic device according to an embodiment of the present disclosure.
- the electronic device 1300 includes one or more processors 1301 and a memory 1302 .
- Processor 1301 may be a central processing unit or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in electronic device 1300 to perform desired functions.
- Memory 1302 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
- the volatile memory may include, for example, random access memory (RAM) and/or cache memory, or the like.
- the non-volatile memory may include, for example, read only memory (ROM), hard disk, flash memory, and the like.
- One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1301 may execute the program instructions to implement the image processing method in the various embodiments of the present disclosure described above or for A method of generating instructions for image processing.
- Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
- the electronic device 1300 may also include an input device 1303 and an output device 1304 interconnected by a bus system and/or other form of connection mechanism (not shown).
- the input device 1303 may be a microphone or a microphone array.
- the input device 1303 may be a communication network connector for receiving the collected input signals from the first device and the second device.
- the input device 1303 may also include, for example, a keyboard, a mouse, and the like.
- the output device 1304 can output various information to the outside, including the determined distance information, direction information, and the like.
- Output devices 1304 may include, for example, displays, speakers, printers, and communication networks and their connected remote output devices, among others.
- the electronic device 1300 may also include any other suitable components according to the specific application.
- embodiments of the present disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the "exemplary methods" described above in this specification Steps in an image processing method or a method of generating an instruction for image processing according to various embodiments of the present disclosure described in the section.
- the computer program product may write program code for performing operations of embodiments of the present disclosure in any combination of one or more programming languages, including object-oriented programming languages, such as Java, C++, etc. , also includes conventional procedural programming languages, such as "C" language or similar programming languages.
- the program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on.
- embodiments of the present disclosure may also be computer-readable storage media having computer program instructions stored thereon that, when executed by a processor, cause the processor to perform the above-described "Example Method" section of this specification Steps in an image processing method or a method for generating an instruction for image processing according to various embodiments of the present disclosure described in .
- the computer-readable storage medium may employ any combination of one or more readable media.
- the readable medium may be a readable signal medium or a readable storage medium.
- the readable storage medium may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses or devices, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
- the methods and apparatus of the present disclosure may be implemented in many ways.
- the methods and apparatus of the present disclosure may be implemented in software, hardware, firmware, or any combination of software, hardware, and firmware.
- the above-described order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise.
- the present disclosure can also be implemented as programs recorded in a recording medium, the programs including machine-readable instructions for implementing methods according to the present disclosure.
- the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
- each component or each step may be decomposed and/or recombined. These disaggregations and/or recombinations should be considered equivalents of the present disclosure.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Processing (AREA)
- Apparatus For Radiation Diagnosis (AREA)
- Image Analysis (AREA)
Abstract
Description
Claims (10)
- 一种图像处理方法,包括:在获得感兴趣区域ROI图像的情况下,基于图像处理模型支持的第一图像尺寸、第一拆分数据,以及所获得的ROI图像,拆分得到多个图像区块;所述第一图像尺寸基于所述第一拆分数据进行拆分得到的多个图像尺寸中的每个图像尺寸均与图像缩放模块的硬件输出尺寸相匹配;分别对所述多个图像区块中的每个图像区块进行图像缩放,以得到多个缩放图像区块;所述多个缩放图像区块的多个图像尺寸,以及所述第一图像尺寸基于所述第一拆分数据进行拆分得到的多个图像尺寸一一对应地相一致;将所述多个缩放图像区块依次输入至所述图像处理模型。
- 根据权利要求1所述的方法,其中,所述基于图像处理模型支持的第一图像尺寸、第一拆分数据,以及所获得的ROI图像,拆分得到多个图像区块,包括:在所获得的ROI图像满足指定图像对齐条件的情况下,将所获得的ROI图像作为待拆分ROI图像;否则,基于所获得的ROI图像进行图像调整,以得到满足所述指定图像对齐条件的待拆分ROI图像;基于所述第一图像尺寸、所述第一拆分数据,以及所述待拆分ROI图像的第二图像尺寸,确定第二拆分数据;按照所述第二拆分数据,对所述待拆分ROI图像进行拆分,以得到多个图像区块。
- 根据权利要求2所述的方法,其中,所述基于所述第一图像尺寸、所述第一拆分数据,以及所述待拆分ROI图像的第二图像尺寸,确定第二拆分数据,包括:基于所述第一拆分数据,确定在具有所述第一图像尺寸的模板图像的预设方向上的各个拆分位置;确定所述待拆分ROI图像的第二图像尺寸中所述预设方向的尺寸,以及所述第一图像尺寸中所述预设方向的尺寸的比例关系;基于所述比例关系,以及在所述模板图像的所述预设方向上的各个拆分位置,确定在所述待拆分ROI图像的所述预设方向上的各个拆分位置;基于在所述待拆分ROI图像的所述预设方向上的各个拆分位置,确定第二拆分数据。
- 一种用于图像处理的指令的生成方法,包括:在图像缩放模块的硬件输出尺寸与图像处理模型支持的第一图像尺寸不匹配的情况下,基于所述硬件输出尺寸和所述第一图像尺寸,确定对具有所述第一图像尺寸的模板图像的拆分方式信息;所述拆分方式信息用于将所述模板图像拆分为多个图像区块,且所述多个图像区块中的每个图像区块的图像尺寸均与所述硬件输出尺寸相匹配;基于所述拆分方式信息,获得第一拆分数据;基于所述第一拆分数据,生成用于图像处理的指令,所述用于图像处理的指令用于执行上述权利要求1-3中任一所述的图像处理方法。
- 根据权利要求4所述的方法,其中,所述基于所述硬件输出尺寸和所述第一图像尺寸,确定对具有所述第一图像尺寸的模板图像的拆分方式信息,包括:在所述图像缩放模块指定了预设方向的尺寸的数值的约数的情况下,计算第一乘积;所述第一乘积为所述约数与所述第一图像尺寸中所述预设方向的尺寸的数值的乘积;基于所述第一乘积,确定在具有所述第一图像尺寸的模板图像上的各个拆分位置;基于所确定的各个拆分位置,确定对具有所述第一图像尺寸的模板图像的拆分方式信息。
- 根据权利要求5所述的方法,其中,所述基于所述第一乘积,确定在具有所述第一图像尺寸的模板图像上的各个拆分位置,包括:基于所述第一乘积,确定第一目标数值和第二目标数值;所述第一目标数值和所述第二目 标数值的乘积与所述第一乘积满足预设关系;基于所述第二目标数值,确定在具有所述第一图像尺寸的模板图像上的各个拆分位置;所述模板图像的所述预设方向上,由确定出的各个拆分位置划分出的每个尺寸段的尺寸的数值均为所述第二目标数值的整数倍;所述方法还包括:记录所述第一目标数值。
- 一种图像处理装置,包括:拆分模块,用于在获得感兴趣区域ROI图像的情况下,基于图像处理模型支持的第一图像尺寸、第一拆分数据,以及所获得的ROI图像,拆分得到多个图像区块;所述第一图像尺寸基于所述第一拆分数据进行拆分得到的多个图像尺寸中的每个图像尺寸均与图像缩放模块的硬件输出尺寸相匹配;图像缩放模块,用于分别对所述拆分模块得到的所述多个图像区块中的每个图像区块进行图像缩放,以得到多个缩放图像区块;所述多个缩放图像区块的多个图像尺寸,以及所述第一图像尺寸基于所述第一拆分数据进行拆分得到的多个图像尺寸一一对应地相一致;输入模块,用于将所述图像缩放模块得到的所述多个缩放图像区块依次输入至所述图像处理模型。
- 一种用于图像处理的指令的生成装置,包括:确定模块,用于在图像缩放模块的硬件输出尺寸与图像处理模型支持的第一图像尺寸不匹配的情况下,基于所述硬件输出尺寸和所述第一图像尺寸,确定对具有所述第一图像尺寸的模板图像的拆分方式信息;所述拆分方式信息用于将所述模板图像拆分为多个图像区块,且所述多个图像区块中的每个图像区块的图像尺寸均与所述硬件输出尺寸相匹配;获取模块,用于基于所述确定模块确定的所述拆分方式信息,获得第一拆分数据;生成模块,用于基于所述获取模块获得的所述第一拆分数据,生成用于图像处理的指令,所述用于图像处理的指令用于执行上述权利要求1-3中任一所述的图像处理方法。
- 一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述权利要求1-3中任一所述的图像处理方法,或者用于执行上述权利要求4-6中任一所述的用于图像处理的指令的生成方法。
- 一种电子设备,所述电子设备包括:处理器;用于存储所述处理器可执行指令的存储器;所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现上述权利要求1-3中任一所述的图像处理方法,或者用于执行上述权利要求4-6中任一所述的用于图像处理的指令的生成方法。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US17/764,409 US12347061B2 (en) | 2020-07-31 | 2020-11-24 | Splitting and scaling images for input to a model and method, medium, and device therefor |
| JP2022520212A JP7369288B2 (ja) | 2020-07-31 | 2020-11-24 | 画像処理方法、画像処理用コマンドの生成方法および装置 |
| EP20947620.9A EP4020316A4 (en) | 2020-07-31 | 2020-11-24 | IMAGE PROCESSING METHOD, AND METHOD AND APPARATUS FOR GENERATING AN IMAGE PROCESSING INSTRUCTION |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010765242.5 | 2020-07-31 | ||
| CN202010765242.5A CN111860694A (zh) | 2020-07-31 | 2020-07-31 | 图像处理方法、用于图像处理的指令的生成方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022021695A1 true WO2022021695A1 (zh) | 2022-02-03 |
Family
ID=72954307
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/131057 Ceased WO2022021695A1 (zh) | 2020-07-31 | 2020-11-24 | 图像处理方法、用于图像处理的指令的生成方法及装置 |
Country Status (5)
| Country | Link |
|---|---|
| US (1) | US12347061B2 (zh) |
| EP (1) | EP4020316A4 (zh) |
| JP (1) | JP7369288B2 (zh) |
| CN (1) | CN111860694A (zh) |
| WO (1) | WO2022021695A1 (zh) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111860694A (zh) | 2020-07-31 | 2020-10-30 | 地平线(上海)人工智能技术有限公司 | 图像处理方法、用于图像处理的指令的生成方法及装置 |
| CN113610701B (zh) * | 2021-08-04 | 2023-12-26 | 同方鼎欣科技股份有限公司 | 图像分页转换方法、装置、计算机设备及可读存储介质 |
| CN115795078B (zh) * | 2022-12-08 | 2026-04-14 | 北京沃东天骏信息技术有限公司 | 图像检索模型的训练方法、图像检索方法及装置 |
| WO2024195159A1 (ja) * | 2023-03-22 | 2024-09-26 | 株式会社日立国際電気 | 異常検知システム及び異常検知方法 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9060171B2 (en) * | 2010-04-28 | 2015-06-16 | Hon Hai Precision Industry Co., Ltd. | Image processing system and method |
| CN107801026A (zh) * | 2017-11-09 | 2018-03-13 | 京东方科技集团股份有限公司 | 图像压缩方法及装置、图像压缩及解压缩系统 |
| CN108537729A (zh) * | 2018-03-27 | 2018-09-14 | 珠海全志科技股份有限公司 | 图像无级缩放方法、计算机装置及计算机可读存储介质 |
| CN110232657A (zh) * | 2019-06-17 | 2019-09-13 | 深圳市迅雷网络技术有限公司 | 一种图像缩放方法、装置、设备及介质 |
| CN111860694A (zh) * | 2020-07-31 | 2020-10-30 | 地平线(上海)人工智能技术有限公司 | 图像处理方法、用于图像处理的指令的生成方法及装置 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101289087B1 (ko) * | 2011-11-03 | 2013-08-07 | 인텔 코오퍼레이션 | 얼굴 검출 방법, 장치, 및 이 방법을 실행하기 위한 컴퓨터 판독 가능한 기록 매체 |
| US9928406B2 (en) | 2012-10-01 | 2018-03-27 | The Regents Of The University Of California | Unified face representation for individual recognition in surveillance videos and vehicle logo super-resolution system |
| JP6092082B2 (ja) | 2012-11-30 | 2017-03-08 | 株式会社沖データ | 画像処理装置及び方法、並びに、画像形成装置 |
| US20220028088A1 (en) * | 2020-07-23 | 2022-01-27 | Vingroup Joint Stock Company | Multi-scale segmentation system |
-
2020
- 2020-07-31 CN CN202010765242.5A patent/CN111860694A/zh active Pending
- 2020-11-24 JP JP2022520212A patent/JP7369288B2/ja active Active
- 2020-11-24 US US17/764,409 patent/US12347061B2/en active Active
- 2020-11-24 WO PCT/CN2020/131057 patent/WO2022021695A1/zh not_active Ceased
- 2020-11-24 EP EP20947620.9A patent/EP4020316A4/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9060171B2 (en) * | 2010-04-28 | 2015-06-16 | Hon Hai Precision Industry Co., Ltd. | Image processing system and method |
| CN107801026A (zh) * | 2017-11-09 | 2018-03-13 | 京东方科技集团股份有限公司 | 图像压缩方法及装置、图像压缩及解压缩系统 |
| CN108537729A (zh) * | 2018-03-27 | 2018-09-14 | 珠海全志科技股份有限公司 | 图像无级缩放方法、计算机装置及计算机可读存储介质 |
| CN110232657A (zh) * | 2019-06-17 | 2019-09-13 | 深圳市迅雷网络技术有限公司 | 一种图像缩放方法、装置、设备及介质 |
| CN111860694A (zh) * | 2020-07-31 | 2020-10-30 | 地平线(上海)人工智能技术有限公司 | 图像处理方法、用于图像处理的指令的生成方法及装置 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4020316A4 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP7369288B2 (ja) | 2023-10-25 |
| US12347061B2 (en) | 2025-07-01 |
| EP4020316A1 (en) | 2022-06-29 |
| US20220351329A1 (en) | 2022-11-03 |
| CN111860694A (zh) | 2020-10-30 |
| JP2022551249A (ja) | 2022-12-08 |
| EP4020316A4 (en) | 2023-09-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2022021695A1 (zh) | 图像处理方法、用于图像处理的指令的生成方法及装置 | |
| US11842438B2 (en) | Method and terminal device for determining occluded area of virtual object | |
| CN111080792B (zh) | 模型简化处理方法、装置以及电子设备、存储介质 | |
| CN113986426B (zh) | 图像检测方法、装置、可读介质及电子设备 | |
| CN114882321A (zh) | 深度学习模型的训练方法、目标对象检测方法和装置 | |
| CN113657518B (zh) | 训练方法、目标图像检测方法、装置、电子设备以及介质 | |
| CN112508005B (zh) | 用于处理图像的方法、装置、设备以及存储介质 | |
| CN115294328A (zh) | 目标检测框的生成方法、装置、存储介质和电子设备 | |
| CN114445825A (zh) | 文字检测方法、装置、电子设备和存储介质 | |
| CN113516246A (zh) | 参数优化方法、量子芯片的控制方法及装置 | |
| CN112115316B (zh) | 一种分箱方法、装置、电子设备及存储介质 | |
| WO2019169699A1 (zh) | 房屋模型的渲染方法、装置、终端设备及介质 | |
| WO2019024723A1 (zh) | 特征点匹配结果处理方法和装置 | |
| CN113837194A (zh) | 图像处理方法、图像处理装置、电子设备以及存储介质 | |
| CN114120414A (zh) | 图像处理方法、装置、电子设备和介质 | |
| CN113205090A (zh) | 图片矫正方法、装置、电子设备及计算机可读存储介质 | |
| US20210166053A1 (en) | Merging object detections using graphs | |
| CN113760087B (zh) | 命中点位置信息的确定方法和装置 | |
| CN117669750B (zh) | 量子线路模拟方法、装置、电子设备及存储介质 | |
| CN112215247A (zh) | 对特征向量进行聚类的方法、装置及电子设备 | |
| US20230419594A1 (en) | Method and system for texturing an image | |
| CN111475156A (zh) | 页面代码生成方法和装置、电子设备和存储介质 | |
| CN115756493A (zh) | 神经网络模型的编译方法、装置、存储介质及电子设备 | |
| CN112907501A (zh) | 物体检测方法、装置及电子设备 | |
| CN115471403A (zh) | 图像处理方法、装置及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20947620 Country of ref document: EP Kind code of ref document: A1 |
|
| ENP | Entry into the national phase |
Ref document number: 2022520212 Country of ref document: JP Kind code of ref document: A |
|
| ENP | Entry into the national phase |
Ref document number: 2020947620 Country of ref document: EP Effective date: 20220321 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWG | Wipo information: grant in national office |
Ref document number: 17764409 Country of ref document: US |