WO2017132933A1 - Image processing method and related apparatus - Google Patents

Image processing method and related apparatus Download PDF

Info

Publication number
WO2017132933A1
WO2017132933A1 PCT/CN2016/073473 CN2016073473W WO2017132933A1 WO 2017132933 A1 WO2017132933 A1 WO 2017132933A1 CN 2016073473 W CN2016073473 W CN 2016073473W WO 2017132933 A1 WO2017132933 A1 WO 2017132933A1
Authority
WO
WIPO (PCT)
Prior art keywords
partition
image
target
model
partitioning
Prior art date
Application number
PCT/CN2016/073473
Other languages
French (fr)
Chinese (zh)
Inventor
汪涛
姚骏
柴振华
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2016/073473 priority Critical patent/WO2017132933A1/en
Priority to CN201680000994.4A priority patent/CN107735800B/en
Publication of WO2017132933A1 publication Critical patent/WO2017132933A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition

Definitions

  • the present invention relates to the field of image processing, and in particular, to an image processing method and related apparatus.
  • the image processing apparatus In the field of image processing, the image processing apparatus generally realizes the detection and recognition of the target in the image through two steps of partitioning and classification, as shown in FIG. 1: the image partition model accepts the input image, and divides the input image into regions of different sizes.
  • the image classification model uses a convolutional neural network or other classification algorithm to continuously extract the features of each region of the image through a hierarchical structure, and finally identify the target object.
  • the size, composition, complexity, etc. of images are ever-changing, and different images are suitable for partitioning with different partitioning algorithms. Therefore, the current technology has developed a variety of image partition models for different kinds of images. Among them, different image partitioning models adopt different image partitioning algorithms, so when partitioning the same sub-image, the accuracy of the obtained partitioning result and the duration of the partitioning operation are different.
  • the same image partition model cannot take both precision and speed into consideration.
  • the image partition model with higher precision tends to have a slower partitioning speed and a longer partitioning operation.
  • the image partitioning model with faster partitioning speed tends to be less accurate. Therefore, the image partitioning model with higher precision is suitable for processing more complex images to increase the credibility of image partitioning; the image partitioning model with lower precision is suitable for processing relatively simple images to speed up image partitioning.
  • the image partitioning models that are suitable for different images are different. Therefore, the image processing apparatus cannot guarantee that all images are suitable regardless of whether the image partitioning model with high precision or low precision is used. This results in the current image processing device not being able to balance the accuracy and speed of image processing, and cannot meet the actual needs.
  • the invention provides an image processing method and device for partitioning a target image by using a suitable image partitioning model.
  • a first aspect of the present invention provides an image processing method suitable for use in an image processing apparatus.
  • the image processing device acquires a target image to be processed, and then uses a classifier to determine a target partition model corresponding to the target image from the N partition models, where N is an integer greater than 1.
  • the classifier can It is a classification function or classification model, and can also be a hardware unit with processing functions for mapping a given image onto one of the N partition models.
  • the image processing device inputs the target image into the classifier, and can determine the target partition model based on the output of the classifier. After the target partition model is determined, the image processing apparatus partitions the target image using the target partition model to obtain a partition result of the target image.
  • the image processing apparatus does not adopt a single partition model, but uses a classifier to select an appropriate partition model in the N partition models, thereby ensuring that the image processing apparatus can perform all types of images.
  • a partition model with appropriate accuracy and speed is selected to partition the target image to meet actual needs.
  • the image processing apparatus may also use the first partition model to partition the target image in parallel while determining the target partition model using the classifier.
  • the time for determining the target partition model according to the classifier is shorter than the time for partitioning the target image by using the first partition model, so that if the image processing apparatus determines that the target partition model is the first partition model, the first partition model is continuously used. Partitioning the target image is equivalent to the image processing apparatus directly zoning the target image using the first partition model after acquiring the target image, which can save time for using the classifier to determine the target partition model.
  • the image processing apparatus determines that the target partition model is not the first partition model, the image processing apparatus stops the operation of partitioning the target image using the first partition model, and re-partitions the target image using the target partition model to obtain a partition of the target image. result.
  • the first partition model may be the highest-precision partition model of the N partition models, or the partition model with the longest time for performing image partitioning operations, or a partition model determined by other standards.
  • the classifier may be stored locally by the image processing device and read locally from the use; or may be obtained from other places by the image processing device; or may be imaged by the image processing device through the neural network. The operation is obtained.
  • the image processing apparatus may train the classifier by: acquiring P training images in advance; using the N partition models for each training image, and determining each of the partition models for each training image.
  • the ratio of the accuracy of the partition to the time is performed; then the partition model with the largest ratio of the precision of the partitioning of the i-th training image to the time is determined as the partition model corresponding to the i-th image, 1 ⁇ i ⁇ P.
  • the error back propagation (abbreviation: BP) algorithm or other algorithms are used to obtain the classifier.
  • BP error back propagation
  • the device has a classification effect that meets the actual needs.
  • the classifier obtained by such a method can determine, as the target partition model of the target image, the partition model in which the ratio of the accuracy of the partitioning of the target image and the time is the largest among the N partition models.
  • the graphics processing apparatus may further classify the partition result of the target image.
  • the image processing apparatus may determine the target size of the convolution kernel of the corresponding classification model according to the accuracy of the target partition model, and then use the convolution kernel of the target size to classify the partition result of the target image to obtain the target image. Classification results.
  • Such a method can classify more complex images by a larger convolution kernel, and a simpler image is classified by a smaller convolution kernel, taking into account the accuracy and speed of the classification calculation.
  • the image processing apparatus may further determine a calculation channel of the corresponding classification model according to the accuracy of the target partition model. Specifically, if the target partition model is the most accurate partition model among the N partition models, the image processing apparatus can use the floating point channel and the fixed point channel to classify the partitioning result of the target image in parallel to speed up the classification operation. Improve the efficiency of image classification. If the target partition model is not the most accurate model among the N partition models, the image processing apparatus may classify the partition result of the target image using only the floating point channel to obtain the classification result of the target image.
  • a second aspect of the present invention provides an image processing apparatus including an image acquisition module, a model determination module, and an image recognition module.
  • the image obtaining module is configured to acquire a target image to be processed;
  • the model determining module is configured to determine, in the N partition models, a target partition model corresponding to the target image by using a classifier, where N is an integer greater than 1; and the image recognition module uses The image is identified, and the target image is partitioned by using the target partition model to obtain a partition result of the target image.
  • the image recognition module is specifically configured to: when the target partition model is determined by using the classifier, the first partition model may be used in parallel to partition the target image.
  • the first partition model may be the highest-precision partition model of the N partition models, or the partition model with the longest time for performing image partitioning operations, or a partition model determined by other standards. If the image processing apparatus determines that the target partition model is the first partition model, then continuing to partition the target image by using the first partition model, which is equivalent to the image processing apparatus directly partitioning the target image by using the first partition model after acquiring the target image. , you can save time using the classifier to determine the target partition model.
  • the image processing apparatus determines that the target partition model is not the first partition model, the image processing apparatus stops the operation of partitioning the target image using the first partition model, and re-partitions the target image using the target partition model. Get the partition result of the target image.
  • the first partition model is the partition model with the highest precision among the N partition models or the partition model with the longest time for image partitioning operation.
  • the model determining module is further configured to: obtain a classifier by using an image training operation of the neural network.
  • the model determining module may train the classifier by: acquiring P training images in advance; using the N partition models for each training image, and determining each of the partition models for each training image. The ratio of the accuracy of the partition to the time is performed; then the partition model with the largest ratio of the precision of the partitioning of the i-th training image to the time is determined as the partition model corresponding to the i-th image, 1 ⁇ i ⁇ P. After determining the partition model corresponding to each training image, the BP algorithm or other algorithms are used to obtain the classifier.
  • the image recognition module is further configured to: determine a target size of the convolution kernel of the corresponding classification model according to the precision of the target partition model, and then use the convolution kernel of the target size to perform the partitioning result of the target image. Classification, and the classification result of the target image is obtained.
  • the image recognition module is further configured to: determine a calculation channel of the corresponding classification model according to the accuracy of the target partition model. If the target partition model is the most accurate partition model among the N partition models, the partitioning results of the target image are classified in parallel using the floating point channel and the fixed point channel. If the target partition model is not the most accurate model among the N partition models, the partition result of the target image is classified using only the floating point channel, and the classification result of the target image is obtained.
  • a third aspect of the invention provides a computer apparatus comprising a processor, a memory and a communication interface for performing the image processing method provided by the first aspect of the invention by invoking instructions in the memory.
  • the image processing apparatus acquires a target image, determines a target partition model corresponding to the target image in the N partition models through a classifier, and then partitions the target image using the target partition model to obtain a partition of the target image. result.
  • the image processing apparatus of the present invention does not adopt a single partition model, but uses a classifier to select an appropriate partition model in the N partition models, thereby ensuring that the image processing apparatus can select accuracy and speed for all types of images. A more suitable partition model to partition the target image can meet the actual needs.
  • FIG. 1 is a schematic diagram showing the principle of detecting and recognizing an image by an image processing apparatus
  • FIG. 2 is a flowchart of an embodiment of an image processing method according to an embodiment of the present invention.
  • FIG. 3 is a structural diagram of an embodiment of an image processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of an embodiment of a computing device according to an embodiment of the present invention.
  • the present invention provides an image processing method and apparatus, which will be separately described below.
  • the image processing apparatus In the field of image processing, the image processing apparatus generally realizes the detection and recognition of the target in the image through two steps of partitioning and classification, as shown in FIG. 1: the image partition model accepts the input image, and divides the input image into regions of different sizes.
  • the image classification model uses a convolutional neural network or other classification algorithm to continuously extract the features of each region of the image through a hierarchical structure, and finally identify the target object.
  • the size, composition, complexity, etc. of images are ever-changing, and different images are suitable for partitioning with different partitioning algorithms.
  • the technology has developed multiple partition models for different kinds of images.
  • different partition models use different image partitioning algorithms, so when partitioning the same sub-image, the accuracy of the obtained partitioning result and the duration of the partitioning operation are different.
  • the same partition model cannot take into account both accuracy and speed.
  • the partition model with higher precision tends to have slower partition speed and longer partition operation.
  • the partition model with fast partition speed tends to be less accurate. Therefore, the higher precision partition model is suitable for processing more complex images to increase the credibility of image partitioning; the lower precision partition model is suitable for processing simpler images to speed up image partitioning.
  • the present invention provides an image processing method capable of adopting different partition models for different images, and the basic flow thereof is shown in FIG. 2, including
  • the image processing apparatus may determine a target partition model corresponding to the target image from the N partition models.
  • the N partition models may be stored locally by the image processing device and may be locally read during use; or may be obtained from other places by the image processing device, which is not limited herein. Where N is an integer greater than one.
  • the determined target partition model should be the partition model of the N partition models that is most suitable for processing the target image.
  • a classifier (English: classifier) is used to determine the target partition model.
  • the essence of the classifier can be a classification function or a classification model, which can classify a given image sample into N classes, each class corresponding to a partition model, thereby mapping the image into the N partition models.
  • the image classification device inputs the target image to the classifier, and can determine the target partition model based on the output of the classifier.
  • the classifier can be stored locally by the image processing device and read locally from use; it can also be obtained from other places by the image processing device; or can be received as a classifier by a hardware unit having a processing function.
  • the target image input by the image classification device outputs the determined target partition model to the image classification device, which is not limited herein.
  • the image processing device may also generate the classifier by itself according to the training operation of the neural network.
  • the image processing apparatus may acquire P training images in advance, and then determine a first number of regions in each training image whose edge detection result is greater than the first threshold, and then determine, according to the first number, each training image a partitioning model; or, determining a second number of regions in each training image with a confidence greater than a second threshold, and then determining a partition model corresponding to each training image based on the second number; or, for each training session
  • the images are partitioned using the N partition models, and the ratio of the accuracy and time of each partition model to each training image is determined, or the confidence of each partition model for partitioning each training image, or each The partition model performs the edge detection result of each training image.
  • the partition model corresponding to each training image is determined.
  • the partition model with the highest ratio of precision and time for partitioning the i-th training image is the partition corresponding to the i-th image.
  • the BP algorithm or other algorithms can be used to obtain the classifier.
  • the classifier can be guaranteed to have a classification effect that satisfies the actual needs.
  • the classifier obtained by such a method can determine, as the target partition model of the target image, the partition model in which the ratio of the accuracy of the partitioning of the target image and the time is the largest among the N partition models.
  • the image processing apparatus partitions the target image using the target partition model to obtain a partition result of the target image.
  • the image processing apparatus may perform step 204 while performing step 202:
  • the image processing apparatus partitions the target image using the first partition model, wherein the first partition model may be the most accurate model among the N partition models. It is also possible to model the longest time for image partitioning in the N partition models. It may also be a model determined in the N partition models according to other standards, which is not limited herein.
  • the step 204 is not performed.
  • the image processing apparatus performs step 203. Specifically, if the target partition model is the first partition model, the target image is further partitioned by using the first partition model, and the partition result of the first partition model is used as the partition result of the target image. In this case, since step 202 is performed simultaneously with the operation of partitioning using the first partition model, the time taken to perform step 202 can be saved. If the target partition model is not the first partition model, the image processing apparatus stops the operation of partitioning the target image using the first partition model, and partitions the target image using the determined target partition model to obtain a partition result of the target image.
  • the first partition model may actually be a partition model that is manually specified in the N partition models or specified by the image processing apparatus by default.
  • the image processing device may preset the accuracy relationship of the N partition models, and the first partition model is the fine in the N partition models. The highest partition model.
  • the image processing apparatus may preset a time-consuming relationship between the N partition models for performing an image partitioning operation, and the first partition model is a partition model that takes the longest image partitioning operation in the N partition models.
  • the accuracy relationship or the time-consuming relationship may be obtained by the image processing device, or determined by the image processing device, or manually set.
  • the image processing apparatus performs the step 202, in addition to using the first partition model to partition the target image in parallel, and simultaneously performing the pair using the second partition model, the third partition model, or more partition models.
  • the operation of partitioning the target image is similar to the step 204, and is not described here.
  • the more partition models that perform the partitioning operation on the image in parallel the higher the utilization rate of the processor of the image processing apparatus, and the larger the memory usage. Therefore, in practical applications, the performance of the image processing apparatus should be integrated, and a partition model for performing image partitioning operations on the target image in parallel should be selected.
  • the image processing apparatus acquires a target image, determines a target partition model corresponding to the target image in the N partition models by using a classifier, and then partitions the target image by using the target partition model to obtain a target image. Partition results.
  • the image processing apparatus in the embodiment of the present invention does not adopt a single partition model, but uses a classifier to select an appropriate partition model in the N partition models, thereby ensuring that the image processing apparatus can select accuracy for all types of images. Partition models with better speeds are used to partition the target image to meet actual needs.
  • the image processing apparatus may classify the target image by using a fixed-size convolution kernel (English: convolution matrix or convolution kernel) by using a classification model, using a floating point or a fixed-point channel. Similar to the image partitioning operation, it is suitable to use a classification model with higher precision and slower speed for more complex images. A simpler image is suitable for a classification model with lower precision and faster speed. The complexity of the image can be reflected by the accuracy of the target partition model. Therefore, in the present invention, the image processing apparatus may determine the target size of the convolution kernel of the corresponding classification model according to the accuracy of the target partition model, and then use the convolution kernel of the target size to partition the target image. The results are classified to obtain the classification result of the target image. Such a method can classify more complex images by a larger convolution kernel, and a simpler image is classified by a smaller convolution kernel, taking into account the accuracy and speed of the classification calculation.
  • a fixed-size convolution kernel English: convolution matrix or convolution kernel
  • the image processing apparatus may determine the corresponding image according to the accuracy of the target partition model.
  • the calculation channel of the classification model for example, if the target partition model is the most accurate partition model among the N partition models (or one of the top n high-resolution partition models, n ⁇ N), the image processing apparatus can use the floating in parallel The point channel and the fixed point channel classify the segmentation result of the target image to obtain the classification result of the target image. Parallel use of floating point channels and fixed point channels can speed up the classification operation and improve the efficiency of image classification. If the target partition model is not the most accurate model of the N partition models (or one of the top n high-precision partition models), the image processing apparatus may classify the partition results of the target image using only the floating point channel.
  • FIG. 2 introduces an image processing method provided by the present invention.
  • An image processing apparatus for implementing the above method will be described below.
  • the basic structure of the image processing apparatus is as follows:
  • the image acquisition module 301 is configured to perform step 201 in the embodiment shown in FIG. 2;
  • the model determining module 302 is configured to perform step 202 in the embodiment shown in FIG. 2;
  • the image recognition module 303 is configured to perform step 203 in the embodiment shown in FIG. 2 .
  • step 204 can also be performed.
  • the image recognition module 303 is further configured to determine a target size of the convolution kernel corresponding to the target partition model according to the precision of the target partition model, and use the convolution kernel of the target size to classify the partition result of the target image. Get the classification results.
  • the image recognition module is further configured to perform classification of the target image by using a floating point channel and a fixed point channel in parallel when the target partition model is not the highest precision partition model of the N partition models. .
  • the embodiment of the present invention further provides a computing device 400 for implementing the image processing method in the embodiment shown in FIG. 2. See Figure 4 for the basic structure.
  • the computing device specifically includes a processor 401, a memory 402, a bus 403, and a communication interface 404.
  • the processor 401, the memory 402, and the communication interface 404 can implement communication connection with each other through the bus 403, and can also implement communication by other means such as wireless transmission.
  • the memory 402 memory may include a volatile memory (English: volatile memory), such as random access memory (English: random-access memory, abbreviation: RAM); the memory may also include non-volatile memory (English: non-volatile memory) ), such as read-only memory (English: Read-only memory, abbreviated as: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); memory 402 Combinations of the above types of memory may also be included.
  • volatile memory such as random access memory (English: random-access memory, abbreviation: RAM)
  • non-volatile memory English: non-volatile memory
  • read-only memory English: Read-only memory, abbreviated as: ROM
  • flash memory English: flash memory
  • HDD hard disk drive
  • SSD solid state drive
  • the memory 402 loads the N partition models, the accuracy relationship or the time-consuming relationship of the N partition models, the classifier, each classification model, and the like for use by the processor 401.
  • the program code for implementing the image processing method provided by the present invention may be stored in the memory 402 and executed by the processor 401.
  • Computing device 400 acquires the target image via communication interface 404 and returns the classification result for the target image to the user via communication interface 404.
  • the processor 401 can be a central processing unit (English: central processing unit, CPU for short), a graphics processing unit (English: graphics processing unit (abbreviation: GPU), digital signal processing (English: digital signal processing, abbreviation: DSP), A combination of any one or more of the hardware units having processing functions, such as a field-programmable gate array (English: field-programmable gate array).
  • CPU central processing unit
  • GPU graphics processing unit
  • DSP digital signal processing
  • a combination of any one or more of the hardware units having processing functions such as a field-programmable gate array (English: field-programmable gate array).
  • the processor 401 is mainly configured to acquire a target image to be processed; use a classifier to determine a target partition model corresponding to the target image, and use the first partition model to partition the target image; after determining the target partition model, use the target partition model pair
  • the target image is partitioned to obtain a partition result of the target image; according to the accuracy of the target partition model, the target size of the convolution kernel of the corresponding classification model and the corresponding floating point and/or fixed point calculation channel are determined, and then the target size is used.
  • the convolution kernel and the calculation channel classify the partition result of the target image to obtain the classification result of the target image.
  • the disclosed computing device, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division.
  • there may be another division manner for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated in one In the unit.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional units.
  • the integrated modules if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

An image processing method, an image processing apparatus and a computing device. The method comprises: acquiring a target image (201), determining, by means of a classifier, from N partition models, a target partition model that the target image corresponds to (202), and then partitioning the target image using the target partition model, so as to obtain the partition result of the target image (203). The image processing apparatus uses the classifier to select the appropriate partition model in N partition models instead of using a single partition model, and this ensures that the image processing device is able to select, for each type of image, the partition model which is appropriate in terms of both accuracy and speed so as to partition the target image, being able to meet the actual needs.

Description

一种图像处理方法以及相关装置Image processing method and related device 技术领域Technical field
本发明涉及图像处理领域,尤其涉及一种图像处理方法以及相关装置。The present invention relates to the field of image processing, and in particular, to an image processing method and related apparatus.
背景技术Background technique
在图像处理领域,图像处理装置一般通过分区和分类两步操作来实现图像中目标的检测识别,如图1所示:图像分区模型接受输入的图像,并把输入的图像划分成大小不同的区域;图像分类模型采用卷积神经网络或其它分类算法,通过层次化结构不断提取图像每个区域的特征,最终识别出目标物体。In the field of image processing, the image processing apparatus generally realizes the detection and recognition of the target in the image through two steps of partitioning and classification, as shown in FIG. 1: the image partition model accepts the input image, and divides the input image into regions of different sizes. The image classification model uses a convolutional neural network or other classification algorithm to continuously extract the features of each region of the image through a hierarchical structure, and finally identify the target object.
在实际应用中,图像的尺寸、构图、复杂度等千变万化,不同的图像适宜用不同的分区算法来进行分区。因此现阶段技术针对不同种类的图像开发了多种图像分区模型。其中,不同的图像分区模型采用不同的图像分区算法,故在对同一副图像进行分区时,得到的分区结果的精度以及分区操作消耗的时长均不相同。但一般的,同一个图像分区模型无法同时兼顾精度与速度,精度较高的图像分区模型往往分区速度较慢,分区操作耗时较长;而分区速度快的图像分区模型往往精度较低。因此,精度较高的图像分区模型适合处理较为复杂的图像,以增加图像分区的可信度;精度较低的图像分区模型适合处理较为简单的图像,以加快图像分区的速度。In practical applications, the size, composition, complexity, etc. of images are ever-changing, and different images are suitable for partitioning with different partitioning algorithms. Therefore, the current technology has developed a variety of image partition models for different kinds of images. Among them, different image partitioning models adopt different image partitioning algorithms, so when partitioning the same sub-image, the accuracy of the obtained partitioning result and the duration of the partitioning operation are different. However, in general, the same image partition model cannot take both precision and speed into consideration. The image partition model with higher precision tends to have a slower partitioning speed and a longer partitioning operation. The image partitioning model with faster partitioning speed tends to be less accurate. Therefore, the image partitioning model with higher precision is suitable for processing more complex images to increase the credibility of image partitioning; the image partitioning model with lower precision is suitable for processing relatively simple images to speed up image partitioning.
不同的图像适宜采用的图像分区模型各不相同,因此图像处理装置无论采用高精度还是低精度的图像分区模型,都不能保证适合所有图像。这就导致现阶段的图像处理装置无法兼顾图像处理的精度和速度,不能满足实际的需求。The image partitioning models that are suitable for different images are different. Therefore, the image processing apparatus cannot guarantee that all images are suitable regardless of whether the image partitioning model with high precision or low precision is used. This results in the current image processing device not being able to balance the accuracy and speed of image processing, and cannot meet the actual needs.
发明内容Summary of the invention
本发明提供了一种图像处理方法以及装置,用于采用较为适宜的图像分区模型对目标图像进行分区。The invention provides an image processing method and device for partitioning a target image by using a suitable image partitioning model.
本发明第一方面提供了一种图像处理方法,适用于图像处理装置。其中,图像处理装置获取待处理的目标图像,然后从N个分区模型中,使用分类器来确定目标图像对应的目标分区模型,N为大于1的整数。其中,分类器可以 是一个分类函数或分类模型,也可以是一种具有处理功能的硬件单元,该分类器用于把给定的图像映射到该N个分区模型中的一个分区模型上。图像处理装置将目标图像输入分类器,就能够根据分类器的输出确定目标分区模型。在确定了目标分区模型后,图像处理装置使用该目标分区模型对目标图像进行分区,得到目标图像的分区结果。本发明提供的图像处理方法中,图像处理装置没有采用单一的分区模型,而是在N个分区模型中采用分类器选择合适的分区模型,这样就保证了图像处理装置对所有类型的图像都能够选择精度与速度都较为适宜的分区模型来对目标图像进行分区,能够满足实际需求。A first aspect of the present invention provides an image processing method suitable for use in an image processing apparatus. The image processing device acquires a target image to be processed, and then uses a classifier to determine a target partition model corresponding to the target image from the N partition models, where N is an integer greater than 1. Among them, the classifier can It is a classification function or classification model, and can also be a hardware unit with processing functions for mapping a given image onto one of the N partition models. The image processing device inputs the target image into the classifier, and can determine the target partition model based on the output of the classifier. After the target partition model is determined, the image processing apparatus partitions the target image using the target partition model to obtain a partition result of the target image. In the image processing method provided by the present invention, the image processing apparatus does not adopt a single partition model, but uses a classifier to select an appropriate partition model in the N partition models, thereby ensuring that the image processing apparatus can perform all types of images. A partition model with appropriate accuracy and speed is selected to partition the target image to meet actual needs.
可选的,图像处理装置在使用分类器确定目标分区模型的同时,还可以并行的使用第一分区模型来对目标图像进行分区。其中,根据分类器确定目标分区模型的时间要短于使用第一分区模型对目标图像进行分区的时间,这样,若图像处理装置确定目标分区模型为第一分区模型,则继续使用第一分区模型对目标图像进行分区,这样相当于图像处理装置在获取目标图像后,直接使用第一分区模型对目标图像进行分区,可以节省使用分类器来确定目标分区模型的时间。若图像处理装置确定目标分区模型不为第一分区模型,则图像处理装置停止使用第一分区模型对目标图像进行分区的操作,并使用目标分区模型重新对目标图像进行分区,得到目标图像的分区结果。其中,该第一分区模型可以为该N个分区模型中精度最高的分区模型,或进行图像分区操作耗时最长的分区模型,或通过其它标准确定的分区模型。Optionally, the image processing apparatus may also use the first partition model to partition the target image in parallel while determining the target partition model using the classifier. Wherein, the time for determining the target partition model according to the classifier is shorter than the time for partitioning the target image by using the first partition model, so that if the image processing apparatus determines that the target partition model is the first partition model, the first partition model is continuously used. Partitioning the target image is equivalent to the image processing apparatus directly zoning the target image using the first partition model after acquiring the target image, which can save time for using the classifier to determine the target partition model. If the image processing apparatus determines that the target partition model is not the first partition model, the image processing apparatus stops the operation of partitioning the target image using the first partition model, and re-partitions the target image using the target partition model to obtain a partition of the target image. result. The first partition model may be the highest-precision partition model of the N partition models, or the partition model with the longest time for performing image partitioning operations, or a partition model determined by other standards.
可选的,该分类器可以由图像处理装置保存在本地,并在使用时从本地读取得到;也可以由图像处理装置从其他地方获取得到;也可以由图像处理装置通过神经网络的图像训练操作得到。Optionally, the classifier may be stored locally by the image processing device and read locally from the use; or may be obtained from other places by the image processing device; or may be imaged by the image processing device through the neural network. The operation is obtained.
可选的,图像处理装置可以通过如下方法训练得到该分类器:预先获取P张训练图像;对每张训练图像都使用该N个分区模型进行分区,并确定每个分区模型对每张训练图像进行分区的精度和时间的比值;然后将对第i张训练图像进行分区的精度和时间的比值最大的分区模型,确定为第i张图像对应的分区模型,1≤i≤P。在确定了每张训练图像对应的分区模型后,采用误差反向传播(英文:back propagation,缩写:BP)算法或其它算法,得到分类器。只要P张训练图像覆盖了各种类型的图像,且P值取得足够大,就能保证分类 器具有满足实际需求的分类效果。通过这样的方法得到的分类器,能够将该N个分区模型中,对目标图像进行分区的精度和时间的比值最大的分区模型确定为该目标图像的目标分区模型。Optionally, the image processing apparatus may train the classifier by: acquiring P training images in advance; using the N partition models for each training image, and determining each of the partition models for each training image. The ratio of the accuracy of the partition to the time is performed; then the partition model with the largest ratio of the precision of the partitioning of the i-th training image to the time is determined as the partition model corresponding to the i-th image, 1≤i≤P. After determining the partition model corresponding to each training image, the error back propagation (abbreviation: BP) algorithm or other algorithms are used to obtain the classifier. As long as the P training images cover various types of images, and the P value is large enough, the classification can be guaranteed. The device has a classification effect that meets the actual needs. The classifier obtained by such a method can determine, as the target partition model of the target image, the partition model in which the ratio of the accuracy of the partitioning of the target image and the time is the largest among the N partition models.
可选的,在得到目标图像的分区结果后,图形处理装置还可以对目标图像的分区结果进行分类。其中,图像处理装置可以根据目标分区模型的精度,来确定其对应的分类模型的卷积核的目标大小,然后使用该目标大小的卷积核,对目标图像的分区结果进行分类,得到目标图像的分类结果。这样的方法能够使得较为复杂的图像由较大的卷积核来进行分类,较为简单的图像由较小的卷积核来进行分类,兼顾了分类计算的精度和速度。Optionally, after obtaining the partition result of the target image, the graphics processing apparatus may further classify the partition result of the target image. The image processing apparatus may determine the target size of the convolution kernel of the corresponding classification model according to the accuracy of the target partition model, and then use the convolution kernel of the target size to classify the partition result of the target image to obtain the target image. Classification results. Such a method can classify more complex images by a larger convolution kernel, and a simpler image is classified by a smaller convolution kernel, taking into account the accuracy and speed of the classification calculation.
可选的,图像处理装置还可以根据目标分区模型的精度,来确定其对应的分类模型的计算通道。具体的,若该目标分区模型是该N个分区模型中精度最高的分区模型,则图像处理装置可以并行使用浮点通道和定点通道对目标图像的分区结果进行分类,以加快分类操作的速度,提高图像分类的效率。若该目标分区模型不是该N个分区模型中精度最高的模型,则图像处理装置可以仅使用浮点通道对目标图像的分区结果进行分类,得到目标图像的分类结果。Optionally, the image processing apparatus may further determine a calculation channel of the corresponding classification model according to the accuracy of the target partition model. Specifically, if the target partition model is the most accurate partition model among the N partition models, the image processing apparatus can use the floating point channel and the fixed point channel to classify the partitioning result of the target image in parallel to speed up the classification operation. Improve the efficiency of image classification. If the target partition model is not the most accurate model among the N partition models, the image processing apparatus may classify the partition result of the target image using only the floating point channel to obtain the classification result of the target image.
本发明第二方面提供了一种图像处理装置,包括图像获取模块、模型确定模块和图像识别模块。其中,图像获取模块用于获取待处理的目标图像;模型确定模块用于在该N个分区模型中使用分类器确定目标图像对应的目标分区模型,N为大于1的整数;图像识别模块,用于识别图像,具体用于使用目标分区模型对目标图像进行分区,得到目标图像的分区结果。A second aspect of the present invention provides an image processing apparatus including an image acquisition module, a model determination module, and an image recognition module. The image obtaining module is configured to acquire a target image to be processed; the model determining module is configured to determine, in the N partition models, a target partition model corresponding to the target image by using a classifier, where N is an integer greater than 1; and the image recognition module uses The image is identified, and the target image is partitioned by using the target partition model to obtain a partition result of the target image.
可选的,图像识别模块具体用于:在使用分类器确定目标分区模型的同时,还可以并行的使用第一分区模型来对目标图像进行分区。其中,该第一分区模型可以为该N个分区模型中精度最高的分区模型,或进行图像分区操作耗时最长的分区模型,或通过其它标准确定的分区模型。若图像处理装置确定目标分区模型为第一分区模型,则继续使用第一分区模型对目标图像进行分区,这样相当于图像处理装置在获取目标图像后,直接使用第一分区模型对目标图像进行分区,可以节省使用分类器来确定目标分区模型的时间。若图像处理装置确定目标分区模型不为第一分区模型,则图像处理装置停止使用第一分区模型对目标图像进行分区的操作,并使用目标分区模型重新对目标图像进行分区, 得到目标图像的分区结果。其中,所述第一分区模型为所述N个分区模型中精度最高的分区模型或进行图像分区操作耗时最长的分区模型。Optionally, the image recognition module is specifically configured to: when the target partition model is determined by using the classifier, the first partition model may be used in parallel to partition the target image. The first partition model may be the highest-precision partition model of the N partition models, or the partition model with the longest time for performing image partitioning operations, or a partition model determined by other standards. If the image processing apparatus determines that the target partition model is the first partition model, then continuing to partition the target image by using the first partition model, which is equivalent to the image processing apparatus directly partitioning the target image by using the first partition model after acquiring the target image. , you can save time using the classifier to determine the target partition model. If the image processing apparatus determines that the target partition model is not the first partition model, the image processing apparatus stops the operation of partitioning the target image using the first partition model, and re-partitions the target image using the target partition model. Get the partition result of the target image. The first partition model is the partition model with the highest precision among the N partition models or the partition model with the longest time for image partitioning operation.
可选的,模型确定模块还用于:通过神经网络的图像训练操作得到分类器。Optionally, the model determining module is further configured to: obtain a classifier by using an image training operation of the neural network.
可选的,模型确定模块可以通过如下方法训练得到该分类器:预先获取P张训练图像;对每张训练图像都使用该N个分区模型进行分区,并确定每个分区模型对每张训练图像进行分区的精度和时间的比值;然后将对第i张训练图像进行分区的精度和时间的比值最大的分区模型,确定为第i张图像对应的分区模型,1≤i≤P。在确定了每张训练图像对应的分区模型后,采用BP算法或其它算法,得到分类器。Optionally, the model determining module may train the classifier by: acquiring P training images in advance; using the N partition models for each training image, and determining each of the partition models for each training image. The ratio of the accuracy of the partition to the time is performed; then the partition model with the largest ratio of the precision of the partitioning of the i-th training image to the time is determined as the partition model corresponding to the i-th image, 1≤i≤P. After determining the partition model corresponding to each training image, the BP algorithm or other algorithms are used to obtain the classifier.
可选的,图像识别模块还用于:根据目标分区模型的精度,来确定其对应的分类模型的卷积核的目标大小,然后使用该目标大小的卷积核,对目标图像的分区结果进行分类,得到目标图像的分类结果。Optionally, the image recognition module is further configured to: determine a target size of the convolution kernel of the corresponding classification model according to the precision of the target partition model, and then use the convolution kernel of the target size to perform the partitioning result of the target image. Classification, and the classification result of the target image is obtained.
可选的,图像识别模块还用于:根据目标分区模型的精度,来确定其对应的分类模型的计算通道。若该目标分区模型是该N个分区模型中精度最高的分区模型,则并行使用浮点通道和定点通道对目标图像的分区结果进行分类。若该目标分区模型不是该N个分区模型中精度最高的模型,则仅使用浮点通道对目标图像的分区结果进行分类,得到目标图像的分类结果。Optionally, the image recognition module is further configured to: determine a calculation channel of the corresponding classification model according to the accuracy of the target partition model. If the target partition model is the most accurate partition model among the N partition models, the partitioning results of the target image are classified in parallel using the floating point channel and the fixed point channel. If the target partition model is not the most accurate model among the N partition models, the partition result of the target image is classified using only the floating point channel, and the classification result of the target image is obtained.
本发明的第三方面提供了一种计算机设备,包括处理器、存储器和通信接口,通过调用述存储器中的指令,该处理器用于执行本发明第一方面提供的图像处理方法。A third aspect of the invention provides a computer apparatus comprising a processor, a memory and a communication interface for performing the image processing method provided by the first aspect of the invention by invoking instructions in the memory.
本发明提供的图像处理方法中,图像处理装置获取目标图像,通过分类器在N个分区模型中确定目标图像对应的目标分区模型,然后使用目标分区模型对目标图像进行分区,得到目标图像的分区结果。本发明中的图像处理装置没有采用单一的分区模型,而是在N个分区模型中采用分类器选择合适的分区模型,这样就保证了图像处理装置对所有类型的图像都能够选择精度与速度都较为适宜的分区模型来对目标图像进行分区,能够满足实际需求。In the image processing method provided by the present invention, the image processing apparatus acquires a target image, determines a target partition model corresponding to the target image in the N partition models through a classifier, and then partitions the target image using the target partition model to obtain a partition of the target image. result. The image processing apparatus of the present invention does not adopt a single partition model, but uses a classifier to select an appropriate partition model in the N partition models, thereby ensuring that the image processing apparatus can select accuracy and speed for all types of images. A more suitable partition model to partition the target image can meet the actual needs.
附图说明DRAWINGS
图1为图像处理装置对图像进行检测识别的原理示意图; 1 is a schematic diagram showing the principle of detecting and recognizing an image by an image processing apparatus;
图2为本发明实施例中图像处理方法的一个实施例流程图;2 is a flowchart of an embodiment of an image processing method according to an embodiment of the present invention;
图3为本发明实施例中图像处理装置的一个实施例结构图;FIG. 3 is a structural diagram of an embodiment of an image processing apparatus according to an embodiment of the present invention; FIG.
图4为本发明实施例中计算设备的一个实施例结构图。FIG. 4 is a structural diagram of an embodiment of a computing device according to an embodiment of the present invention.
具体实施方式detailed description
本发明提供了一种图像处理方法以及装置,以下将分别进行描述。The present invention provides an image processing method and apparatus, which will be separately described below.
在图像处理领域,图像处理装置一般通过分区和分类两步操作来实现图像中目标的检测识别,如图1所示:图像分区模型接受输入的图像,并把输入的图像划分成大小不同的区域;图像分类模型采用卷积神经网络或其它分类算法,通过层次化结构不断提取图像每个区域的特征,最终识别出目标物体。In the field of image processing, the image processing apparatus generally realizes the detection and recognition of the target in the image through two steps of partitioning and classification, as shown in FIG. 1: the image partition model accepts the input image, and divides the input image into regions of different sizes. The image classification model uses a convolutional neural network or other classification algorithm to continuously extract the features of each region of the image through a hierarchical structure, and finally identify the target object.
在实际应用中,图像的尺寸、构图、复杂度等千变万化,不同的图像适宜用不同的分区算法来进行分区。因此现阶段技术针对不同种类的图像开发了多种分区模型。其中,不同的分区模型采用不同的图像分区算法,故在对同一副图像进行分区时,得到的分区结果的精度以及分区操作消耗的时长均不相同。但一般的,同一个分区模型无法同时兼顾精度与速度,精度较高的分区模型往往分区速度较慢,分区操作耗时较长;而分区速度快的分区模型往往精度较低。因此,精度较高的分区模型适合处理较为复杂的图像,以增加图像分区的可信度;精度较低的分区模型适合处理较为简单的图像,以加快图像分区的速度。In practical applications, the size, composition, complexity, etc. of images are ever-changing, and different images are suitable for partitioning with different partitioning algorithms. So at this stage the technology has developed multiple partition models for different kinds of images. Among them, different partition models use different image partitioning algorithms, so when partitioning the same sub-image, the accuracy of the obtained partitioning result and the duration of the partitioning operation are different. However, in general, the same partition model cannot take into account both accuracy and speed. The partition model with higher precision tends to have slower partition speed and longer partition operation. The partition model with fast partition speed tends to be less accurate. Therefore, the higher precision partition model is suitable for processing more complex images to increase the credibility of image partitioning; the lower precision partition model is suitable for processing simpler images to speed up image partitioning.
现阶段的技术中,图像处理装置往往采用单一固定的分区模型,而单一的分区模型不能满足所有图像对精度和速度的要求。为此,本发明提供了一种图像处理方法,能够针对不同的图像采用不同的分区模型,其基本流程请参阅图2,包括In the current technology, image processing devices often use a single fixed partition model, and a single partition model cannot meet the accuracy and speed requirements of all images. To this end, the present invention provides an image processing method capable of adopting different partition models for different images, and the basic flow thereof is shown in FIG. 2, including
201、获取待处理的目标图像;201. Acquire a target image to be processed.
202、使用分类器确定目标图像对应的目标分区模型;202. Determine, by using a classifier, a target partition model corresponding to the target image.
本发明中,图像处理装置可以从N个分区模型中,确定目标图像对应的目标分区模型。其中,该N个分区模型可以由图像处理装置保存在本地,并在使用时从本地读取得到;也可以由图像处理装置从其他地方获取得到,此处不做限定。其中,N为大于1的整数。 In the present invention, the image processing apparatus may determine a target partition model corresponding to the target image from the N partition models. The N partition models may be stored locally by the image processing device and may be locally read during use; or may be obtained from other places by the image processing device, which is not limited herein. Where N is an integer greater than one.
其中,确定的该目标分区模型应为该N个分区模型中,最适宜用来处理目标图像的分区模型。衡量该N个分区模型中哪个分区模型最适宜用来处理目标图像的方法有很多,例如可以认为对目标图像进行分区操作的精度和时间的比值最大的分区模型,为最适宜用来处理目标图像的分区模型。The determined target partition model should be the partition model of the N partition models that is most suitable for processing the target image. There are many methods for measuring which partition model of the N partition models is most suitable for processing the target image. For example, a partition model with the largest ratio of precision to time for partitioning the target image can be considered as the most suitable for processing the target image. Partition model.
其中,确定目标分区模型的方法有很多,本发明中采用分类器(英文:classifier)来确定目标分区模型。分类器的实质可以是一个分类函数或一个分类模型,该函数或模型能够把给定的图像样本分为N类,每一类对应一个分区模型,从而实现将图像映射到该N个分区模型中的一个分区模型的功能。图像分类装置将目标图像输入到分类器,就能够根据分类器的输出确定目标分区模型。其中,该分类器可以由图像处理装置保存在本地,并在使用时从本地读取得到;也可以由图像处理装置从其他地方获取得到;或者由具有处理功能的硬件单元来作为分类器,接收图像分类装置输入的目标图像,输出确定的目标分区模型给图像分类装置,此处不做限定。Among them, there are many methods for determining the target partition model. In the present invention, a classifier (English: classifier) is used to determine the target partition model. The essence of the classifier can be a classification function or a classification model, which can classify a given image sample into N classes, each class corresponding to a partition model, thereby mapping the image into the N partition models. The functionality of a partition model. The image classification device inputs the target image to the classifier, and can determine the target partition model based on the output of the classifier. Wherein, the classifier can be stored locally by the image processing device and read locally from use; it can also be obtained from other places by the image processing device; or can be received as a classifier by a hardware unit having a processing function. The target image input by the image classification device outputs the determined target partition model to the image classification device, which is not limited herein.
其中,图像处理装置也可以根据神经网络的训练操作,自行生成该分类器。具体的,图像处理装置可以预先获取P张训练图像,然后确定每张训练图像中边缘检测结果大于第一阈值的区域的第一个数,然后根据该第一个数,确定每张训练图像对应的分区模型;或,确定每张训练图像中置信度大于第二阈值的区域的第二个数,然后根据该第二个数,确定每张训练图像对应的分区模型;或,对每张训练图像都使用该N个分区模型进行分区,并确定每个分区模型对每张训练图像进行分区的精度和时间的比值,或每个分区模型对每张训练图像进行分区的置信度、或每个分区模型对每张训练图像进行分区的边缘检测结果。然后根据该比值、置信度或边缘检测结果确定每张训练图像对应的分区模型,例如:对第i张训练图像进行分区的精度和时间的比值最大的分区模型,就是第i张图像对应的分区模型,1≤i≤P。在确定了每张训练图像对应的分区模型后,就可以采用BP算法或其它算法,得到分类器。只要P张训练图像覆盖了各种类型的图像,且P值取得足够大,就能保证分类器具有满足实际需求的分类效果。通过这样的方法得到的分类器,能够将该N个分区模型中,对目标图像进行分区的精度和时间的比值最大的分区模型确定为该目标图像的目标分区模型。 The image processing device may also generate the classifier by itself according to the training operation of the neural network. Specifically, the image processing apparatus may acquire P training images in advance, and then determine a first number of regions in each training image whose edge detection result is greater than the first threshold, and then determine, according to the first number, each training image a partitioning model; or, determining a second number of regions in each training image with a confidence greater than a second threshold, and then determining a partition model corresponding to each training image based on the second number; or, for each training session The images are partitioned using the N partition models, and the ratio of the accuracy and time of each partition model to each training image is determined, or the confidence of each partition model for partitioning each training image, or each The partition model performs the edge detection result of each training image. Then, according to the ratio, the confidence or the edge detection result, the partition model corresponding to each training image is determined. For example, the partition model with the highest ratio of precision and time for partitioning the i-th training image is the partition corresponding to the i-th image. Model, 1 ≤ i ≤ P. After determining the partition model corresponding to each training image, the BP algorithm or other algorithms can be used to obtain the classifier. As long as the P training images cover various types of images, and the P value is sufficiently large, the classifier can be guaranteed to have a classification effect that satisfies the actual needs. The classifier obtained by such a method can determine, as the target partition model of the target image, the partition model in which the ratio of the accuracy of the partitioning of the target image and the time is the largest among the N partition models.
203、使用目标分区模型对目标图像进行分区,得到目标图像的分区结果。203. Partition the target image by using a target partition model to obtain a partition result of the target image.
图像处理装置在确定了目标分区模型后,使用目标分区模型对目标图像进行分区,得到目标图像的分区结果。After determining the target partition model, the image processing apparatus partitions the target image using the target partition model to obtain a partition result of the target image.
上文的论述中提到,模型精度越高,则模型进行分区操作的时间就越长。因此若最终确定的目标分区模型为精度较高的模型,则后续还要花费较长的时间用于图像分区操作。为了缩短图像处理的时间,可选的,图像处理装置在执行步骤202的同时,还可以执行步骤204:As mentioned in the above discussion, the higher the accuracy of the model, the longer the model will perform the partitioning operation. Therefore, if the final target partition model is a model with higher precision, it will take a longer time for the image partitioning operation. In order to shorten the time of image processing, optionally, the image processing apparatus may perform step 204 while performing step 202:
204、使用第一分区模型对目标图像进行分区。204. Partition the target image using the first partition model.
图像处理装置使用第一分区模型对目标图像进行分区,其中,第一分区模型可以为该N个分区模型中精度最高的模型。也可以为该N个分区模型中进行图像分区操作耗时最长的模型。也可以为按照其它标准在该N个分区模型中确定的模型,此处不做限定。The image processing apparatus partitions the target image using the first partition model, wherein the first partition model may be the most accurate model among the N partition models. It is also possible to model the longest time for image partitioning in the N partition models. It may also be a model determined in the N partition models according to other standards, which is not limited herein.
由于第一分区模型的精度较高,图像分区操作时间较长,因此在图像处理装置执行完步骤202确定了目标分区模型后,步骤204并没有执行完成。此时,图像处理装置执行步骤203。具体的,若目标分区模型为第一分区模型,则继续使用第一分区模型对目标图像进行分区,并将第一分区模型的分区结果作为目标图像的分区结果。在这种情况下,由于步骤202与使用第一分区模型进行分区的操作同时进行,因此可以节约执行步骤202所花费的时间。若目标分区模型不为第一分区模型,则图像处理装置停止使用第一分区模型对目标图像进行分区的操作,并使用确定的目标分区模型对目标图像进行分区,得到目标图像的分区结果。Since the accuracy of the first partition model is high and the image partitioning operation time is long, after the image processing apparatus performs the step 202 to determine the target partition model, the step 204 is not performed. At this time, the image processing apparatus performs step 203. Specifically, if the target partition model is the first partition model, the target image is further partitioned by using the first partition model, and the partition result of the first partition model is used as the partition result of the target image. In this case, since step 202 is performed simultaneously with the operation of partitioning using the first partition model, the time taken to perform step 202 can be saved. If the target partition model is not the first partition model, the image processing apparatus stops the operation of partitioning the target image using the first partition model, and partitions the target image using the determined target partition model to obtain a partition result of the target image.
上文的论述中有提到,不同的分区模型采用了不同的算法,适宜处理不同类型的图像。因此在实际中并不一定能够严格确定哪个模型的精度最高或分区操作耗时最长。例如,假设对于图像1来说,采用模型1进行图像分区得到的分区结果的精度最高;但是对于图像2来说,采用模型1进行图像分区得到的分区结果的精度可能并不很高,反而采用模型2进行图像分区得到的分区结果的精度最高。因此,该第一分区模型实际上可以为该N个分区模型中人为指定的、或图像处理装置默认指定的分区模型。例如,图像处理装置中可以预置有该N个分区模型的精度高低关系,第一分区模型即为该N个分区模型中精 度最高的分区模型。或,图像处理装置中可以预置有该N个分区模型进行图像分区操作的耗时长短关系,第一分区模型即为该N个分区模型中进行图像分区操作耗时最长的分区模型。其中,该精度高低关系或耗时长短关系均可以由图像处理装置获取得到,或由图像处理装置自行确定,或由人为设定。As mentioned in the above discussion, different partition models use different algorithms to handle different types of images. Therefore, in practice, it is not always possible to strictly determine which model has the highest accuracy or the partition operation takes the longest. For example, suppose that for Image 1, the partitioning result obtained by using Model 1 for image partitioning has the highest accuracy; but for Image 2, the accuracy of the partitioning result obtained by using Model 1 for image partitioning may not be very high, but instead The partitioning result obtained by model 2 for image partitioning has the highest precision. Therefore, the first partition model may actually be a partition model that is manually specified in the N partition models or specified by the image processing apparatus by default. For example, the image processing device may preset the accuracy relationship of the N partition models, and the first partition model is the fine in the N partition models. The highest partition model. Alternatively, the image processing apparatus may preset a time-consuming relationship between the N partition models for performing an image partitioning operation, and the first partition model is a partition model that takes the longest image partitioning operation in the N partition models. The accuracy relationship or the time-consuming relationship may be obtained by the image processing device, or determined by the image processing device, or manually set.
可选的,图像处理装置在执行步骤202的同时,除了并行使用第一分区模型对目标图像进行分区之外,也可以同时使用第二分区模型、第三分区模型或更多的分区模型执行对目标图像进行分区的操作,其原理与步骤204类似,此处不做赘述。但是,并行对图像进行分区操作的分区模型越多,图像处理装置的处理器的使用率就越高,内存占用率就越大。因此在实际应用中,应综合图像处理装置的性能,选择并行对目标图像进行图像分区操作的分区模型。Optionally, the image processing apparatus performs the step 202, in addition to using the first partition model to partition the target image in parallel, and simultaneously performing the pair using the second partition model, the third partition model, or more partition models. The operation of partitioning the target image is similar to the step 204, and is not described here. However, the more partition models that perform the partitioning operation on the image in parallel, the higher the utilization rate of the processor of the image processing apparatus, and the larger the memory usage. Therefore, in practical applications, the performance of the image processing apparatus should be integrated, and a partition model for performing image partitioning operations on the target image in parallel should be selected.
本发明实施例提供的图像处理方法中,图像处理装置获取目标图像,通过分类器在N个分区模型中确定目标图像对应的目标分区模型,然后使用目标分区模型对目标图像进行分区,得到目标图像的分区结果。本发明实施例中的图像处理装置没有采用单一的分区模型,而是在N个分区模型中采用分类器选择合适的分区模型,这样就保证了图像处理装置对所有类型的图像都能够选择精度与速度都较为适宜的分区模型来对目标图像进行分区,能够满足实际需求。In the image processing method provided by the embodiment of the present invention, the image processing apparatus acquires a target image, determines a target partition model corresponding to the target image in the N partition models by using a classifier, and then partitions the target image by using the target partition model to obtain a target image. Partition results. The image processing apparatus in the embodiment of the present invention does not adopt a single partition model, but uses a classifier to select an appropriate partition model in the N partition models, thereby ensuring that the image processing apparatus can select accuracy for all types of images. Partition models with better speeds are used to partition the target image to meet actual needs.
图像分区装置在对目标图像进行分区之后,还需要进行图像分类操作。具体的,图像处理装置可以通过分类模型,采用浮点或定点通道,使用固定大小的卷积核(英文:convolution matrix或convolution kernel)对目标图像进行分类。与图像分区操作类似的,对于较为复杂的图像适宜采用精度较高、速度较慢的分类模型,较为简单的图像适宜采用精度较低、速度较快的分类模型。而图像的复杂程度可以由目标分区模型的精度来体现。因此可选的,本发明中,图像处理装置可以根据目标分区模型的精度,来确定其对应的分类模型的卷积核的目标大小,然后使用该目标大小的卷积核,对目标图像的分区结果进行分类,得到目标图像的分类结果。这样的方法能够使得较为复杂的图像由较大的卷积核来进行分类,较为简单的图像由较小的卷积核来进行分类,兼顾了分类计算的精度和速度。After the image partitioning device partitions the target image, an image sorting operation is also required. Specifically, the image processing apparatus may classify the target image by using a fixed-size convolution kernel (English: convolution matrix or convolution kernel) by using a classification model, using a floating point or a fixed-point channel. Similar to the image partitioning operation, it is suitable to use a classification model with higher precision and slower speed for more complex images. A simpler image is suitable for a classification model with lower precision and faster speed. The complexity of the image can be reflected by the accuracy of the target partition model. Therefore, in the present invention, the image processing apparatus may determine the target size of the convolution kernel of the corresponding classification model according to the accuracy of the target partition model, and then use the convolution kernel of the target size to partition the target image. The results are classified to obtain the classification result of the target image. Such a method can classify more complex images by a larger convolution kernel, and a simpler image is classified by a smaller convolution kernel, taking into account the accuracy and speed of the classification calculation.
又可选的,图像处理装置可以根据目标分区模型的精度,来确定其对应的 分类模型的计算通道,例如:若该目标分区模型是该N个分区模型中精度最高的分区模型(或精度前n高的分区模型之一,n<N),则图像处理装置可以并行使用浮点通道和定点通道对目标图像的分区结果进行分类,得到目标图像的分类结果。并行使用浮点通道和定点通道能够加快分类操作的速度,提高图像分类的效率。若该目标分区模型不是该N个分区模型中精度最高的模型(或精度前n高的分区模型之一),则图像处理装置可以仅使用浮点通道对目标图像的分区结果进行分类。Alternatively, the image processing apparatus may determine the corresponding image according to the accuracy of the target partition model. The calculation channel of the classification model, for example, if the target partition model is the most accurate partition model among the N partition models (or one of the top n high-resolution partition models, n<N), the image processing apparatus can use the floating in parallel The point channel and the fixed point channel classify the segmentation result of the target image to obtain the classification result of the target image. Parallel use of floating point channels and fixed point channels can speed up the classification operation and improve the efficiency of image classification. If the target partition model is not the most accurate model of the N partition models (or one of the top n high-precision partition models), the image processing apparatus may classify the partition results of the target image using only the floating point channel.
图2所示的实施例介绍了本发明提供的图像处理方法,下面将介绍一种用于实现上述方法的图像处理装置,其基本结构请参阅图3,包括:The embodiment shown in FIG. 2 introduces an image processing method provided by the present invention. An image processing apparatus for implementing the above method will be described below. The basic structure of the image processing apparatus is as follows:
图像获取模块301,用于执行图2所示的实施例中的步骤201;The image acquisition module 301 is configured to perform step 201 in the embodiment shown in FIG. 2;
模型确定模块302,用于执行图2所示的实施例中的步骤202;The model determining module 302 is configured to perform step 202 in the embodiment shown in FIG. 2;
图像识别模块303,用于执行图2所示的实施例中的步骤203,可选的,还可以执行步骤204。The image recognition module 303 is configured to perform step 203 in the embodiment shown in FIG. 2 . Optionally, step 204 can also be performed.
图像处理装置各模块的功能可以参考图2所示的方法实施例中的描述,此处不做赘述。For the functions of the modules of the image processing apparatus, reference may be made to the description in the method embodiment shown in FIG. 2, and details are not described herein.
可选的,图像识别模块303还可以用于根据目标分区模型的精度,确定目标分区模型对应的卷积核的目标大小,并使用该目标大小的卷积核,对目标图像的分区结果进行分类得到分类结果。Optionally, the image recognition module 303 is further configured to determine a target size of the convolution kernel corresponding to the target partition model according to the precision of the target partition model, and use the convolution kernel of the target size to classify the partition result of the target image. Get the classification results.
可选的,图像识别模块还可用于在目标分区模型不是该N个分区模型中精度最高的分区模型时,并行使用浮点通道和定点通道对目标图像的分区结果进行分类得到目标图像的分类结果。Optionally, the image recognition module is further configured to perform classification of the target image by using a floating point channel and a fixed point channel in parallel when the target partition model is not the highest precision partition model of the N partition models. .
本发明实施例还提供了一种计算设备400,用于实现图2所示的实施例中的图像处理方法。其基本结构请参阅图4。该计算设备具体包括处理器401、存储器402、总线403和通信接口404。其中,处理器401、存储器402和通信接口404可以通过总线403实现彼此之间的通信连接,也可以通过无线传输等其他手段实现通信。The embodiment of the present invention further provides a computing device 400 for implementing the image processing method in the embodiment shown in FIG. 2. See Figure 4 for the basic structure. The computing device specifically includes a processor 401, a memory 402, a bus 403, and a communication interface 404. The processor 401, the memory 402, and the communication interface 404 can implement communication connection with each other through the bus 403, and can also implement communication by other means such as wireless transmission.
存储器402存储器可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文: read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器402还可以包括上述种类的存储器的组合。计算设备400运行时,存储器402加载该N个分区模型、该N个分区模型的精度高低关系或耗时长短关系、分类器、各分类模型等内容以供处理器401使用。在通过软件来实现本发明提供的技术方案时,用于实现本发明提供的图像处理方法的程序代码可以保存在存储器402中,并由处理器401来执行。The memory 402 memory may include a volatile memory (English: volatile memory), such as random access memory (English: random-access memory, abbreviation: RAM); the memory may also include non-volatile memory (English: non-volatile memory) ), such as read-only memory (English: Read-only memory, abbreviated as: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); memory 402 Combinations of the above types of memory may also be included. When the computing device 400 is running, the memory 402 loads the N partition models, the accuracy relationship or the time-consuming relationship of the N partition models, the classifier, each classification model, and the like for use by the processor 401. When the technical solution provided by the present invention is implemented by software, the program code for implementing the image processing method provided by the present invention may be stored in the memory 402 and executed by the processor 401.
计算设备400通过通信接口404获取目标图像,并将对目标图像的分类结果通过通信接口404返回给用户。Computing device 400 acquires the target image via communication interface 404 and returns the classification result for the target image to the user via communication interface 404.
处理器401可以为中央处理器(英文:central processing unit,简称:CPU)、图形处理器(英文:graphics processing unit,缩写:GPU)、数字信号处理(英文:digital signal processing,缩写:DSP)、现场可编程门阵列(英文:field-programmable gate array,缩写:FPGA)、硬件芯片等具有处理功能的硬件单元中的任意一种或几种的组合。处理器401主要用于获取待处理的目标图像;使用分类器确定目标图像对应的目标分区模型,同时使用第一分区模型对目标图像进行分区;在确定了目标分区模型后,使用目标分区模型对目标图像进行分区,得到目标图像的分区结果;根据目标分区模型的精度,来确定其对应的分类模型的卷积核的目标大小以及对应的浮点和/或定点计算通道,然后使用该目标大小的卷积核以及计算通道,对目标图像的分区结果进行分类,得到目标图像的分类结果。The processor 401 can be a central processing unit (English: central processing unit, CPU for short), a graphics processing unit (English: graphics processing unit (abbreviation: GPU), digital signal processing (English: digital signal processing, abbreviation: DSP), A combination of any one or more of the hardware units having processing functions, such as a field-programmable gate array (English: field-programmable gate array). The processor 401 is mainly configured to acquire a target image to be processed; use a classifier to determine a target partition model corresponding to the target image, and use the first partition model to partition the target image; after determining the target partition model, use the target partition model pair The target image is partitioned to obtain a partition result of the target image; according to the accuracy of the target partition model, the target size of the convolution kernel of the corresponding classification model and the corresponding floating point and/or fixed point calculation channel are determined, and then the target size is used. The convolution kernel and the calculation channel classify the partition result of the target image to obtain the classification result of the target image.
在本申请所提供的几个实施例中,应该理解到,所揭露的计算设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed computing device, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be another division manner, for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一 个单元中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated in one In the unit. The above integrated modules can be implemented in the form of hardware or in the form of software functional units.
所述集成的模块如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The integrated modules, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents of the technical solutions of the embodiments of the present invention.

Claims (18)

  1. 一种图像处理方法,适用于图像处理装置,其特征在于,包括:An image processing method, which is applicable to an image processing apparatus, and includes:
    获取待处理的目标图像;Obtaining a target image to be processed;
    在N个分区模型中,使用分类器确定所述目标图像对应的目标分区模型,所述N为大于1的整数;In the N partition models, a classifier is used to determine a target partition model corresponding to the target image, and the N is an integer greater than 1;
    使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果。The target image is partitioned using the target partition model to obtain a partition result of the target image.
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述方法在所述使用分类器确定所述目标图像对应的目标分区模型时,还包括:The image processing method according to claim 1, wherein the method further comprises: when the using the classifier to determine a target partition model corresponding to the target image,
    使用第一分区模型对所述目标图像进行分区,其中,所述第一分区模型为所述N个分区模型中精度最高的分区模型或进行图像分区操作耗时最长的分区模型;Partitioning the target image using a first partition model, wherein the first partition model is the highest-precision partition model among the N partition models or a partition model that takes the longest time to perform an image partitioning operation;
    所述使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果包括:The partitioning the target image by using the target partition model, and obtaining the partition result of the target image includes:
    若所述目标分区模型为所述第一分区模型,则继续使用所述第一分区模型对所述目标图像进行分区,并将所述第一分区模型的分区结果作为所述目标图像的分区结果;If the target partition model is the first partition model, continue to partition the target image by using the first partition model, and use a partition result of the first partition model as a partition result of the target image. ;
    若所述目标分区模型不为所述第一分区模型,则停止所述使用第一分区模型对所述目标图像进行分区的操作,并使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果。If the target partition model is not the first partition model, stopping the operation of partitioning the target image by using a first partition model, and partitioning the target image by using the target partition model to obtain The partition result of the target image.
  3. 根据权利要求1或2所述的图像处理方法,其特征在于,所述方法在所述获取待处理的目标图像之前还包括:The image processing method according to claim 1 or 2, wherein the method further comprises: before the acquiring the target image to be processed:
    通过神经网络的图像训练操作,得到所述分类器,所述分类器用于在所述N个分区模型中,确定所述目标图像对应的目标分区模型。The classifier is obtained by an image training operation of a neural network, and the classifier is configured to determine a target partition model corresponding to the target image in the N partition models.
  4. 根据权利要求3所述的图像处理方法,其特征在于,所述通过神经网络的图像训练操作,得到所述分类器包括:The image processing method according to claim 3, wherein the obtaining the classifier by the image training operation of the neural network comprises:
    获取P张训练图像;Obtain P training images;
    使用所述N个分区模型对所述P张训练图像进行分区,并分别确定每个分区模型对每张训练图像进行分区的精度和时间的比值; And dividing the P training images by using the N partition models, and respectively determining a ratio of accuracy and time of each partition image to partitioning each training image;
    根据所述每个分区模型对每张训练图像进行分区的精度和时间的比值,确定每张训练图像对应的分区模型,其中,所述P张训练图像中的第i张训练图像对应的分区模型为:对所述第i张图像进行分区的精度和时间的比值最大的分区模型,1≤i≤P;Determining a partition model corresponding to each training image according to a ratio of accuracy and time of each training image to each of the training models, wherein the partition model corresponding to the i-th training image in the P training images a partitioning model having the largest ratio of precision to time for partitioning the i-th image, 1 ≤ i ≤ P;
    根据所述P张训练图像对应的分区模型进行训练,得到所述分类器,所述分类器用于在所述N个分区模型中,将对所述目标图像进行分区的精度和时间的比值最大的分区模型确定为所述目标图像对应的目标分区模型。Performing training according to the partition model corresponding to the P training images, and obtaining the classifier, wherein the classifier is configured to maximize a ratio of accuracy and time of partitioning the target image in the N partition models. The partition model is determined as a target partition model corresponding to the target image.
  5. 根据权利要求1至4中任一项所述的图像处理方法,其特征在于,所述方法还包括:The image processing method according to any one of claims 1 to 4, further comprising:
    根据所述目标分区模型的精度,确定所述目标分区模型对应的卷积核的目标大小;Determining, according to an accuracy of the target partition model, a target size of a convolution kernel corresponding to the target partition model;
    使用所述目标大小的卷积核,对所述目标图像的分区结果进行分类,得到所述目标图像的分类结果。Using the convolution kernel of the target size, classifying the partitioning result of the target image to obtain a classification result of the target image.
  6. 根据权利要求1至5中任一项所述的图像处理方法,其特征在于,所述方法还包括:The image processing method according to any one of claims 1 to 5, further comprising:
    若所述目标分区模型不是所述N个分区模型中精度最高的分区模型,则并行使用浮点通道和定点通道对所述目标图像的分区结果进行分类,得到所述目标图像的分类结果。If the target partition model is not the most accurate partition model among the N partition models, the partitioning results of the target image are classified in parallel using a floating point channel and a fixed point channel to obtain a classification result of the target image.
  7. 一种图像处理装置,其特征在于,包括:An image processing apparatus, comprising:
    图像获取模块,用于获取待处理的目标图像;An image acquisition module, configured to acquire a target image to be processed;
    模型确定模块,用于在N个分区模型中,使用分类器确定所述目标图像对应的目标分区模型,所述N为大于1的整数;a model determining module, configured to determine, in the N partition models, a target partition model corresponding to the target image by using a classifier, where N is an integer greater than 1;
    图像识别模块,用于使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果。And an image recognition module, configured to partition the target image by using the target partition model to obtain a partition result of the target image.
  8. 根据权利要求1所述的图像处理装置,其特征在于,所述图像识别模块具体用于:The image processing device according to claim 1, wherein the image recognition module is specifically configured to:
    在所述使用分类器确定所述目标图像对应的目标分区模型时,使用第一分区模型对所述目标图像进行分区,其中,所述第一分区模型为所述N个分区模型中精度最高的分区模型或进行图像分区操作耗时最长的分区模型; And when the using the classifier to determine a target partition model corresponding to the target image, partitioning the target image by using a first partition model, wherein the first partition model is the highest precision among the N partition models The partition model or the partition model that takes the longest time for image partitioning;
    在所述模型确定模块得到所述目标图像的分区结果后,若所述目标分区模型为所述第一分区模型,则继续使用所述第一分区模型对所述目标图像进行分区,并将所述第一分区模型的分区结果作为所述目标图像的分区结果;若所述目标分区模型不为所述第一分区模型,则停止所述使用第一分区模型对所述目标图像进行分区的操作,并使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果。After the model determining module obtains the partitioning result of the target image, if the target partitioning model is the first partitioning model, continuing to partition the target image by using the first partitioning model, and The partition result of the first partition model is used as a partition result of the target image; if the target partition model is not the first partition model, stopping the partitioning of the target image using the first partition model And partitioning the target image using the target partition model to obtain a partition result of the target image.
  9. 根据权利要求7或8所述的图像处理装置,其特征在于,所述模型确定模块还用于:The image processing apparatus according to claim 7 or 8, wherein the model determining module is further configured to:
    通过神经网络的图像训练操作,得到所述分类器,所述分类器用于在所述N个分区模型中,确定所述目标图像对应的目标分区模型。The classifier is obtained by an image training operation of a neural network, and the classifier is configured to determine a target partition model corresponding to the target image in the N partition models.
  10. 根据权利要求9所述的图像处理装置,其特征在于,所述模型确定模块还用于:The image processing device according to claim 9, wherein the model determining module is further configured to:
    获取P张训练图像;Obtain P training images;
    使用所述N个分区模型对所述P张训练图像进行分区,并分别确定每个分区模型对每张训练图像进行分区的精度和时间的比值;And dividing the P training images by using the N partition models, and respectively determining a ratio of accuracy and time of each partition image to partitioning each training image;
    根据所述每个分区模型对每张训练图像进行分区的精度和时间的比值,确定每张训练图像对应的分区模型,其中,第i张训练图像对应的分区模型为:对所述第i张图像进行分区的精度和时间的比值最大的分区模型,1≤i≤P;Determining a partition model corresponding to each training image according to the ratio of the accuracy of the partitioning of each training image to each of the partition models, wherein the partition model corresponding to the i-th training image is: for the ith sheet The partition model with the largest ratio of accuracy and time of image partitioning, 1≤i≤P;
    根据所述P张训练图像对应的分区模型进行训练,得到所述分类器,所述分类器用于在所述N个分区模型中,将对所述目标图像进行分区的精度和时间的比值最大的分区模型确定为所述目标图像对应的目标分区模型。Performing training according to the partition model corresponding to the P training images, and obtaining the classifier, wherein the classifier is configured to maximize a ratio of accuracy and time of partitioning the target image in the N partition models. The partition model is determined as a target partition model corresponding to the target image.
  11. 根据权利要求7至10中任一项所述的图像处理装置,其特征在于,所述图像识别模块还用于:The image processing device according to any one of claims 7 to 10, wherein the image recognition module is further configured to:
    根据所述目标分区模型的精度,确定所述目标分区模型对应的卷积核的目标大小;使用所述目标大小的卷积核,对所述目标图像的分区结果进行分类,得到所述目标图像的分类结果。Determining, according to an accuracy of the target partition model, a target size of a convolution kernel corresponding to the target partition model; using a convolution kernel of the target size, classifying a partition result of the target image to obtain the target image Classification results.
  12. 根据权利要求7至11中任一项所述的图像处理装置,其特征在于,所述图像识别模块还用于:The image processing device according to any one of claims 7 to 11, wherein the image recognition module is further configured to:
    在所述目标分区模型不是所述N个分区模型中精度最高的分区模型时, 并行使用浮点通道和定点通道对所述目标图像的分区结果进行分类,得到所述目标图像的分类结果。When the target partition model is not the highest precision partition model among the N partition models, The partitioning results of the target image are classified in parallel using a floating point channel and a fixed point channel to obtain a classification result of the target image.
  13. 一种计算机设备,其特征在于,包括处理器、存储器和通信接口,通过调用所述存储器中的指令,所述处理器用于:A computer device, comprising: a processor, a memory, and a communication interface, by calling an instruction in the memory, the processor is configured to:
    获取待处理的目标图像;Obtaining a target image to be processed;
    在N个分区模型中,使用分类器确定所述目标图像对应的目标分区模型,所述N为大于1的整数;In the N partition models, a classifier is used to determine a target partition model corresponding to the target image, and the N is an integer greater than 1;
    使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果。The target image is partitioned using the target partition model to obtain a partition result of the target image.
  14. 根据权利要求13所述的计算设备,其特征在于,所述处理器还用于:The computing device of claim 13, wherein the processor is further configured to:
    使用第一分区模型对所述目标图像进行分区,其中,所述第一分区模型为所述N个分区模型中精度最高的分区模型或进行图像分区操作耗时最长的分区模型;Partitioning the target image using a first partition model, wherein the first partition model is the highest-precision partition model among the N partition models or a partition model that takes the longest time to perform an image partitioning operation;
    所述使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果包括:The partitioning the target image by using the target partition model, and obtaining the partition result of the target image includes:
    若所述目标分区模型为所述第一分区模型,则继续使用所述第一分区模型对所述目标图像进行分区,并将所述第一分区模型的分区结果作为所述目标图像的分区结果;If the target partition model is the first partition model, continue to partition the target image by using the first partition model, and use a partition result of the first partition model as a partition result of the target image. ;
    若所述目标分区模型不为所述第一分区模型,则停止所述使用第一分区模型对所述目标图像进行分区的操作,并使用所述目标分区模型对所述目标图像进行分区,得到所述目标图像的分区结果。If the target partition model is not the first partition model, stopping the operation of partitioning the target image by using a first partition model, and partitioning the target image by using the target partition model to obtain The partition result of the target image.
  15. 根据权利要求13或14所述的计算设备,其特征在于,所述处理器还用于:The computing device of claim 13 or 14, wherein the processor is further configured to:
    通过神经网络的图像训练操作,得到所述分类器,所述分类器用于在所述N个分区模型中,确定所述目标图像对应的目标分区模型。The classifier is obtained by an image training operation of a neural network, and the classifier is configured to determine a target partition model corresponding to the target image in the N partition models.
  16. 根据权利要求15所述的计算设备,其特征在于,所述处理器还用于:The computing device of claim 15, wherein the processor is further configured to:
    获取P张训练图像;Obtain P training images;
    使用所述N个分区模型对所述P张训练图像进行分区,并分别确定每个分区模型对每张训练图像进行分区的精度和时间的比值; And dividing the P training images by using the N partition models, and respectively determining a ratio of accuracy and time of each partition image to partitioning each training image;
    根据所述每个分区模型对每张训练图像进行分区的精度和时间的比值,确定每张训练图像对应的分区模型,其中,第i张训练图像对应的分区模型为:对所述第i张图像进行分区的精度和时间的比值最大的分区模型,1≤i≤P;Determining a partition model corresponding to each training image according to the ratio of the accuracy of the partitioning of each training image to each of the partition models, wherein the partition model corresponding to the i-th training image is: for the ith sheet The partition model with the largest ratio of accuracy and time of image partitioning, 1≤i≤P;
    根据所述P张训练图像对应的分区模型进行训练,得到所述分类器,所述分类器用于在所述N个分区模型中,将对所述目标图像进行分区的精度和时间的比值最大的分区模型确定为所述目标图像对应的目标分区模型。Performing training according to the partition model corresponding to the P training images, and obtaining the classifier, wherein the classifier is configured to maximize a ratio of accuracy and time of partitioning the target image in the N partition models. The partition model is determined as a target partition model corresponding to the target image.
  17. 根据权利要求13至16中任一项所述的计算设备,其特征在于,所述处理器还用于:The computing device according to any one of claims 13 to 16, wherein the processor is further configured to:
    根据所述目标分区模型的精度,确定所述目标分区模型对应的卷积核的目标大小;Determining, according to an accuracy of the target partition model, a target size of a convolution kernel corresponding to the target partition model;
    使用所述目标大小的卷积核,对所述目标图像的分区结果进行分类,得到所述目标图像的分类结果。Using the convolution kernel of the target size, classifying the partitioning result of the target image to obtain a classification result of the target image.
  18. 根据权利要求13至17中任一项所述的计算设备,其特征在于,所述处理器还用于:The computing device according to any one of claims 13 to 17, wherein the processor is further configured to:
    若所述目标分区模型不是所述N个分区模型中精度最高的分区模型,则并行使用浮点通道和定点通道对所述目标图像的分区结果进行分类,得到所述目标图像的分类结果。 If the target partition model is not the most accurate partition model among the N partition models, the partitioning results of the target image are classified in parallel using a floating point channel and a fixed point channel to obtain a classification result of the target image.
PCT/CN2016/073473 2016-02-04 2016-02-04 Image processing method and related apparatus WO2017132933A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2016/073473 WO2017132933A1 (en) 2016-02-04 2016-02-04 Image processing method and related apparatus
CN201680000994.4A CN107735800B (en) 2016-02-04 2016-02-04 Image processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/073473 WO2017132933A1 (en) 2016-02-04 2016-02-04 Image processing method and related apparatus

Publications (1)

Publication Number Publication Date
WO2017132933A1 true WO2017132933A1 (en) 2017-08-10

Family

ID=59499308

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/073473 WO2017132933A1 (en) 2016-02-04 2016-02-04 Image processing method and related apparatus

Country Status (2)

Country Link
CN (1) CN107735800B (en)
WO (1) WO2017132933A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309033B (en) * 2019-07-15 2022-12-09 中国工商银行股份有限公司 Fault monitoring method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103679188A (en) * 2012-09-12 2014-03-26 富士通株式会社 Image classifier generating method and device as well as image classifying method and device
CN103854255A (en) * 2012-11-29 2014-06-11 比亚迪股份有限公司 Image enhancement method and image enhancement device
CN104079942A (en) * 2014-06-25 2014-10-01 华为技术有限公司 Image processing method, device and system
CN104871212A (en) * 2012-12-21 2015-08-26 皇家飞利浦有限公司 System and method for extracting physiological information from remotely detected electromagnetic radiation

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8175379B2 (en) * 2008-08-22 2012-05-08 Adobe Systems Incorporated Automatic video image segmentation
CN102799862A (en) * 2012-06-29 2012-11-28 陕西省交通规划设计研究院 System and method for pedestrian rapid positioning and event detection based on high definition video monitor image
CN103400156B (en) * 2013-07-04 2016-04-13 西安电子科技大学 Based on the High Resolution SAR image Ship Detection of CFAR and rarefaction representation
CN104537647B (en) * 2014-12-12 2017-10-20 中安消技术有限公司 A kind of object detection method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103679188A (en) * 2012-09-12 2014-03-26 富士通株式会社 Image classifier generating method and device as well as image classifying method and device
CN103854255A (en) * 2012-11-29 2014-06-11 比亚迪股份有限公司 Image enhancement method and image enhancement device
CN104871212A (en) * 2012-12-21 2015-08-26 皇家飞利浦有限公司 System and method for extracting physiological information from remotely detected electromagnetic radiation
CN104079942A (en) * 2014-06-25 2014-10-01 华为技术有限公司 Image processing method, device and system

Also Published As

Publication number Publication date
CN107735800B (en) 2021-09-14
CN107735800A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
TWI766855B (en) A character recognition method and device
KR101899530B1 (en) Techniques for distributed optical character recognition and distributed machine language translation
US10534984B1 (en) Adjusting training set combination based on classification accuracy
KR101856119B1 (en) Techniques for distributed optical character recognition and distributed machine language translation
US11023206B2 (en) Dot product calculators and methods of operating the same
CN112580416A (en) Video tracking based on deep Siam network and Bayesian optimization
US20210224598A1 (en) Method for training deep learning model, electronic equipment, and storage medium
KR20170125720A (en) Recognition apparatus based on deep neural network, training apparatus and methods thereof
Pestana et al. A full featured configurable accelerator for object detection with YOLO
CN105308618B (en) Face recognition by means of parallel detection and tracking and/or grouped feature motion shift tracking
CN109598250B (en) Feature extraction method, device, electronic equipment and computer readable medium
US20200184245A1 (en) Improper neural network input detection and handling
CN110543879A (en) SSD target detection method based on SE module and computer storage medium
KR20150105847A (en) Method and Apparatus for detecting speech segment
WO2020199498A1 (en) Palmar digital vein comparison method and device, computer apparatus, and storage medium
WO2022011898A1 (en) Three-dimensional reconstruction method, apparatus, and device, and computer readable storage medium
WO2017132933A1 (en) Image processing method and related apparatus
US11459093B2 (en) Winglet airfoils
WO2023109086A1 (en) Character recognition method, apparatus and device, and storage medium
TWI777319B (en) Method and device for determining stem cell density, computer device and storage medium
US20220122341A1 (en) Target detection method and apparatus, electronic device, and computer storage medium
US20220391676A1 (en) Quantization evaluator
US11080540B2 (en) 3D vision processing using an IP block
US20110099215A1 (en) System and method to identify a median value
KR20210087494A (en) Human body orientation detection method, apparatus, electronic device and computer storage medium

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: 16888758

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16888758

Country of ref document: EP

Kind code of ref document: A1