This application claims the priority of Chinese Patent Application No. 202311067464.X filed on Aug. 23, 2023, and the disclosure of the above-mentioned Chinese Patent Application is hereby incorporated in its entirety by reference as a part of this application.
Embodiments of the disclosure relate to the technical field of image processing, for example, to an image processing method and apparatus, an electronic device and a storage medium.
Down-sampling of the image can adjust the resolution of the video or image, so that the video or image can reach the appropriate size.
At present, electronic device can obtain the corresponding down-sampled image based on nearest neighbor interpolation. For example, the electronic device can select the pixel closest to the sampling point as the new pixel in the down-sampled image, to obtain the down-sampled image. However, when the image is down-sampled according to the above method, more image information will be lost, resulting in lower definition of the down-sampled image.
Embodiments of the present disclosure provide an image processing method and apparatus, an electronic device and a storage medium, which can solve one or more technical problems in the prior art.
An embodiment of the present disclosure provides an image processing method, including:
An embodiment of present disclosure further provides an image processing apparatus, including an acquisition module, a sampling module, a pooling module, a determining module and a processing module, wherein:
An embodiment of present disclosure further provides an electronic device, including at least one processor and a memory on which computer-readable instructions are stored; wherein the at least one processor is configured to execute the computer-executable instructions stored in the memory, so that the at least one processor executes the image processing method as described in the above embodiment and various possible aspects of the above embodiment.
An embodiment of the present disclosure further provides a non-transient computer-readable storage medium, in which computer-executable instructions are stored, wherein the computer-executable instructions, when executed by a processer, are configured to cause the processer to execute the image processing method as described in the above embodiment and various possible aspects of the above embodiment.
In order to explain the embodiments of the present disclosure or the technical solutions in the prior art more clearly, the drawings necessary for the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely some but not all of the embodiments of the present disclosure, and other drawings can be obtained by those ordinary skilled in the art according to these drawings without creative labor.
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description involves the drawings, the same numbers in different drawings indicate the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
In order to facilitate understanding, the concepts related to the embodiments of the present disclosure are described below.
Electronic device refers to a kind of equipment with wireless transceiver function. The electronic device can be deployed on land, including indoor or outdoor, handheld, wearable or vehicle-mounted electronic devices. The electronic device can be a mobile phone, a portable android device (PAD), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a vehicle-mounted electronic device, a wireless terminal in self-driving, a wireless electronic device in remote medical application, a wireless electronic device in smart grid, a wireless electronic device in transportation safety, a wireless electronic device in smart city, a wireless electronic device in smart home, and a wearable electronic device, etc. The electronic device related to the embodiment of the present disclosure can also be referred to as terminal, user equipment (UE), access electronic device, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile stage, remote station, remote electronic device, mobile equipment, UE electronic device, wireless communication equipment, UE agent or UE device, etc. Electronic device can also be fixed or mobile.
Reference now is made to
It should be noted that
In the related art, the electronic device can obtain the corresponding down-sampled image based on the nearest neighbor interpolation method. For example, given that the resolution of an original image is 800*800, and if the down-sampling ratio is 2, the electronic device can set 400*400 sampling points in the original image, and take the pixel closest to each sampling point as the new pixel in the down-sampled image. In this way, the down-sampled image corresponding to the original image can be obtained (the resolution is 400*400). However, in the above method, the electronic device remains the pixels closest to the sampling points, so that 400*400 pixels in the original image will be lost in the down-sampled image obtained by the electronic device, resulting in more image information loss in the down-sampled image and poor definition of the down-sampled image.
In order to solve the technical problems in the related art, the embodiment of the disclosure provides an image processing method. An electronic device can acquire a first image, perform down-sampling processing on the first image to obtain a down-sampled image, determine N image blocks from the down-sampled image, determine an average pixel value corresponding to a plurality of pixels in each image block, and generate a first pooled image based on the average pixel value corresponding to each image block. The first pooled image includes N pixels, the pixel values of the N pixels are in one-to-one correspondence with the average pixel values of the N image blocks. The electronic device can determine a plurality of pixel merging weights corresponding to the pixels in the down-sampled image, and perform pixel merging processing on the down-sampled image and the first pooled image based on the plurality of pixel merging weights to obtain a second image. In this way, since each pixel in the first pooled image is determined by a plurality of pixels in the down-sampled image, more image information of the first image can be retained in the second image obtained by the electronic device based on the first pooled image and the down-sampled image, which can not only reduce the resolution of the second image, but also improve the definition of the second image.
The technical solution of the present disclosure and how the technical solution of the present disclosure can solve the above technical problems will be described in detail with exemplary embodiments. The following exemplary embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
The execution subject of the embodiment of the present disclosure may be an electronic device or an image processing apparatus provided in the electronic device. The image processing apparatus can be realized based on software, and the image processing apparatus can also be realized based on the combination of software and hardware. Alternatively, the electronic device can be a device with on-end computing capability.
The first image may be an image to be down-sampled. For example, the first image may be an image with higher resolution. For example, in an application scenario, when an image acquired by an electronic device does not match the screen of the electronic device, the electronic device can perform down-sampling processing on the image so that the down-sampled image matches the screen of the electronic device; this image can be the first image. For example, if the resolution of an image acquired by an electronic device is 800*800 and the screen resolution of the electronic device is 400*400, the electronic device can determine the image as the first image and perform down-sampling processing on the image by a down-sampling ratio of 2.
It should be noted that the electronic device can receive the first image sent by other devices, and can also acquire the first image based on any feasible implementation, which is not limited in the embodiment of the present disclosure.
The first down-sampled image may be an image obtained by reducing the resolution of the first image. The electronic device can obtain the first down-sampled image based on the following feasible implementation: acquiring a down-sampling ratio, and performing average down-sampling processing on the first image based on the down-sampling ratio to obtain the first down-sampled image. For example, if the down-sampling ratio is 2, the electronic device can perform average down-sampling processing on the first image by a ratio of 2. The average down-sampling can be linear sampling, etc., which is not limited in the embodiment of the present disclosure. When the electronic device performs average down-sampling processing on the first image, it can determine the average value of pixel values around the sampling point as a pixel value of the first down-sampled image, so that each pixel in the first down-sampled image can merge the surrounding pixel information to enable the first down-sampled image to retain more image information of the first image, thereby improving the definition of the image after down-sampling.
Each pixel in the first pooled image is obtained by merging a plurality of pixels in the first down-sampled image. For example, for any pixel in the first pooled image, the value of the pixel (the value of RGB) may be the average value of the values of a plurality of pixels in the first down-sampled image.
For example, the electronic device can obtain the first pooled image based on the following feasible implementation: determining N image blocks from the first down-sampled image, determining an average pixel value corresponding to a plurality of pixels in each image block, and generating the first pooled image based on the average pixel value corresponding to each image block. N is an integer greater than 1.
In this way, each pixel in the first pooled image can merge a plurality of pixels in the first down-sampled image, and since the pixels in the first down-sampled image can retain more pixel information of the first image, the first pooled image can also retain more pixel information of the first image.
The first pooled image includes N pixels, and the pixel values of the N pixels are in one-to-one correspondence with the average values of the N image blocks. For example, if the electronic device determines 10 image blocks from the first down-sampled image, the first pooled image may include 10 pixels; and if the electronic device determines 100 image blocks from the first down-sampled image, the first pooled image may include 100 pixels. For example, if an image block includes pixel 1, pixel 2 and pixel 3, the pixel value of the pixel in the first pooled image corresponding to the image block is an average value of pixels values of pixel 1, pixel 2 and pixel 3.
In an embodiment of the present disclosure, a plurality of pixels may be included in the image block. For example, an image block may include 1 pixel, 4 pixels, 9 pixels, etc., which is not limited in the embodiment of the present disclosure. It should be noted that the shape of the image block in the embodiment of the present disclosure can be rectangular shape, square shape or arbitrary shape, which is not limited in the embodiment of the present disclosure.
In an embodiment of the present disclosure, the electronic device determines N image blocks from the first down-sampled image, which may include: determining a sliding window, controlling the sliding window to slide for N times in the first down-sampled image based on a preset sliding step size to obtain N groups of pixels, and determining each group of pixels as one image block to obtain the N image blocks. For example, if the preset sliding step size is M pixel units, the sliding window can slide rightwards by M pixel units at a time; and after each row of sliding, the sliding window can slide downwards by M pixel units, until the N image blocks are obtained.
It should be noted that the sliding window in the embodiment of the present disclosure can also slide based on any feasible implementation (for example, the sliding window slides downwards by one pixel unit, the sliding window slides rightwards by one pixel unit, etc.), which is not limited in the embodiment of the present disclosure.
In an embodiment of the present disclosure, the size of the sliding window may be as same as that of the image block. For example, if the size of an image block is 2 pixels in the length and 2 pixels in the width, the size of the sliding window corresponding to the image block can be 2 pixels in the length and 2 pixels in the width; if the size of the image block is 4 pixels in the length and 4 pixels in the width, the size of the sliding window corresponding to the image block can be 4 pixels in the length and 4 pixels in the width.
Hereinafter, the process of determining an image block in a first down-sampled image will be described with reference to
Referring to
Alternatively, the electronic device can determine the size of the sliding window based on the corresponding down-sampling ratio of the first image. For example, if the down-sampling ratio corresponding to the first image is 2, the size of the sliding window can be 2*2 (with 2 pixels in both length and width); if the down-sampling ratio corresponding to the first image is 3, the size of the sliding window can be 3*3 (with 3 pixels in both length and width).
It should be noted that the electronic device can also determine the size of the sliding window based on any other feasible implementation, which is not limited in the embodiment of the present disclosure.
Hereinafter, the process of determining the first pooled image corresponding to the first down-sampled image will be described with reference to
Referring to
Referring to
Referring to
It should be noted that the positions of a plurality of pixels in the first pooled image are associated with the positions of the image blocks in the first down-sampled image, which is not limited in the embodiment of the present disclosure.
It should be noted that the average value of an image block may be an average value of the pixel values of the pixels included in the image block. For example, the average value of the image block can be achieved based on the following formula:
where B is the average value of the image block, C is the number of pixels in the image block, A is the pixel value of the pixel, and i is the code number of the pixel in the image block. For example, in the embodiment shown in
In an embodiment of the present disclosure, the electronic device can process the first down-sampled image based on an average pooling module without padding, and then obtain the first pooled image corresponding to the first down-sampled image, wherein the average pooling module without padding is used to traverse the average value of pixels in each image block of the first down-sampled image, so that the electronic device can obtain the first pooled image based on the average pooling module without padding.
It should be noted that the electronic device can process the first image through the average pooling module without padding, and perform down-sampling processing on the processed image to obtain the first down-sampled image. For example, the electronic device can process the first image through the average pooling module without padding firstly, each pixel in the obtained pooled image can merge multiple pixels in the first image, and then the electronic device can perform sampling processing on the pooled image of the first image through a sampling module (which can perform down-sampling processing on the image based on sampling points) to obtain the first down-sampled image.
The pixel merging weight is used to merge the pixels in the first down-sampled image and the first pooled image. For example, when the electronic device merges the first down-sampled image and the first pooled image, it may merge a plurality of pixels in the first down-sampled image and a plurality of pixels in the first pooled image based on a plurality of pixel merging weights.
In an embodiment of the present disclosure, the pixel in the first down-sampled image may correspond to at least one pixel merging weight. For example, the pixel in the first down-sampled image may correspond to one pixel merging weight, two pixel merging weights, three pixel merging weights, and so on.
In an embodiment of the present disclosure, the electronic device can determine a plurality of pixel merging weights corresponding to the pixels in the first down-sampled image based on the following feasible implementation: determining a variance associated with the pixels in the first down-sampled image, determining a covariance associated with the pixels in the first down-sampled image, and determining a plurality of pixel merging weights corresponding to the pixels in the first down-sampled image based on the variance and the covariance.
The variance associated with the pixels in the first down-sampled image may include the variance of a plurality of pixels in each image block in the first down-sampled image. For example, if the first down-sampled image can include four image blocks and each image block can include four pixels, the first down-sampled image can correspond to four variances, wherein one variance can be obtained from the values of the four pixels in each image block. In this way, based on the variance and the covariance, the pixel merging weights corresponding to the pixels of the first down-sampled image can be accurately determined, and the accuracy of pixel merging processing is improved, thereby improving the definition of the second image.
In an embodiment of the present disclosure, the electronic device can determine the variance associated with the pixels in the first down-sampled image based on the following feasible implementation: performing squared processing on the pixel value of each pixel in the first down-sampled image to obtain the squared first down-sampled image, performing average pooling processing on the squared first down-sampled image to obtain the second pooled image, performing squared processing on the pixel value of each pixel in the first pooled image to obtain the squared first pooled image, and determining the variance associated with the pixels in the first down-sampled image based on the squared first pooled image and the second pooled image.
In an embodiment of the present disclosure, the squared first down-sampled image may be an image obtained by performing squared processing on the value of each pixel in the first down-sampled image. For example, if the first down-sampled image includes two pixels, with one pixel having a value of 2 and the other pixel having a value of 4, the squared first down-sampled image may also include two pixels, with one pixel having a value of 4 and the other pixel having a value of 16.
In an embodiment of the present disclosure, any pixel in the second pooled image is obtained by merging a plurality of pixels in the squared first down-sampled image. For example, the electronic device can process the squared first down-sampled image based on an average pooling module without padding to obtain the second pooled image. It should be noted that the method for determining the second pooled image is similar to the method for determining the first pooled image, and the details will not be repeated in the embodiment of the present disclosure.
Alternatively, the electronic device may determine the difference between the pixel values of a plurality of pixels in the second pooled image and the pixel values of a plurality of pixels in the squared first pooled image as the variance associated with the pixels in the first down-sampled image.
Hereinafter, the process of determining the variance associated with the pixels in a first down-sampled image will be described with reference to
Referring to
Referring to
In an embodiment of the present disclosure, the electronic device can determine a covariance associated with the pixels in the first down-sampled image based on the following feasible implementation: performing squared processing on the pixel value of each pixel in the first image, performing average pooling processing on the squared first image to obtain a third image, performing down-sampling processing on the third image to obtain a down-sampled image associated with the third image, performing average pooling processing on the down-sampled image associated with the third image to obtain a third pooled image, and determining the covariance associated with the pixels in the first down-sampled image based on the third pooled image and the squared first pooled image.
In an embodiment of the present disclosure, the third image can be an image after performing average pooling process on the squared first image. For example, the electronic device can perform squared processing on the pixel value of each pixel in the first image, and process the squared first image based on an average pooling module without padding, to obtain the third image. Each pixel in the third image can be obtained by merging a plurality of pixels in the squared first image.
In an embodiment of the present disclosure, the electronic device may determine the down-sampled image associated with the third image based on any feasible implementation, which is not limited in the embodiment of the present disclosure. It should be noted that each pixel in the third image is obtained by merging a plurality of pixels in the first image, as a result, after the third image is down-sampled, the loss of pixel information is less, thereby improving the display effect of the down-sampled image associated with the third image.
In an embodiment of the present disclosure, the third pooled image may be an image after average pooling processing is performed on the down-sampled image associated with the third image. For example, the electronic device can process the down-sampled image associated with the third image based on an average pooling module without padding, and then a third pooled image can be obtained. Any pixel in the third pooled image is obtained by merging a plurality of pixels in the down-sampled image associated with the third image.
In an embodiment of the present disclosure, the electronic device may determine the covariance associated with the pixels in the first down-sampled image based on the third pooled image and the squared first pooled image. For example, the electronic device may determine the difference between the values of the pixels of the third pooled image and the values of the pixels of the squared first pooled image as the covariance associated with the pixels in the first down-sampled image.
Hereinafter, the process of determining the third pooled image will be described with reference to
Referring to
Referring to
Referring to
In this way, the pixels in the third pooled image acquired by the electronic device can also include the pixel information in the first image. For example, pixel G1 is obtained based on pixel F1, pixel F2, pixel F5 and pixel F6, while pixel F1, pixel F2, pixel F5 and pixel F6 are obtained based on pixel E1, pixel E2, pixel E3, pixel E6, pixel E7, pixel E8, pixel E11, pixel E12 and pixel E13. Therefore, the third pooled image can retain more pixel information in the first image, thus improving the display effect of the image.
Hereinafter, the process of determining the covariance associated with the pixels in the first down-sampled image will be described with reference to
Referring to
It should be noted that, based on the embodiments shown in the present disclosure, both the variance and the covariance in the embodiments are determined based on the pixels in the image blocks. For example, in the embodiment shown in
In an embodiment of the present disclosure, after the electronic device determines a plurality of variances and a plurality of covariances corresponding to the pixels in the first down-sampled image, the ratio of variances to covariances can be determined as the pixel merging weights. For example, in the embodiments shown in
It should be noted that the electronic device can also determine the pixel merging weights based on any other feasible implementations, for example, the ratio of covariance to variance is determined as the pixel merging weight, which is not limited in the embodiment of the present disclosure.
In an embodiment of the present disclosure, the second image may be an image after performing down-sampling processing on the first image. For example, the resolution of the first image is 800*400, and the resolution of the second image can be 400*200 if the down-sampling ratio is 2. It should be noted that the resolution of the second image is similar to that of the down-sampled image of the first image, but the definition of the second image is greater than that of the down-sampled image of the first image because the second image can include more pixel information in the first image.
The electronic device can obtain the second image based on the following feasible implementation: for any pixel (e.g., the first pixel) in the first down-sampled image, obtaining one or more target pixel merging weights determined based on the first pixel among the plurality of pixel merging weights, determining a plurality of target pixels in the first pooled image corresponding to the plurality of pixels in the first down-sampled image, and determining the second image based on the first down-sampled image, the plurality of target pixel merging weights corresponding to the plurality of pixels in the first down-sampled image, and the target pixels corresponding to the plurality of pixels in the first down-sampled image; the first pixel is any pixel in the first down-sampled image.
The pixel merging processing performed on the first down-sampled image and the first pooled image refers to merging each pixel in the first down-sampled image with the pixel in the first pooled image based on the pixel merging weight to obtain a new pixel, which can be a pixel in the second image. For example, if the R value in RGB of pixel A in the first down-sampled image is 100, the pixel in the first pooled image corresponding to pixel A is pixel B (it can be determined based on the position or any feasible implementation, which is not limited in this embodiment) and the R value in RGB of pixel B is 60, and if the pixel merging weight corresponding to pixel A is 0.8, the R value in RGB of the new pixel in the second image is 92 (100*0.8+60*0.2). In this way, the pixels of the second image can include more pixel information of the first image, and less pixel information is lost in the second image, thereby improving the definition and display effect of the second image.
An embodiment of the present disclosure provides an image processing method. An electronic device can acquire a first image, perform down-sampling processing on the first image to obtain a first down-sampled image, determine N image blocks from the first down-sampled image, determine an average pixel value corresponding to a plurality of pixels in each image block, and generate a first pooled image based on the average pixel value corresponding to each image block. The electronic device can determine a plurality of pixel merging weights corresponding to pixels in the first down-sampled image, and perform pixel merging processing on the first down-sampled image and the first pooled image based on the plurality of pixel merging weights, to obtain the second image. In this way, since the first down-sampled image can retain more image information of the first image and the first pooled image can retain more image information of the first down-sampled image, the electronic device can retain more image information of the first image in the obtained second image after performing pixel merging processing on the first pooled image and the first down-sampled image, which can not only reduce the resolution of the second image, but also improve the definition of the second image.
Hereafter, based on the embodiment shown in
For any pixel in the first down-sampled image, the target pixel merging weight can be the pixel merging weight determined based on the pixel. For example, the electronic device can determine that the first down-sampled image includes 100 pixel merging weights; and for a pixel in the first down-sampled image, if there are three pixel merging weights determined based on the pixel, the electronic device can determine that the three pixel merging weights are the target pixel merging weights associated with the pixel.
In an embodiment of the present disclosure, the electronic device can determine at least one image block associated with the pixels in the first down-sampled image, and then determine the pixel merging weights associated with the at least one image block associated with the pixels as the target pixel merging weights corresponding to the pixels.
Hereinafter, the process of determining the target pixel merging weight corresponding to the pixel will be described with reference to
Referring to
Hereinafter, the process of determining the target pixel merging weight for pixel A1 will be explained in details with reference to
In the embodiment shown in
In the embodiment shown in
It should be noted that in the embodiment shown in
In an embodiment of the present disclosure, the target pixel may be a pixel in the first pooled image associated with a pixel in the first down-sampled image. For example, for a first pixel (it may be any pixel) in the first down-sampled image, a target pixel corresponding to the first pixel may be a pixel in the first pooled image associated with the position of the first pixel. For example, the target pixel corresponding to the pixel in the first row and first column in the first down-sampled image may be the pixel in the first row and first column in the first pooled image; the target pixel corresponding to the pixel in the 10th row and 5th column in the first down-sampled image may be the pixel in the 10th row and 5th column in the first pooled image.
For example, in the embodiment shown in
It should be noted that after the first down-sampled image is processed based on the average pooling module without padding, some edge pixels will be lost in the obtained first pooled image. For example, in the embodiment shown in
In an embodiment of the present disclosure, for a first pixel (it may be any pixel) in the first down-sampled image, the electronic device can determine one pixel in the second image based on the first pixel, the target pixel merging weight associated with the first pixel and the target pixel associated with the first pixel. In this way, the second image can be obtained by traversing each pixel in the first down-sampled image.
In an embodiment of the present disclosure, the electronic device may determine the second image based on the following formula:
where N can be the number of image blocks corresponding to the pixels, μhk can be the average value of the pixels in the kth image block, δhk can be the variance associated with the pixels in the kth image block, δlhk can be the covariance associated with the pixels in the kth image block, and L is the value of the target pixel.
In this way, based on the above formula, the electronic device can determine the pixel of the second image corresponding to each pixel in the first down-sampled image, and then the second image can be obtained.
Hereinafter, a processing performed by an average pooling module with padding involved in an embodiment of the present disclosure will be described with reference to
Referring to
In this way, after the image is processed based on the average pooling module with padding, the number of pixels of the image will not change (the number of pixels of the image will decrease after the image is processed by an average pooling module without padding), thereby improving the display effect of the image.
It should be noted that when filling pixels at the periphery of the image, the electronic device can use all-zero pixels or fill the pixels based on pixel values of edge pixels, which is not limited in the embodiment of the present disclosure. For example, in the embodiment shown in
Hereinafter, the process of determining the second image will be described with reference to
Referring to
Referring to
Referring to
In this way, after down-sampling, the second image can retain more image information of the first image, and the pixel merging weight corresponding to each pixel in the second image is correlated to this pixel, so the pixel merging weight has higher flexibility, thereby improving the flexibility of pixel merging and the definition of the second image.
In an embodiment of the present disclosure, based on the embodiment shown in
Referring to
Referring to
Referring to
It should be noted that in the lightweight solution, each pixel in the down-sampled image corresponds to one target pixel merging weight, and the electronic device can determine the target pixel merging weight based on any feasible implementation. For example, the electronic device can arbitrarily determine one target pixel merging weight among a plurality of pixel merging weights, or determine the pixel merging weight determined from the image block with the pixel in the center as the target pixel merging weight, which is not limited in the embodiment of the present disclosure.
An embodiment of the present disclosure provides a method for determining a second image, including: for any pixel in the first down-sampled image, acquiring one or more target pixel merging weights determined based on the pixel among a plurality of pixel merging weights, determining a target pixel in the first pooled image corresponding to each pixel in the first down-sampled image, and determining the second image based on the first down-sampled image, a plurality of target pixel merging weights corresponding to a plurality of pixels in the first down-sampled image and target pixels corresponding to the plurality of pixels in the first down-sampled image. In this way, since each pixel in the second image is determined based on the first down-sampled image and an image obtained after performing average pooling processing with padding on the first down-sampled image, more pixel information of the first image can be retained in the second image; furthermore, since the target pixel merging weight corresponding to each pixel is associated with the pixel, the plurality of target pixel merging weights corresponding to the first down-sampled image have higher flexibility, thereby improving the flexibility of down-sampling of the image and improving the image definition after the down-sampling.
The acquisition module 131 is configured to acquire a first image.
The sampling module 132 is configured to perform down-sampling processing on the first image to obtain a first down-sampled image.
The pooling module 133 is configured to perform average pooling processing on pixels in the first down-sampled image to obtain a first pooled image.
The determining module 134 is configured to determine a plurality of pixel merging weights corresponding to the pixels in the first down-sampled image.
The processing module 135 is configured to perform pixel merging processing on the first down-sampled image and the first pooled image based on the plurality of pixel merging weights to obtain a second image.
According to one or more embodiments of the present disclosure, the pooling module 133 can be configured to:
According to one or more embodiments of the present disclosure, the pooling module 133 can be configured to:
According to one or more embodiments of the present disclosure, the determining module 134 can be configured to:
According to one or more embodiments of the present disclosure, the determining module 134 can be configured to:
According to one or more embodiments of the present disclosure, the determining module 134 can be configured to:
According to one or more embodiments of the present disclosure, the processing module 135 can be configured to:
The image processing apparatus provided by the embodiment of the present disclosure can be used to implement the technical solution of the above method embodiments, with similar implementation principle and technical effects, so the details of this embodiment are not repeated here.
As shown in
Generally, the following devices can be connected to the I/O interface 1405: an input device 1406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, etc.; a storage device 1408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1409. The communication device 1409 may allow the electronic device 1400 to communicate with other devices wirelessly or in a wired manner to exchange data. Although
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1409, or installed from the storage device 1408, or installed from the ROM 1402. When the computer program is executed by the processing device 1401, the above functions defined in the method of the embodiments of the present disclosure are performed.
It should be noted that the computer-readable medium mentioned above in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of the computer-readable storage medium may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random-access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, apparatus or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate or transmit a program for use by or in connection with an instruction execution system, apparatus or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency) and the like, or any suitable combination of the above.
The computer-readable medium may be included in the electronic device; or it can exist alone without being assembled into the electronic device.
The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
An embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the image processing method as described in the above embodiments is realized.
An embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, realizes the image processing method as described in the above embodiments.
Computer program codes for performing the operations of the present disclosure may be written in one or more programming languages or their combinations, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as “C” language or similar programming languages. The program code can be completely executed on the user's computer, partially executed on the user's computer, executed as an independent software package, partially executed on the user's computer and partially executed on a remote computer, or completely executed on a remote computer or server. In the case involving a remote computer, the remote computer may be connected to a user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the drawings illustrate the architecture, functions and operations of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than those noted in the drawings. For example, two blocks shown in succession may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented by a dedicated hardware-based system that performs specified functions or operations, or by a combination of dedicated hardware and computer instructions.
The units involved in the embodiments described in the present disclosure can be realized by software or hardware. Among them, the name of the unit does not constitute any limitation of the unit itself in some cases.
The functions described above herein may be at least partially performed by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD) and so on.
In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the above. More specific examples of the machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random-access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a convenient compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
It should be noted that the modifiers such as “a/an/one” and “a plurality of” mentioned in the present disclosure are schematic rather than limitative, and those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as “one or more”.
Names of messages or information exchanged among multiple devices in the embodiments of the present disclosure are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
It should be understood that prior to using the technical solution disclosed in various embodiments of the present disclosure, users should be informed of the type, scope of usage, usage scenarios, etc. of personal information involved in the present disclosure in an appropriate way in accordance with relevant laws and regulations and be authorized by the users.
For example, in response to receiving a user's active request, prompt information is sent to the user to clearly remind the user that the operation requested by the user will require obtaining and using the user's personal information. Therefore, the user can independently choose whether to provide personal information to software or hardware such as electronic devices, applications, servers or storage mediums that perform the operation of the technical solution of the present disclosure according to the prompt information. As an optional but non-limiting implementation, in response to receiving the user's active request, the way to send the prompt information to the user can be, for example, a pop-up window, in which the prompt information can be presented in text. In addition, the pop-up window can also carry a selection control for the user to choose “agree” or “disagree” to provide personal information to the electronic device. It can be understood that the above process of notifying and obtaining user authorization is only schematic, and does not limit the implementation of the present disclosure. Other ways in accordance with relevant laws and regulations can also be applied to the implementation of the present disclosure.
It should be understood that the data involved in the technical solution (including but not limited to the data itself, data acquisition or data usage) shall comply with the requirements of corresponding laws, regulations and relevant regulations. Data can include information, parameters, messages, etc., such as instruction information of stream switching.
The above description merely refers to exemplary embodiments of the present disclosure and the explanation of the applied technical principles. It should be understood by those skilled in the art that the disclosure scope involved in the present disclosure is not limited to the technical solution formed by the specific combination of the above technical features, but also covers other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solution formed by replacing the above features with (but not limited to) technical features having similar functions disclosed in the present disclosure.
Furthermore, although the operations are depicted in a particular order, this should not be understood as requiring that these operations be performed in the particular order as shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be beneficial. Likewise, although several specific implementation details are contained in the above discussion, these should not be construed as limiting the scope of the present disclosure. Some features described in the context of separate embodiments can also be combined in a single embodiment. On the contrary, various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
Although the subject matter has been described in language specific to structural features and/or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and actions described above are only exemplary forms of implementing the appended claims.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202311067464.X | Aug 2023 | CN | national |