WO2024066852A1 - 图像下采样方法及装置、计算机可读存储介质 - Google Patents
图像下采样方法及装置、计算机可读存储介质 Download PDFInfo
- Publication number
- WO2024066852A1 WO2024066852A1 PCT/CN2023/115222 CN2023115222W WO2024066852A1 WO 2024066852 A1 WO2024066852 A1 WO 2024066852A1 CN 2023115222 W CN2023115222 W CN 2023115222W WO 2024066852 A1 WO2024066852 A1 WO 2024066852A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- size
- sub
- images
- convolution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4046—Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
Definitions
- the present disclosure relates to the field of image processing, and in particular to an image downsampling method and device, and a computer-readable storage medium.
- an image There are two main purposes of reducing an image (or downsampling): 1. Make the image fit the size of the display area; 2. Generate a thumbnail of the corresponding image.
- the image is generally pre-processed by downsampling.
- video encoding technology based on deep learning often downsamples the video in order to reduce the amount of video transmission.
- the downsampling methods of images mainly adopt pooling downsampling and convolution downsampling.
- For an image with a size of M*N it is downsampled by s times, that is, an image with a size of (M/s)*(N/s) is obtained, where s should be a common divisor of M and N.
- an image downsampling method comprising: dividing an image into a plurality of sub-images in a first direction; convolving the plurality of sub-images in the first direction; splicing the plurality of sub-images in the first direction after the convolution to obtain a first down-sampled image of a first target size in the first direction; dividing the first down-sampled image into a plurality of sub-images in a second direction; convolving the plurality of sub-images in the second direction; splicing the plurality of sub-images in the second direction after the convolution to obtain a second down-sampled image of a first target size in the first direction and a second target size in the second direction.
- dividing an image into multiple sub-images in a first direction includes: determining a first size of a first sub-image based on a first initial size and a first target size of the image in the first direction; and dividing the image into multiple first sub-images of the first size and second sub-images of the second size when the first size is not a multiple of the first initial size of the image.
- the second size is the remainder of the first initial size of the image divided by the first size of the first sub-image, and the total number of the first sub-images is the result of rounding down the quotient of the first initial size of the image divided by the first size of the sub-image.
- dividing the image into a plurality of sub-images in a first direction includes: dividing the image into a plurality of first sub-images of a first size when the first size is a multiple of a first initial size of the image.
- convolving the plurality of sub-images in the first direction includes: convolving the first sub-image with a first convolution kernel to obtain a third sub-image of a third size, wherein the third size is smaller than the first size.
- convolving multiple sub-images in a first direction includes: determining a fourth size and a size of a second convolution kernel based on a total number of first sub-images, a third size of the first sub-images, and a first target size of the image; and convolving the second sub-image with the second convolution kernel to obtain a fourth sub-image of a fourth size, wherein the fourth size is smaller than the second size.
- determining a first size of a first sub-image according to a first initial size and a first target size of the image in a first direction includes: determining a size of a first convolution kernel according to the first initial size and the first target size of the image in the first direction, so that a difference between a ratio at which the third sub-image is reduced relative to the first sub-image and a ratio at which the fourth sub-image is reduced relative to the second sub-image is less than a threshold; determining a first size of the first sub-image according to the size of the first convolution kernel.
- one of the first direction and the second direction is a length direction of the image, and the other is a width direction of the image.
- the image downsampling method further includes: before dividing the image into multiple sub-images in a first direction, performing convolution processing or pooling processing on the image, so that the size of the processed image in the first direction and the second direction is one Nth of the size before processing, where N is a positive integer.
- the stride of the convolution is 1.
- dividing an image into multiple sub-images in a second direction includes: determining a fifth size of a fifth sub-image based on a second initial size and a second target size of the image in the second direction; and dividing the image into multiple fifth sub-images of the fifth size and a sixth sub-image of the sixth size when the fifth size is not a multiple of the second initial size of the image.
- the sixth size is the remainder of the second initial size of the image divided by the fifth size of the fifth sub-image, and the total number of fifth sub-images is the result of rounding down the quotient of the second initial size of the image divided by the fifth size of the fifth sub-image.
- dividing the image into a plurality of sub-images in the second direction comprises: dividing the image into a plurality of fifth sub-images of a fifth size if the fifth size is a submultiple of the second initial size of the image.
- convolving the multiple sub-images in the second direction includes: using a third convolution kernel to convolve the fifth sub-image to obtain a seventh sub-image of a seventh size, wherein the seventh size is smaller than the fifth size.
- convolving the plurality of sub-images in the second direction includes: determining an eighth size and a size of the fourth convolution kernel according to the total number of the fifth sub-images, the seventh size of the seventh sub-image, and the second target size of the image; and using the Four convolution kernels are used to convolve the sixth sub-image to obtain an eighth sub-image of an eighth size, where the eighth size is smaller than the sixth size.
- the fifth size of the fifth sub-image is determined according to the second initial size and the second target size of the image in the second direction, including: determining the size of the third convolution kernel according to the second initial size and the second target size of the image in the second direction, so that the difference between the ratio of the seventh sub-image to the fifth sub-image and the ratio of the eighth sub-image to the sixth sub-image is less than a threshold; determining the fifth size of the fifth sub-image according to the size of the third convolution kernel.
- an image downsampling device comprising: a first division module, configured to divide an image into a plurality of sub-images in a first direction; a first convolution module, configured to perform convolution on the plurality of sub-images in the first direction; a first stitching module, configured to stitch the plurality of sub-images in the first direction after the convolution, to obtain a first down-sampled image of a first target size in the first direction; a second division module, configured to divide the first down-sampled image into a plurality of sub-images in a second direction; a second convolution module, configured to perform convolution on the plurality of sub-images in the second direction; and a second stitching module, configured to stitch the plurality of sub-images in the second direction after the convolution, to obtain a second down-sampled image of a first target size in the first direction and a second target size in the second direction.
- a communication device comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the image downsampling method according to any embodiment of the present disclosure based on instructions stored in the memory.
- a computer storable medium on which computer program instructions are stored.
- the instructions are executed by a processor, the image downsampling method described in any embodiment of the present disclosure is implemented.
- FIG1 shows a flow chart of an image downsampling method according to some embodiments of the present disclosure
- FIG2 is a schematic diagram showing downsampling in a first direction according to some embodiments of the present disclosure
- FIG3 is a schematic diagram showing downsampling in a second direction according to some embodiments of the present disclosure
- FIG. 4 shows a schematic diagram of a convolution process or a pooling process according to some embodiments of the present disclosure.
- FIG5 shows a block diagram of an image downsampling apparatus according to some embodiments of the present disclosure
- FIG6 shows a block diagram of an image downsampling device according to some other embodiments of the present disclosure.
- FIG. 7 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
- pooling, convolution or linear downsampling methods are used to downsample images, but only proportional downsampling can be achieved, and the reduction ratio must be a divisor of the original size.
- the horizontal and vertical reduction ratios of pooling or convolution are the same, that is, the sizes that can be reduced in the horizontal and vertical directions of the image are mutually restricted, and downsampling with arbitrary reduction ratios cannot be achieved.
- c1 is the size of the image before reduction
- c2 is the size of the image after reduction
- p is the padding parameter (padding)
- k is the convolution kernel size
- s is the step parameter (stride).
- the size of the image reduction mainly depends on the step size. If you want to significantly reduce the size of the image, you need to increase s, but the larger s is, the more image information will be lost.
- FIG. 1 shows a flowchart of an image down-sampling method according to some embodiments of the present disclosure.
- the image downsampling method includes steps S1 to S6 .
- step S1 an image is divided into a plurality of sub-images in a first direction.
- FIG. 2 is a schematic diagram showing downsampling in a first direction according to some embodiments of the present disclosure.
- the first direction be the longitudinal direction of the image.
- the size of the complete image is (H’, W’), where H’ is the first initial size, i.e., the original height.
- H’ is the first initial size, i.e., the original height.
- the size of the sub-image is affected by the first initial size and the first target size to which the image needs to be reduced in the vertical direction.
- the extra part i.e., the remainder
- ⁇ h’ is used as the second sub-image ( ⁇ h’, W’)
- the sub-image of the lowest part separated is the second sub-image.
- the second size is the remainder of the first initial size of the image divided by the first size of the first sub-image
- H’ is the first initial size of the image before division
- patchSize is the first size
- M is the number of the first sub-image
- ⁇ h’ is the second size of the second sub-image.
- the image is divided into a plurality of first sub-images of a first size, where the first size is a submultiple of a first initial size of the image.
- the second sub-image is not needed.
- determining a first size of a first sub-image according to a first initial size and a first target size of an image in a first direction includes: determining a size of a first convolution kernel according to the first initial size and the first target size of the image in the first direction, so that a difference between a ratio at which the third sub-image is reduced relative to the first sub-image and a ratio at which the third sub-image is reduced relative to the first sub-image is less than a threshold; determining a first size of the first sub-image according to the size of the first convolution kernel.
- a suitable convolution kernel size is selected. After the convolution kernel size is selected, patchSize and M can be calculated according to formula (2).
- step S2 convolution is performed on multiple sub-graphs in the first direction.
- each first sub-image is convolved separately to obtain a third sub-image of (patchSize-stepH, W').
- the size of each first sub-image can be reduced to the same size.
- convolving multiple sub-images in a first direction includes: determining a fourth size and a size of a second convolution kernel based on a total number of first sub-images, a third size of the first sub-images, and a first target size of the image; and convolving the second sub-image with the second convolution kernel to obtain a fourth sub-image of a fourth size, wherein the fourth size is smaller than the second size.
- vertical multiple alignment can be performed first, and a convolution operation can be performed on the second sub-image ( ⁇ h’, W’) at the top (or bottom) of the image (H’, W’) to obtain a fourth sub-image of size ( ⁇ h, W’).
- stepH represents the size of each first sub-image reduced in the vertical direction
- (patchSize-stepH) is the third size
- ⁇ h is the fourth size of the reduced second sub-image
- patchSize is the first size
- M is the number of first sub-images
- H is the first target size of the entire image after reduction.
- the convolution kernel is in single column form, and the convolution kernel size is (k1,1), which can reduce the amount of calculation.
- the stride of the convolution is 1.
- the present disclosure can also reduce the image to the target size when the convolution step size is 1.
- the image can be reduced to any size while retaining more information.
- convolving multiple sub-images in a first direction includes: using a first convolution kernel to convolve the first sub-image to obtain a third sub-image of a third size, wherein the third size is smaller than the first size.
- the remaining image is divided into sub-images in the vertical direction, into multiple sub-images of the same size in the height direction, and then the sub-images are convolutionally downsampled in the vertical direction. After the convolution, the vertical sizes of the first and second sub-images are reduced, and the reduction ratios are similar.
- the first sub-image may be divided and convolved first, and then the second sub-image may be convolved to achieve vertical multiple alignment, or the first and second sub-images may be convolved simultaneously.
- step S3 multiple sub-images in the first direction after convolution are spliced to obtain a first down-sampled image of a first target size in the first direction.
- the plurality of first sub-images and second sub-images obtained in step S2 are spliced corresponding to their positions in the original image, and restored to the entire image vertically to obtain a vertically reduced image.
- k1 is the size of the first convolution kernel
- k2 is the size of the second convolution kernel
- M is the total number of the first sub-graph.
- step S4 the first down-sampled image is divided into a plurality of sub-images in a second direction.
- step S5 convolution is performed on the multiple sub-graphs in the second direction
- step S6 the multiple sub-images in the second direction after the convolution are spliced to obtain a second down-sampled image with a first target size in the first direction and a second target size in the second direction.
- dividing an image into multiple sub-images in a second direction includes: determining a fifth size of a fifth sub-image based on a second initial size and a second target size of the image in the second direction; and dividing the image into multiple fifth sub-images of the fifth size and a sixth sub-image of the sixth size when the fifth size is not a multiple of the second initial size of the image.
- the sixth size is the remainder of the second initial size of the image divided by the fifth size of the fifth sub-image, and the total number of fifth sub-images is the result of rounding down the quotient of the second initial size of the image divided by the fifth size of the fifth sub-image.
- dividing the image into a plurality of sub-images in the second direction comprises: dividing the image into a plurality of fifth sub-images of a fifth size if the fifth size is a submultiple of the second initial size of the image.
- convolving the multiple sub-images in the second direction includes: using a third convolution kernel to convolve the fifth sub-image to obtain a seventh sub-image of a seventh size, wherein the seventh size is smaller than the fifth size.
- convolving the plurality of sub-graphs in the second direction comprises:
- the eighth size and the size of the fourth convolution kernel are determined according to the total number of the fifth sub-image, the seventh size of the seventh sub-image and the second target size of the image; the sixth sub-image is convolved with the fourth convolution kernel to obtain an eighth sub-image of an eighth size, wherein the eighth size is smaller than the sixth size.
- determining the fifth size of the fifth sub-image according to the second initial size and the second target size of the image in the second direction includes: determining the size of the third convolution kernel according to the second initial size and the second target size of the image in the second direction, so that the ratio of the reduction of the seventh sub-image relative to the fifth sub-image is the same as the ratio of the reduction of the eighth sub-image relative to the sixth sub-image.
- the difference in the proportions is less than a threshold; and a fifth size of the fifth sub-image is determined according to the size of the third convolution kernel.
- one of the first direction and the second direction is a length direction of the image, and the other is a width direction of the image.
- FIG. 3 is a schematic diagram showing downsampling in a second direction according to some embodiments of the present disclosure.
- steps S1-S3 the reduction in the height direction has been achieved. Then, in steps S4-S6, the reduction in the width direction is achieved.
- the downsampling steps in the width direction are similar to those in the height direction. For details, please refer to steps S1-S3.
- the image before dividing the image into multiple sub-images in the first direction, the image is convolved, pooled, or linearly downsampled so that the size of the processed image in the first direction and the second direction is one-Nth of the size before processing, where N is a positive integer.
- FIG. 4 shows a schematic diagram of a convolution process or a pooling process according to some embodiments of the present disclosure.
- the original image (H, W) is first convolved or pooled and proportionally downsampled S times to (H', W'), as shown in formulas (7)(8)(9):
- the downsampling method disclosed in the present invention adopts convolutional deep learning image downsampling, which can autonomously learn image information and meet the image target requirements. Based on the idea of sub-image division, the present invention sequentially performs reduction in the first direction and the second direction, and can realize image downsampling of any size, decoupling the mutual constraint relationship between the horizontal and vertical reduction ratios of the image, that is, the horizontal and vertical reduction ratios can not affect each other.
- the downsampling method disclosed in the present invention can replace the existing machine learning image preprocessing method, involve the image downsampling process in the overall task training, and improve the task effect. For example, if the subsequent machine vision task is taken, the training sample label is the machine vision task label, and the weight of the convolution kernel is updated during the model training process.
- the downsampling method disclosed in the present invention can be combined with encoding, downstream tasks, etc. for training to improve encoding and task performance.
- the downsampling method according to the present disclosure is used to process the video, and the video is downsampled and then encoded, which can reduce the amount of data that needs to be processed and improve the compression rate.
- the first down-sampled image needs to be divided into a plurality of fifth sub-images of a fifth size in a width direction and a sixth sub-image of a sixth size.
- stepW k3-1
- the convolution step size s is 1, patchSize is the size of the fifth sub-image before convolution reduction, M is the total number of the fifth sub-image, ⁇ 'w is the size of the sixth sub-image before reduction. ⁇ w is the size of the sixth sub-image after reduction, that is, the eighth size of the eighth sub-image.
- the convolution operation is performed on the leftmost (or rightmost) sixth sub-image (1333, 10) of the vertical downsampled image (1333x1024).
- the convolution step is 1, so as to retain information as much as possible.
- the padding operation is VALID.
- the convolution kernel adopts a single column form (2, 1) to reduce the amount of calculation as much as possible.
- the convolution downsampling operation is performed on the remainder column (the sixth sub-image with a length of 10 columns), and the size of the reduced sixth sub-image is (1333, 9).
- the remaining image (1333, 1014) is divided into 78 fifth sub-images (1333, 13), and each sub-image is convolved to obtain a reduced sub-image size of (1333, 9).
- stride and padding parameters of the convolution and the convolution kernel size are not limited to the above values, and other values may be used as needed, which will not be described here.
- FIG5 shows a block diagram of an image down-sampling apparatus according to some embodiments of the present disclosure.
- the image downsampling device 5 includes a first division module 51 , a first convolution module 52 , a first stitching module 53 , a second division module 54 , a second convolution module 55 , and a second stitching module 56 .
- the first division module 51 is configured to divide the image into a plurality of sub-images in a first direction, for example, by executing step S1 as shown in FIG. 1 .
- the first convolution module 52 is configured to perform convolution on multiple sub-graphs in a first direction, for example, executing step S2 as shown in FIG. 1 .
- the first stitching module 53 is configured to stitch the multiple sub-images in the first direction after the convolution to obtain a first down-sampled image of a first target size in the first direction, for example, by executing step S3 as shown in FIG. 1 .
- the second division module 54 is configured to divide the first down-sampled image into a plurality of sub-images in a second direction, for example, by executing step S4 as shown in FIG. 1 .
- the second convolution module 55 is configured to perform convolution on multiple sub-graphs in the second direction, for example, executing step S5 as shown in FIG. 1 .
- the second stitching module 56 is configured to stitch the multiple sub-images in the second direction after the convolution to obtain a second down-sampled image with a first target size in the first direction and a second target size in the second direction, for example, by executing step S6 as shown in FIG. 1 .
- FIG6 shows a block diagram of an image down-sampling device according to some other embodiments of the present disclosure.
- the image downsampling device 6 includes a memory 61; and a processor 62 coupled to the memory 61, the memory 61 is used to store and execute the image downsampling method.
- the processor 62 is configured to execute the image downsampling method in any of some embodiments of the present disclosure based on the instructions stored in the memory 61.
- FIG. 7 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
- Computer system 70 may be in the form of a general-purpose computing device.
- Computer system 70 includes a memory 710, a processor 720, and a bus 700 that connects various system components.
- the memory 710 may include, for example, a system memory, a non-volatile storage medium, etc.
- the system memory may store, for example, an operating system, an application program, a boot loader, and other programs.
- the non-volatile storage medium may include volatile storage media, such as random access memory (RAM) and/or cache memory.
- RAM random access memory
- the non-volatile storage medium may store instructions for executing the image downsampling method in any of the embodiments of the present disclosure.
- the non-volatile storage medium may include, but is not limited to, a disk storage, an optical storage, a flash memory, and the like.
- the processor 720 can be implemented by a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc.
- DSP digital signal processor
- ASIC application-specific integrated circuit
- FPGA field programmable gate array
- each module such as the judgment module and the determination module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or can be implemented by a dedicated circuit that executes corresponding steps.
- Bus 700 may use any of a variety of bus architectures, including, but not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, and Peripheral Component Interconnect (PCI) bus.
- ISA Industry Standard Architecture
- MCA Micro Channel Architecture
- PCI Peripheral Component Interconnect
- the computer system 70 may also include an input/output interface 730, a network interface 740, a storage interface 750, etc. These interfaces 730, 740, 750, the memory 710, and the processor 720 may be connected via a bus 700.
- the input/output interface 730 may provide a connection interface for input/output devices such as a display, a mouse, and a keyboard.
- the network interface 740 may provide a connection interface for various networked devices.
- the storage interface 750 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.
- These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and/or block diagram.
- These computer-readable program instructions can also be readable and stored in a computer-readable memory, which cause the computer to work in a specific manner to produce a product, including instructions for implementing the functions specified in one or more blocks in the flowchart and/or block diagram.
- the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Image Processing (AREA)
Abstract
本公开涉及图像下采样方法及装置、计算机可存储介质,涉及图像处理领域。图像下采样方法包括:将图像分为在第一方向上的多个子图;对第一方向上的多个子图进行卷积;将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像;将第一下采样图像分为在第二方向上的多个子图;对第二方向上的多个子图进行卷积;将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像。
Description
相关申请的交叉引用
本申请是以中国申请号为202211198475.7,申请日为2022年9月29日的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
本公开涉及图像处理领域,特别涉及图像下采样方法及装置、计算机可读存储介质。
缩小图像(或称为下采样(subsampled)或降采样(downsampled))的主要目的有两个:1、使得图像符合显示区域的大小;2、生成对应图像的缩略图。在利用机器学习,进行图像处理时,为降低计算量,一般都会对图像进行下采样的预处理。尤其是基于深度学习的视频编码技术,为了降低视频传输量,往往会对视频先进行下采样操作。
现有技术中,图像的下采样方式主要采用池化下采样和卷积下采样。对于一幅图像尺寸为M*N,对其进行s倍下采样,即得到(M/s)*(N/s)尺寸的图像,其中s应该是M和N的公约数。
发明内容
根据本公开的第一方面,提供了一种图像下采样方法,包括:将图像分为在第一方向上的多个子图;对第一方向上的多个子图进行卷积;将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像;将第一下采样图像分为在第二方向上的多个子图;对第二方向上的多个子图进行卷积;将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像。
在一些实施例中,将图像分为在第一方向上的多个子图,包括:根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一子图的第一尺寸;在第一尺寸不是图像的第一初始尺寸的约数的情况下,将图像分为第一尺寸的多个第一子图和第二尺寸的第二子图。
在一些实施例中,第二尺寸为图像的第一初始尺寸除以第一子图的第一尺寸的余数,第一子图的总个数为图像的第一初始尺寸除以子图的第一尺寸的商的向下取整的结果。
在一些实施例中,将图像分为在第一方向上的多个子图,包括:在第一尺寸是图像的第一初始尺寸的约数的情况下,将图像划分为多个第一尺寸的第一子图。在一些实施例中。对第一方向上的多个子图进行卷积,包括:利用第一卷积核,对第一子图进行卷积,得到第三尺寸的第三子图,其中,第三尺寸小于第一尺寸。
在一些实施例中,对第一方向上的多个子图进行卷积,包括:根据第一子图的总个数、第一子图的第三尺寸和图像的第一目标尺寸,确定第四尺寸和第二卷积核的尺寸;利用第二卷积核,对第二子图进行卷积,得到第四尺寸的第四子图,其中,第四尺寸小于第二尺寸。
在一些实施例中,根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一子图的第一尺寸,包括:根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一卷积核的尺寸,使得第三子图相对于第一子图缩减的比例与第四子图相对于第二子图缩减的比例之差小于阈值;根据第一卷积核的尺寸,确定第一子图的第一尺寸。
在一些实施例中,第一方向和第二方向中的一个为图像的长度方向,另一个为图像的宽度方向。
在一些实施例中,图像下采样方法还包括:在将图像分为在第一方向上的多个子图之前,对图像进行卷积处理或池化处理,使得在第一方向和在第二方向,处理后的图像的尺寸均为处理前的尺寸的N分之一,其中,N为正整数。
在一些实施例中,卷积的步长为1。
在一些实施例中,将图像分为在第二方向上的多个子图,包括:根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第五子图的第五尺寸;在第五尺寸不是图像的第二初始尺寸的约数的情况下,将图像分为第五尺寸的多个第五子图和第六尺寸的第六子图。
在一些实施例中,第六尺寸为图像的第二初始尺寸除以第五子图的第五尺寸的余数,第五子图的总个数为图像的第二初始尺寸除以第五子图的第五尺寸的商的向下取整的结果。
在一些实施例中,将图像分为在第二方向上的多个子图,包括:在第五尺寸是图像的第二初始尺寸的约数的情况下,将图像划分为多个第五尺寸的第五子图。
在一些实施例中,对第二方向上的多个子图进行卷积,包括:利用第三卷积核,对第五子图进行卷积,得到第七尺寸的第七子图,其中,第七尺寸小于第五尺寸。
在一些实施例中,对第二方向上的多个子图进行卷积,包括:根据第五子图的总个数、第七子图的第七尺寸和图像的第二目标尺寸,确定第八尺寸和第四卷积核的尺寸;利用第
四卷积核,对第六子图进行卷积,得到第八尺寸的第八子图,其中,第八尺寸小于第六尺寸。
在一些实施例中,根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第五子图的第五尺寸,包括:根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第三卷积核的尺寸,使得第七子图相对于第五子图缩减的比例与第八子图相对于第六子图缩减的比例之差小于阈值;根据第三卷积核的尺寸,确定第五子图的第五尺寸。
根据本公开的第二方面,提供了一种图像下采样装置,包括:第一划分模块,被配置为将图像分为在第一方向上的多个子图;第一卷积模块,被配置为对第一方向上的多个子图进行卷积;第一拼接模块,被配置为将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像;第二划分模块,被配置为将第一下采样图像分为在第二方向上的多个子图;第二卷积模块,被配置为对第二方向上的多个子图进行卷积;第二拼接模块,被配置为将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像。
根据本公开的第三方面,提供了一种通信装置,包括:存储器;以及耦接至所述存储器的处理器,所述处理器被配置为基于存储在所述存储器的指令,执行根据本公开任意实施例所述的图像下采样方法。
根据本公开的第四方面,提供了一种计算机可存储介质,其上存储有计算机程序指令,该指令被处理器执行时,实现根据本公开任意实施例所述的图像下采样方法。
构成说明书的一部分的附图描述了本公开的实施例,并且连同说明书一起用于解释本公开的原理。
参照附图,根据下面的详细描述,可以更加清楚地理解本公开,其中:
图1示出根据本公开一些实施例的图像下采样方法的流程图;
图2示出根据本公开一些实施例的在第一方向进行下采样的示意图;
图3示出根据本公开一些实施例的在第二方向进行下采样的示意图;
图4示出根据本公开一些实施例的卷积处理或池化处理的示意图。
图5示出根据本公开一些实施例的图像下采样装置的框图;
图6示出根据本公开另一些实施例的图像下采样装置的框图;
图7示出用于实现本公开一些实施例的计算机系统的框图。
现在将参照附图来详细描述本公开的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本公开的范围。
同时,应当明白,为了便于描述,附图中所示出的各个部分的尺寸并不是按照实际的比例关系绘制的。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本公开及其应用或使用的任何限制。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。
在这里示出和讨论的所有示例中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它示例可以具有不同的值。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。
相关技术中,利用池化、卷积或线性下采样方法对图像进行下采样,但是只能实现成比例的降采样,缩小的比例必须是原尺寸的约数。通常而言,池化或卷积的横向、纵向缩小比例是相同的,即,图像在横纵方向能够缩减的尺寸相互制约,不能实现任意缩小比例的下采样。
此外,相关技术在利用卷积对图像下采样时,缩减的尺寸如公式(1)所示:
其中,c1为缩减前图像的尺寸,c2未缩减后的图像尺寸,p为填充参数(padding),k为卷积核尺寸,s为步长参数(stride)。
从上式可以看出,图像缩小的尺寸主要取决于步长,如果想要大幅缩减图像的尺寸,就需要增大s,但是s越大,就会丢失更多图像的信息。
图1示出根据本公开一些实施例的图像下采样方法的流程图。
如图1所示,图像下采样方法包括步骤S1-步骤S6。
在步骤S1中,将图像分为在第一方向上的多个子图。
图2示出根据本公开一些实施例的在第一方向进行下采样的示意图。
如图2所示,令第一方向为图像的纵向方向。根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一子图的第一尺寸;在第一尺寸不是图像的第一初始尺寸的约数的情况下,将图像分为第一尺寸的多个第一子图和第二尺寸的第二子图。
例如,在分为多个子图前,完整图像的尺寸为(H’,W’),H’为第一初始尺寸,即,原始高度。子图的尺寸受到第一初始尺寸和图像在纵向上需要缩减到的第一目标尺寸的影响,当无法将图像等分为第一尺寸的纵向的多个第一子图时,把多出来的部分(即,余数)Δh’,作为第二子图(Δh’,W’),被分离出的最下部分的子图为第二子图。
在去除余数部分后,对图像剩余的部分(H’-Δh’,W’)等分为尺寸相同的M个第一子图(patchSize,W’)。
在一些实施例中,第二尺寸为图像的第一初始尺寸除以第一子图的第一尺寸的余数,第一子图的总个数为图像的第一初始尺寸除以子图的第一尺寸的商的向下取整的结果,如公式(2)所示:
H’=patchSize*M+Δh’ (2)
H’=patchSize*M+Δh’ (2)
其中,H’是图像在划分之前的第一初始尺寸,patchSize是第一尺寸,M是第一子图的个数,Δh’是第二子图的第二尺寸。
在一些实施例中,在第一尺寸是图像的第一初始尺寸的约数的情况下,将图像划分为多个第一尺寸的第一子图。
例如,如果图像的第一初始尺寸,恰好能够被划分为多个第一尺寸,则不需要第二子图。
在一些实施例中,根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一子图的第一尺寸,包括:根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一卷积核的尺寸,使得第三子图相对于第一子图缩减的比例与第三子图相对于第一子图缩减的比例之差小于阈值;根据第一卷积核的尺寸,确定第一子图的第一尺寸。
例如,以第三子图相对于第一子图缩减的比例(patchSize-stepH)/patchSize与第三子图相对于第一子图缩减的比例(Δh′-Δh)/Δh′接近为原则,选择合适的卷积核大小,选定卷积核大小后,根据公式(2),即可计算得到patchSize和M。
在步骤S2中,对第一方向上的多个子图进行卷积。
例如,每个第一子图分别进行卷积操作,得到(patchSize-stepH,W’)的第三子图。通过分别卷积,能够将每个第一子图的尺寸缩减到相同的大小。
卷积后第二子图的纵向尺寸减小,第一卷积核的尺寸(k1,1)和第一子图缩减的尺寸stepH的关系如公式(3)所示:
k1=stepH+1 (3)
k1=stepH+1 (3)
在一些实施例中,对第一方向上的多个子图进行卷积,包括:根据第一子图的总个数、第一子图的第三尺寸和图像的第一目标尺寸,确定第四尺寸和第二卷积核的尺寸;利用第二卷积核,对第二子图进行卷积,得到第四尺寸的第四子图,其中,第四尺寸小于第二尺寸。
例如,可以先进行纵向倍数对齐,对图像(H’,W’)最上(或最下)的第二子图(Δh’,W’)进行卷积操作,得到尺寸为(Δh,W’)的第四子图。
以卷积步长为1,padding=valid(即,不需要padding)为例,第四尺寸Δh和第三尺寸(patchSize-stepH)的关系如公式(4)所示:
H=(patchSize-stepH)*M+Δh (4)
H=(patchSize-stepH)*M+Δh (4)
其中,stepH表示每个第一子图在纵向减少的尺寸,(patchSize-stepH)为第三尺寸,Δh为缩减后的第二子图的第四尺寸,patchSize是第一尺寸,M是第一子图的个数,H为缩减后的整个图像的第一目标尺寸。
另外,卷积核采用单列形式,卷积核大小为(k1,1),可以减少计算量。在卷积步长为1的情况下,k2与第二子图的缩减尺寸如公式(5)所示:
k2=Δh′-Δh+1 (5)
k2=Δh′-Δh+1 (5)
在一些实施例中,卷积的步长为1。
本公开在卷积的步长为1的情况下,也能实现图像缩减到目标尺寸。在保留更多信息的前提下,实现了图像任意尺寸的缩减。
在一些实施例中,对第一方向上的多个子图进行卷积,包括:利用第一卷积核,对第一子图进行卷积,得到第三尺寸的第三子图,其中,第三尺寸小于第一尺寸。
例如,将剩余部分的图像进行纵向子图划分,分成多个高度方向的尺寸相同的子图,再进行子图纵向的卷积下采样,卷积后第一、第二子图的纵向尺寸都减小,且缩减的比例相近。
也可以先对第一子图划分并进行卷积,再对第二子图进行卷积,实现纵向倍数对齐,或是对第一第二子图同时卷积。
在步骤S3中,将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像。
如图2所示,将步骤S2得到的多个第一子图和第二子图,对应其在原始图像的位置,进行拼接,纵向恢复为整图后,得到纵向缩小的图像。
经过步骤S1-S3,最终第一目标尺寸H与第一初始尺寸H’的关系如公式(6)所示:
H’-H=(k1-1)*M+(k2-1) (6)
H’-H=(k1-1)*M+(k2-1) (6)
其中,k1是第一卷积核的尺寸,k2是第二卷积核的尺寸,M是第一子图的总数。
在步骤S4中,将第一下采样图像分为在第二方向上的多个子图。
在步骤S5中,对第二方向上的多个子图进行卷积;
在步骤S6中,将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像。
在一些实施例中,将图像分为在第二方向上的多个子图,包括:根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第五子图的第五尺寸;在第五尺寸不是图像的第二初始尺寸的约数的情况下,将图像分为第五尺寸的多个第五子图和第六尺寸的第六子图。
在一些实施例中,第六尺寸为图像的第二初始尺寸除以第五子图的第五尺寸的余数,第五子图的总个数为图像的第二初始尺寸除以第五子图的第五尺寸的商的向下取整的结果。
在一些实施例中,将图像分为在第二方向上的多个子图,包括:在第五尺寸是图像的第二初始尺寸的约数的情况下,将图像划分为多个第五尺寸的第五子图。
在一些实施例中,对第二方向上的多个子图进行卷积,包括:利用第三卷积核,对第五子图进行卷积,得到第七尺寸的第七子图,其中,第七尺寸小于第五尺寸。
在一些实施例中,对第二方向上的多个子图进行卷积,包括:
根据第五子图的总个数、第七子图的第七尺寸和图像的第二目标尺寸,确定第八尺寸和第四卷积核的尺寸;利用第四卷积核,对第六子图进行卷积,得到第八尺寸的第八子图,其中,第八尺寸小于第六尺寸。
在一些实施例中,根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第五子图的第五尺寸,包括:根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第三卷积核的尺寸,使得第七子图相对于第五子图缩减的比例与第八子图相对于第六子图缩减的
比例之差小于阈值;根据第三卷积核的尺寸,确定第五子图的第五尺寸。
在一些实施例中,第一方向和第二方向的一个为图像的长度方向,另一个为图像的宽度。
图3示出根据本公开一些实施例的在第二方向进行下采样的示意图。
如图3所示,令第二方向为图像的宽度方向。在步骤S1-S3中,已经实现了在高度方向的缩减,接着,在步骤S4-S6中,实现在宽度方向的缩减,宽度方向降采样的步骤与在高度方向类似,具体请参见步骤S1-S3。
在一些实施例中,在将图像分为在第一方向上的多个子图之前,对图像进行卷积处理、池化处理或线性下采样,使得在第一方向和在第二方向,处理后的图像的尺寸均为处理前的尺寸的N分之一,其中,N为正整数。
图4示出了根据本公开一些实施例的卷积处理或池化处理的示意图。
如图4所示,假设原始图片的尺寸(H,W),在步骤S1之前,先将原图(H,W)卷积或池化,等比例下采样S倍至(H’,W’),如公式(7)(8)(9)所示:
通过预先卷积或池化,能够减小后续进一步下采样的运算量,提高计算速度。
本公开的下采样方法,采用卷积深度学习图像下采样,能自主学习图像信息,满足图像目标需求。本公开基于子图划分的思想,依次进行第一方向、第二方向的缩减,能实现任意尺寸的图像下采样,解耦了图片横向和纵向缩小比例的相互制约关系,即,横向和纵向缩小比例可以互不影响,
本公开的下采样方法,可以替代现有机器学习图像预处理方式,将图像下采样过程参与到整体任务训练中,提升任务效果。例如,如果后续接的机器视觉任务,训练样本标签即为机器视觉任务标签,在模型训练过程中更新的是卷积核的权重。
同时,本公开的下采样方法可联合编码、下游任务等进行训练,提升编码、任务性能。
在视频编码中,采用根据本公开的下采样方法处理视频,视频下采样后再编码,能够降低需要处理的数据量,提高压缩率。
上面已经介绍了卷积下采样的流程,下面,以将下采样图像(1333x1024)下采样至
(1333x711)为例,具体介绍各参数的计算方法。
首先,需要将第一下采样图像分为在宽度方向的第五尺寸的多个第五子图和第六尺寸的第六子图。
常用的卷积核尺寸为3,5,7。以用于卷积多个第五子图的第三卷积核可能的取值k3为3,5,7为例,令步长为1,则根据公式(1),可以推导出:
stepW=k3-1
stepW=k3-1
即,第五子图缩减的尺寸stepW可能的取值为2,4,6。分别令stepW为2,4,6,按照公式(10)、(11),计算各参数值:
711=(patchSize-stepW)*M+Δw (10)
1024=patchSize*M+Δ’w (11)
711=(patchSize-stepW)*M+Δw (10)
1024=patchSize*M+Δ’w (11)
其中,卷积步长s为1,patchSize是第五子图卷积缩减前的尺寸,M为第五子图的总个数,Δ’w为第六子图缩减前的尺寸。Δw为第六子图缩减后的尺寸,即第八子图的第八尺寸。
计算得到三组参数如下表:
表1 stepH与各参数的对应表
以保证图片不同区域的第五和第六子图的缩放尺寸一致性为原则,即,令(patchSize-stepH)/patchSize与(Δ′w-Δw)/Δ′w尽量相近,从上表选择stepW=4。
在确定stepW后,根据上表,可以确定M、Δw、Δ′w、patchSize的值,以及第三卷积核的尺寸K3=4+1、用于对第六子图进行卷积的第四卷积核的尺寸k4=10-9+1。
对纵向下采样图像(1333x1024)最左(或最右)的第六子图(1333,10)进行卷积操作。卷积步长为1,从而为了可能保留信息。且,填充操作为VALID。卷积核采用单列形式(2,1),从而尽可能降低计算量。先对余数列(长度为10列的第六子图)进行卷积下采样操作,得到第六子图缩减后的尺寸为(1333,9)。然后,对剩余的图像(1333,1014)等分为78个第五子图(1333,13),对各子图进行卷积操作,得到缩减后的子图尺寸为(1333,9)。
将卷积后的所有子图按照原来的排列顺序重新拼接到一起,得到降采样后的图像(1333,711)。
本领域技术人员应当知晓,卷积的stride和padding参数和卷积核尺寸不局限于上述取值,根据需要,可以采用其他的取值,这里不再赘述。
图5示出根据本公开一些实施例的图像下采样装置的框图。
如图5所示,图像下采样装置5包括第一划分模块51、第一卷积模块52、第一拼接模块53、第二划分模块54、第二卷积模块55、第二拼接模块56。
第一划分模块51,被配置为将图像分为在第一方向上的多个子图,例如执行如图1所示的步骤S1。
第一卷积模块52,被配置为对第一方向上的多个子图进行卷积,例如执行如图1所示的步骤S2。
第一拼接模块53,被配置为将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像,例如执行如图1所示的步骤S3。
第二划分模块54,被配置为将第一下采样图像分为在第二方向上的多个子图,例如执行如图1所示的步骤S4。
第二卷积模块55,被配置为对第二方向上的多个子图进行卷积,例如执行如图1所示的步骤S5。
第二拼接模块56,被配置为将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像,例如执行如图1所示的步骤S6。
图6示出根据本公开另一些实施例的图像下采样装置的框图。
如图6所示,图像下采样装置6包括存储器61;以及耦接至该存储器61的处理器62,存储器61用于存储执行图像下采样方法。处理器62被配置为基于存储在存储器61中的指令,执行本公开中任意一些实施例中的图像下采样方法。
图7示出用于实现本公开一些实施例的计算机系统的框图。
如图7所示,计算机系统70可以通用计算设备的形式表现。计算机系统70包括存储器710、处理器720和连接不同系统组件的总线700。
存储器710例如可以包括系统存储器、非易失性存储介质等。系统存储器例如存储有操作系统、应用程序、引导装载程序(Boot Loader)以及其他程序等。系统存储器可以包
括易失性存储介质,例如随机存取存储器(RAM)和/或高速缓存存储器。非易失性存储介质例如存储有执行本公开中任意一些实施例中的图像下采样方法的指令。非易失性存储介质包括但不限于磁盘存储器、光学存储器、闪存等。
处理器720可以用通用处理器、数字信号处理器(DSP)、应用专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑设备、分立门或晶体管等分立硬件组件方式来实现。相应地,诸如判断模块和确定模块的每个模块,可以通过中央处理器(CPU)运行存储器中执行相应步骤的指令来实现,也可以通过执行相应步骤的专用电路来实现。
总线700可以使用多种总线结构中的任意总线结构。例如,总线结构包括但不限于工业标准体系结构(ISA)总线、微通道体系结构(MCA)总线、外围组件互连(PCI)总线。
计算机系统70还可以包括输入输出接口730、网络接口740、存储接口750等。这些接口730、740、750以及存储器710和处理器720之间可以通过总线700连接。输入输出接口730可以为显示器、鼠标、键盘等输入输出设备提供连接接口。网络接口740为各种联网设备提供连接接口。存储接口750为软盘、U盘、SD卡等外部存储设备提供连接接口。
这里,参照根据本公开实施例的方法、装置和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个框以及各框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可提供到通用计算机、专用计算机或其他可编程装置的处理器,以产生一个机器,使得通过处理器执行指令产生实现在流程图和/或框图中一个或多个框中指定的功能的装置。
这些计算机可读程序指令也可读存储在计算机可读存储器中,这些指令使得计算机以特定方式工作,从而产生一个制造品,包括实现在流程图和/或框图中一个或多个框中指定的功能的指令。
本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。
通过上述实施例中的图像下采样方法及装置、计算机可读存储介质,实现了图像不同方向的尺寸的自由缩减。
至此,已经详细描述了根据本公开的流量预测方法及装置、计算机可读存储介质。为了避免遮蔽本公开的构思,没有描述本领域所公知的一些细节。本领域技术人员根据上面的描述,完全可以明白如何实施这里公开的技术方案。
Claims (20)
- 一种图像下采样方法,包括:将图像分为在第一方向上的多个子图;对第一方向上的多个子图进行卷积;将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像;将第一下采样图像分为在第二方向上的多个子图;对第二方向上的多个子图进行卷积;将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像。
- 根据权利要求1所述的图像下采样方法,其中,将图像分为在第一方向上的多个子图,包括:根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一子图的第一尺寸;在第一尺寸不是图像的第一初始尺寸的约数的情况下,将图像分为第一尺寸的多个第一子图和第二尺寸的第二子图。
- 根据权利要求2所述的图像下采样方法,其中,第二尺寸为图像的第一初始尺寸除以第一子图的第一尺寸的余数,第一子图的总个数为图像的第一初始尺寸除以第一子图的第一尺寸的商的向下取整的结果。
- 根据权利要求2或3所述的图像下采样方法,其中,将图像分为在第一方向上的多个子图,包括:在第一尺寸是图像的第一初始尺寸的约数的情况下,将图像划分为多个第一尺寸的第一子图。
- 根据权利要求2至4任一项所述的图像下采样方法,其中,对第一方向上的多个子图进行卷积,包括:利用第一卷积核,对第一子图进行卷积,得到第三尺寸的第三子图,其中,第三尺寸 小于第一尺寸。
- 根据权利要求5所述的图像下采样方法,其中,对第一方向上的多个子图进行卷积,包括:根据第一子图的总个数、第三子图的第三尺寸和图像的第一目标尺寸,确定第四尺寸和第二卷积核的尺寸;利用第二卷积核,对第二子图进行卷积,得到第四尺寸的第四子图,其中,第四尺寸小于第二尺寸。
- 根据权利要求6所述的图像下采样方法,其中,根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一子图的第一尺寸,包括:根据图像在第一方向的第一初始尺寸和第一目标尺寸,确定第一卷积核的尺寸,使得第三子图相对于第一子图缩减的比例与第四子图相对于第二子图缩减的比例之差小于阈值;根据第一卷积核的尺寸,确定第一子图的第一尺寸。
- 根据权利要求1至7任一项所述的图像下采样方法,其中,将图像分为在第二方向上的多个子图,包括:根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第五子图的第五尺寸;在第五尺寸不是图像的第二初始尺寸的约数的情况下,将图像分为第五尺寸的多个第五子图和第六尺寸的第六子图。
- 根据权利要求8所述的图像下采样方法,其中,第六尺寸为图像的第二初始尺寸除以第五子图的第五尺寸的余数,第五子图的总个数为图像的第二初始尺寸除以第五子图的第五尺寸的商的向下取整的结果。
- 根据权利要求8或9所述的图像下采样方法,其中,将图像分为在第二方向上的多个子图,包括:在第五尺寸是图像的第二初始尺寸的约数的情况下,将图像划分为多个第五尺寸的第五子图。
- 根据权利要求8至10任一项所述的图像下采样方法,其中,对第二方向上的多个子图进行卷积,包括:利用第三卷积核,对第五子图进行卷积,得到第七尺寸的第七子图,其中,第七尺寸小于第五尺寸。
- 根据权利要求11所述的图像下采样方法,其中,对第二方向上的多个子图进行卷积,包括:根据第五子图的总个数、第七子图的第七尺寸和图像的第二目标尺寸,确定第八尺寸和第四卷积核的尺寸;利用第四卷积核,对第六子图进行卷积,得到第八尺寸的第八子图,其中,第八尺寸小于第六尺寸。
- 根据权利要求12所述的图像下采样方法,其中,根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第五子图的第五尺寸,包括:根据图像在第二方向的第二初始尺寸和第二目标尺寸,确定第三卷积核的尺寸,使得第七子图相对于第五子图缩减的比例与第八子图相对于第六子图缩减的比例之差小于阈值;根据第三卷积核的尺寸,确定第五子图的第五尺寸。
- 根据权利要求1-13任一项所述的图像下采样方法,其中,第一方向和第二方向中的一个为图像的长度方向,另一个为图像的宽度方向。
- 根据权利要求1-14任一项所述的图像下采样方法,还包括:在将图像分为在第一方向上的多个子图之前,对图像进行卷积处理、池化处理或线性下采样处理,使得在第一方向和在第二方向,处理后的图像的尺寸均为处理前的尺寸的N分之一,其中,N为正整数。
- 根据权利要求1-15任一项所述的图像下采样方法,其中,卷积的步长为1。
- 一种图像下采样装置,包括:第一划分模块,被配置为将图像分为在第一方向上的多个子图;第一卷积模块,被配置为对第一方向上的多个子图进行卷积;第一拼接模块,被配置为将卷积后的第一方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸的第一下采样图像;第二划分模块,被配置为将第一下采样图像分为在第二方向上的多个子图;第二卷积模块,被配置为对第二方向上的多个子图进行卷积;第二拼接模块,被配置为将卷积后的第二方向上的多个子图进行拼接,得到在第一方向为第一目标尺寸、在第二方向为第二目标尺寸的第二下采样图像。
- 一种通信装置,包括:存储器;以及耦接至所述存储器的处理器,所述处理器被配置为基于存储在所述存储器的指令,执行根据权利要求1至16任一项所述的图像下采样方法。
- 一种计算机可存储介质,其上存储有计算机程序指令,该指令被处理器执行时,实现根据权利要求1至16任一项所述的图像下采样方法。
- 一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行根据权利要求1至16任一项所述的图像下采样方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211198475.7 | 2022-09-29 | ||
| CN202211198475.7A CN117853325A (zh) | 2022-09-29 | 2022-09-29 | 图像下采样方法及装置、计算机可读存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024066852A1 true WO2024066852A1 (zh) | 2024-04-04 |
Family
ID=90476063
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/115222 Ceased WO2024066852A1 (zh) | 2022-09-29 | 2023-08-28 | 图像下采样方法及装置、计算机可读存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN117853325A (zh) |
| WO (1) | WO2024066852A1 (zh) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109816659A (zh) * | 2019-01-28 | 2019-05-28 | 北京旷视科技有限公司 | 图像分割方法、装置及系统 |
| CN112801868A (zh) * | 2021-01-04 | 2021-05-14 | 青岛信芯微电子科技股份有限公司 | 图像超分辨率重建的方法、电子设备及存储介质 |
| US20210366080A1 (en) * | 2020-05-20 | 2021-11-25 | Industry-Academic Cooperation Foundation, Yonsei University | Method for optimizing hardware structure of convolutional neural networks |
| CN113888751A (zh) * | 2021-10-19 | 2022-01-04 | 杭州柳叶刀机器人有限公司 | 一种关节关键点的识别方法、装置及计算机设备 |
-
2022
- 2022-09-29 CN CN202211198475.7A patent/CN117853325A/zh active Pending
-
2023
- 2023-08-28 WO PCT/CN2023/115222 patent/WO2024066852A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109816659A (zh) * | 2019-01-28 | 2019-05-28 | 北京旷视科技有限公司 | 图像分割方法、装置及系统 |
| US20210366080A1 (en) * | 2020-05-20 | 2021-11-25 | Industry-Academic Cooperation Foundation, Yonsei University | Method for optimizing hardware structure of convolutional neural networks |
| CN112801868A (zh) * | 2021-01-04 | 2021-05-14 | 青岛信芯微电子科技股份有限公司 | 图像超分辨率重建的方法、电子设备及存储介质 |
| CN113888751A (zh) * | 2021-10-19 | 2022-01-04 | 杭州柳叶刀机器人有限公司 | 一种关节关键点的识别方法、装置及计算机设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117853325A (zh) | 2024-04-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107729994B (zh) | 执行卷积神经网络中的卷积层的运算的方法和装置 | |
| JP7132824B2 (ja) | ニューラルネットワークにおいてデコンボルーション演算を実行する装置及びその方法 | |
| KR102452953B1 (ko) | 뉴럴 네트워크의 컨볼루션 연산을 수행하는 방법 및 장치 | |
| CN112232346B (zh) | 语义分割模型训练方法及装置、图像语义分割方法及装置 | |
| EP3489863A1 (en) | Method and apparatus for performing operation of convolutional layer in convolutional neural network | |
| CN107832842A (zh) | 针对折叠特征数据执行卷积运算的方法和装置 | |
| CN110544214A (zh) | 一种图像修复方法、装置及电子设备 | |
| CN113505885B (zh) | 基于预设的损失函数的单目深度估计网络的训练方法 | |
| CN102687162A (zh) | 以像素速率进行图像处理的方法与装置 | |
| CA2929403C (en) | Multi-dimensional sliding window operation for a vector processor | |
| CN109996023A (zh) | 图像处理方法和装置 | |
| CN112633260B (zh) | 视频动作分类方法、装置、可读存储介质及设备 | |
| KR20170024275A (ko) | 영상 처리 장치, 영상 처리 방법 및 이를 포함하는 전자 시스템 | |
| CN112529064B (zh) | 一种高效的实时语义分割方法 | |
| US11915338B2 (en) | Loading apparatus and method for convolution with stride or dilation of 2 | |
| CN117853456A (zh) | 一种基于上下文驱动的边缘增强医学图像分割方法 | |
| CN109427035B (zh) | 半导体设备和图像识别系统 | |
| CN112258527B (zh) | 图像处理方法、装置、电子设备和计算机可读存储介质 | |
| CN112101376B (zh) | 图像处理方法、装置、电子设备和计算机可读介质 | |
| CN113055666B (zh) | 一种视频质量评估方法及装置 | |
| CN114373117A (zh) | 一种目标检测方法、装置及系统 | |
| CN108629405B (zh) | 提高卷积神经网络计算效率的方法和装置 | |
| CN117808659A (zh) | 用于执行多维卷积运算方法、系统、设备和介质 | |
| WO2024066852A1 (zh) | 图像下采样方法及装置、计算机可读存储介质 | |
| WO2026031374A1 (zh) | 卷积计算方法、装置、电子设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23870095 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09/07/2025) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 23870095 Country of ref document: EP Kind code of ref document: A1 |