Image zooming method and device, electronic equipment and storage medium

By judging the non-flat conditions of the image in the image zoom process, determining the target matching area and performing zoom processing, the blur problem caused by image jitter is solved, the image quality is improved, and it is suitable for low-end camera equipment.

CN120302153APending Publication Date: 2025-07-11BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410033803.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-09
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In image shooting scenes, due to the amplification effect of jitter, the zoom image is prone to drift and blurring, and the prior art is difficult to effectively improve image quality, especially in low-end camera devices, where the hardware cost is high or the scope of application is limited.

Method used

By judging the non-flat conditions of the image, the first and second judgment rules are used to determine the target matching area of the zoom indication area, and zooming is performed based on the target matching area to reduce drift phenomenon and improve image quality.

Benefits of technology

Without the need for additional hardware configuration, the image blur problem is reduced, the stability and quality of zoom images are improved, and it is suitable for low-end camera devices and expands the scope of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120302153A_ABST
    Figure CN120302153A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and particularly provides an image zooming method and device, electronic equipment and a storage medium. The image zooming method comprises the following steps: determining a zooming indication area according to an image zooming instruction for an original image; judging whether a target matching area matched with the zoom indication area exists in the original image or not; if it is determined that the target matching area exists, obtaining a to-be-zoomed image according to the target matching area; according to the technical scheme, the to-be-zoomed image is zoomed according to the target matching area of the zooming indication area in the original image to obtain the target zooming image, so that image zooming is carried out according to the target matching area of the zooming indication area in the original image, the problem of image blurring caused by a drift phenomenon is reduced, and the quality of the zooming image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technologies, and particularly to a method, apparatus, electronic device, and storage medium for image zooming. Background Art

[0002] In an image shooting scenario, the captured image is usually zoomed by means of zooming so as to capture more details.

[0003] However, due to the amplification effect of jitter, the picture usually drifts, resulting in blurring problems in the image and poor image quality. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a method, apparatus, electronic device, and storage medium for image zooming, so as to improve the quality of the zoomed image when zooming the captured image.

[0005] On the one hand, a method for image zooming is provided in the embodiments of this application. The method includes:

[0006] Determine a zoom indication area according to an image zooming instruction for an original image;

[0007] Judge whether there is a target matching area in the original image that matches the zoom indication area;

[0008] If it is determined that there is a target matching area, obtain an image to be zoomed according to the target matching area;

[0009] Perform zooming processing on the image to be zoomed to obtain a target zoomed image.

[0010] In one implementation, judging whether there is a target matching area in the original image that matches the zoom indication area includes:

[0011] Obtain the pixel intensity of each pixel in the original image;

[0012] Judge whether each pixel intensity meets the image non-flat condition. If so, use the first judgment rule to judge whether there is a target matching area;

[0013] Otherwise, use the second judgment rule to judge whether there is a target matching area.

[0014] In one implementation, judging whether each pixel intensity meets the image non-flat condition includes:

[0015] According to the pixel intensities of each pair of horizontally adjacent pixels, respectively determine the pixel intensity level change rate of each pixel;

[0016] Determine the pixel intensity vertical change rate of each pixel respectively according to the pixel intensities of each pair of vertically adjacent pixels;

[0017] Count the number of first pixels whose corresponding pixel intensity horizontal change rate is not less than the horizontal change rate threshold;

[0018] Count the number of second pixels whose corresponding pixel intensity vertical change rate is not less than the vertical change rate threshold;

[0019] Determine the sum of the number of first pixels and the number of second pixels to obtain the total number of pixels;

[0020] Judge whether it meets the image non - flat condition according to the total number of pixels.

[0021] In one implementation, judging whether it meets the image non - flat condition according to the total number of pixels includes:

[0022] Obtain the number of row pixels and the number of column pixels of the original image;

[0023] Determine the pixel change ratio according to the number of row pixels, the number of column pixels and the total number of pixels; the pixel change ratio is positively correlated with the total number of pixels and negatively correlated with both the number of row pixels and the number of column pixels;

[0024] If the pixel change ratio is not less than the ratio threshold, determine that it meets the image non - flat condition; otherwise, determine that it does not meet the image non - flat condition.

[0025] In one implementation, before judging whether each pixel intensity meets the image non - flat condition, the method further includes:

[0026] Divide each pixel in the original image to obtain a plurality of pixel blocks;

[0027] Determine the average value of the pixel intensities of each pixel included in each pixel block respectively to obtain the pixel intensity corresponding to each pixel block;

[0028] Merge each pixel block into a corresponding single pixel to obtain the original image after pixel merging.

[0029] In one implementation, adopt the first judgment rule to judge whether there is a target matching area, including:

[0030] According to the image zoom instruction, determine the trigger area included in the zoom indication area and the floating area including the zoom indication area;

[0031] Generate a sliding window according to the trigger area; the sliding window has the same size as the trigger area;

[0032] Obtain multiple moving regions included in the floating region according to the sliding window and the specified step size; the interval width between adjacent moving regions is the specified step size;

[0033] Determine whether there is a target moving region that matches the trigger region in each moving region. If so, determine that there is a target matching region; otherwise, determine that there is no target matching region.

[0034] In one implementation, determining whether there is a target moving region that matches the trigger region in each moving region includes:

[0035] Determine the average value of the pixel intensities of each pixel in the trigger region to obtain the first pixel average value corresponding to the trigger region;

[0036] Respectively determine the average value of the pixel intensities of the corresponding pixels in each moving region to obtain the second pixel average value corresponding to each moving region;

[0037] According to the pixel intensities of the pixels in the trigger region and the first pixel average value, and the pixel intensities of the pixels corresponding to each moving region and the second pixel average value, determine the matching degree between the trigger region and each moving region;

[0038] Determine the maximum matching degree among the matching degrees;

[0039] If the maximum matching degree is higher than the correlation threshold, determine the moving region corresponding to the maximum matching degree as the target moving region; otherwise, determine that there is no target moving region.

[0040] In one implementation, according to the pixel intensities of the pixels in the trigger region and the first pixel average value, and the pixel intensities of the pixels corresponding to each moving region and the second pixel average value, determining the matching degree between the trigger region and each moving region includes:

[0041] Respectively determine the difference between the pixel intensity of each pixel in the trigger region and the first pixel average value to obtain each first pixel difference;

[0042] For each moving region, perform the following steps:

[0043] Respectively determine the difference between the pixel intensity of each pixel in the moving region and the corresponding second pixel average value to obtain each second pixel difference;

[0044] Determine the covariance of each first pixel difference and each second pixel difference to obtain the first covariance;

[0045] Determine the standard deviation of each first pixel difference to obtain the first standard deviation;

[0046] Determine the standard deviation of each second pixel difference to obtain the second standard deviation;

[0047] Determine the matching degree between the moving area and the triggering area according to the first covariance, the first standard deviation, and the second standard deviation; the matching degree is positively correlated with the first covariance and negatively correlated with both the first standard deviation and the second standard deviation.

[0048] In one implementation, before obtaining the image to be zoomed according to the target matching area, the method further includes:

[0049] Determine the displacement between the target moving area and the triggering area to obtain the target displacement;

[0050] Offset the zoom indication area according to the target displacement to obtain the target matching area.

[0051] In one implementation, using the second judgment rule to determine whether there is a target matching area includes:

[0052] Segment the original image to obtain a plurality of sub-grids;

[0053] Determine the corresponding sub-triggering areas within each sub-grid;

[0054] Determine the target sub-moving areas that match within the corresponding sub-grids for each sub-triggering area;

[0055] Judge whether there is a target matching area according to each target sub-moving area.

[0056] In one implementation, segmenting the original image to obtain a plurality of sub-grids includes:

[0057] If the pixel change ratio is not lower than the first threshold and lower than the second threshold, determine the grid ratio according to the product of the proportional coefficient and the pixel change ratio; the grid ratio is positively correlated with the product; the proportional coefficient is determined according to the first threshold and the second threshold;

[0058] If the pixel change ratio is not lower than the second threshold and lower than the third threshold, determine the specified ratio value as the grid ratio;

[0059] Determine the size of the sub-grid according to the grid ratio;

[0060] Divide the original image into a plurality of sub-grids according to the size of the sub-grid.

[0061] In one implementation, determining the target sub-moving areas that match within the corresponding sub-grids for each sub-triggering area includes:

[0062] For each sub-grid, perform the following steps:

[0063] Generate a sub-sliding window according to the sub-triggering area within the sub-grid; the sub-sliding window has the same size as the sub-triggering area;

[0064] Obtain multiple sub-moving regions included in the sub-grid according to the sub-sliding window and the specified step size; the interval width between adjacent sub-moving regions is the specified step size;

[0065] Determine the matching degree of each sub-moving region with each sub-trigger region respectively;

[0066] Determine the sub-moving region corresponding to the maximum matching degree among the matching degrees as the target sub-moving region matched by the sub-trigger region.

[0067] In one implementation, determining the matching degree of each sub-moving region with each sub-trigger region respectively includes:

[0068] Determine the average value of the pixel intensities of each pixel in the sub-trigger region to obtain the third pixel average value corresponding to the sub-trigger region;

[0069] Respectively determine the average value of the pixel intensities of the corresponding pixels in each sub-moving region to obtain the fourth pixel average value corresponding to each moving region;

[0070] According to the pixel intensities of the pixels in the sub-trigger region and the third pixel average value, and the pixel intensities of the pixels in each sub-moving region and the fourth pixel average value, determine the matching degree of each sub-moving region with each sub-trigger region respectively.

[0071] In one implementation, according to the pixel intensities of the pixels in the sub-trigger region and the third pixel average value, and the pixel intensities of the pixels in each sub-moving region and the fourth pixel average value, determining the matching degree of each sub-moving region with each sub-trigger region respectively includes:

[0072] Respectively determine the difference between the pixel intensity of each pixel in the sub-trigger region and the third pixel average value to obtain each third pixel difference;

[0073] For each sub-moving region respectively, perform the following steps:

[0074] Respectively determine the difference between the pixel intensity of each pixel in the sub-moving region and the fourth pixel average value to obtain each fourth pixel difference;

[0075] Determine the covariance of each third pixel difference and each fourth pixel difference to obtain the second covariance;

[0076] Determine the standard deviation of each third pixel difference to obtain the third standard deviation;

[0077] Determine the standard deviation of each fourth pixel difference to obtain the fourth standard deviation;

[0078] Determine the matching degree between the sub-movement area and the sub-trigger area according to the second covariance, the third standard deviation, and the fourth standard deviation; the matching degree is positively correlated with the second covariance and negatively correlated with both the third standard deviation and the fourth standard deviation.

[0079] In one implementation, determining whether there is a target matching area according to each target sub-movement area includes:

[0080] Determine the displacement length between the target sub-movement area and the sub-trigger area corresponding to each sub-grid respectively;

[0081] Filter out the sub-grids from each sub-grid whose corresponding maximum matching degree is higher than the correlation threshold and whose corresponding displacement length is not higher than the length threshold;

[0082] Determine the number of grids of the filtered-out sub-grids;

[0083] If the number of grids is not higher than the grid threshold, determine that there is no target matching area; otherwise, determine that there is a target matching area.

[0084] In one implementation, before obtaining the image to be zoomed according to the target matching area, the method further includes:

[0085] Determine the variance of the displacement lengths of the filtered-out sub-grids to obtain the displacement variance;

[0086] If the displacement variance is not higher than the variance threshold, offset the zoom indication area according to the average value of the displacement lengths of the filtered-out sub-grids to obtain the target matching area;

[0087] If the displacement variance is higher than the variance threshold, cluster the displacement lengths of the filtered-out sub-grids, and offset the zoom indication area according to the clustering result to obtain the target matching area.

[0088] In one implementation, offsetting the zoom indication area according to the clustering result to obtain the target matching area includes:

[0089] Determine the variance of each displacement length of each category respectively;

[0090] Filter out the target category corresponding to the minimum value among the variances;

[0091] Determine the average value of the displacement lengths of the target category to obtain the category average value;

[0092] Offset the zoom indication area according to the category average value to obtain the target matching area.

[0093] In one implementation, before performing zoom processing on the image to be zoomed to obtain the target zoomed image, the method further includes:

[0094] If it is determined that there is no target matching area, obtain the image to be zoomed according to the zoom indication area.

[0095] On the one hand, an image zooming device is provided in an embodiment of the present application, including:

[0096] A determination unit, configured to determine a zoom indication area according to an image zooming instruction for an original image;

[0097] A judgment unit, configured to judge whether there is a target matching area that matches the zoom indication area in the original image;

[0098] An obtaining unit, configured to obtain the image to be zoomed according to the target matching area if it is determined that there is a target matching area;

[0099] A zooming unit, configured to perform zooming processing on the image to be zoomed to obtain a target zoomed image.

[0100] In one implementation manner, the judgment unit is configured to:

[0101] Obtain the pixel intensity of each pixel in the original image;

[0102] Judge whether each pixel intensity meets the image non-flat condition. If so, adopt the first judgment rule to judge whether there is a target matching area;

[0103] Otherwise, adopt the second judgment rule to judge whether there is a target matching area.

[0104] In one implementation manner, the judgment unit is configured to:

[0105] According to the pixel intensities of each pair of horizontally adjacent pixels, respectively determine the pixel intensity horizontal change rate of each pixel;

[0106] According to the pixel intensities of each pair of vertically adjacent pixels, respectively determine the pixel intensity vertical change rate of each pixel;

[0107] Count the number of first pixels whose corresponding pixel intensity horizontal change rate is not less than the horizontal change rate threshold;

[0108] Count the number of second pixels whose corresponding pixel intensity vertical change rate is not less than the vertical change rate threshold;

[0109] Determine the sum of the number of first pixels and the number of second pixels to obtain the total number of pixels;

[0110] Judge whether it meets the image non-flat condition according to the total number of pixels.

[0111] In one implementation manner, the judgment unit is configured to:

[0112] Obtain the number of row pixels and the number of column pixels of the original image;

[0113] Determine the pixel change ratio according to the number of row pixels, the number of column pixels, and the total number of pixels; the pixel change ratio is positively correlated with the total number of pixels and negatively correlated with both the number of row pixels and the number of column pixels;

[0114] If the pixel change ratio is not lower than the ratio threshold, it is determined that the image non-flat condition is met; otherwise, it is determined that the image non-flat condition is not met.

[0115] In one implementation, the determination unit is further configured to:

[0116] Divide each pixel in the original image to obtain a plurality of pixel blocks;

[0117] Respectively determine the average value of the pixel intensities of the pixels included in each pixel block to obtain the pixel intensity corresponding to each pixel block;

[0118] Merge each pixel block into a corresponding single pixel to obtain the original image after pixel merging.

[0119] In one implementation, the determination unit is configured to:

[0120] According to the image zoom instruction, determine the trigger area included in the zoom indication area and the floating area including the zoom indication area;

[0121] Generate a sliding window according to the trigger area; the sliding window has the same size as the trigger area;

[0122] Obtain a plurality of moving areas included in the floating area according to the sliding window and the specified step size; the interval width between adjacent moving areas is the specified step size;

[0123] Determine whether there is a target moving area that matches the trigger area in each moving area; if so, it is determined that there is a target matching area; otherwise, it is determined that there is no target matching area.

[0124] In one implementation, the determination unit is configured to:

[0125] Determine the average value of the pixel intensities of the pixels in the trigger area to obtain the first pixel average value corresponding to the trigger area;

[0126] Respectively determine the average value of the pixel intensities of the pixels corresponding to each moving area to obtain the second pixel average value corresponding to each moving area;

[0127] Determine the matching degree between the trigger area and each moving area according to the pixel intensities of the pixels in the trigger area and the first pixel average value, and the pixel intensities of the pixels corresponding to each moving area and the second pixel average value;

[0128] Determine the maximum matching degree among the matching degrees;

[0129] If the maximum matching degree is higher than the correlation threshold, determine the movement area corresponding to the maximum matching degree as the target movement area; otherwise, determine that there is no target movement area.

[0130] In one implementation, the judgment unit is used for:

[0131] Respectively determine the difference between the pixel intensity of each pixel in the trigger area and the first pixel average value, and obtain the first pixel differences;

[0132] For each movement area, respectively perform the following steps:

[0133] Respectively determine the difference between the pixel intensity of each pixel in the movement area and the corresponding second pixel average value, and obtain the second pixel differences;

[0134] Determine the covariance of the first pixel differences and the second pixel differences, and obtain the first covariance;

[0135] Determine the standard deviation of the first pixel differences, and obtain the first standard deviation;

[0136] Determine the standard deviation of the second pixel differences, and obtain the second standard deviation;

[0137] According to the first covariance, the first standard deviation, and the second standard deviation, determine the matching degree between the movement area and the trigger area; the matching degree is positively correlated with the first covariance and negatively correlated with both the first standard deviation and the second standard deviation.

[0138] In one implementation, the judgment unit is further used for:

[0139] Determine the displacement between the target movement area and the trigger area, and obtain the target displacement;

[0140] According to the target displacement, offset the zoom indication area to obtain the target matching area.

[0141] In one implementation, the judgment unit is used for:

[0142] Segment the original image to obtain a plurality of sub-grids;

[0143] Determine the corresponding sub-trigger areas within each sub-grid;

[0144] Determine the target sub-movement areas matched by the sub-trigger areas within the corresponding sub-grids;

[0145] According to the target sub-movement areas, judge whether there is a target matching area.

[0146] In one implementation, the judgment unit is used for:

[0147] If the pixel change ratio is not less than the first threshold and less than the second threshold, determine the grid ratio according to the product of the proportionality coefficient and the pixel change ratio; the grid ratio is positively correlated with the product; the proportionality coefficient is determined according to the first threshold and the second threshold;

[0148] If the pixel change ratio is not less than the second threshold and less than the third threshold, determine the specified ratio value as the grid ratio;

[0149] Determine the size of the sub-grid according to the grid ratio;

[0150] Divide the original image into multiple sub-grids according to the size of the sub-grid.

[0151] In one implementation, the judgment unit is used for:

[0152] For each sub-grid, perform the following steps:

[0153] Generate a sub-sliding window according to the sub-trigger area within the sub-grid; the sub-sliding window has the same size as the sub-trigger area;

[0154] Obtain multiple sub-moving areas included in the sub-grid according to the sub-sliding window and the specified step size; the interval width between adjacent sub-moving areas is the specified step size;

[0155] Determine the matching degree between each sub-moving area and each sub-trigger area;

[0156] Determine the target sub-moving area matching the sub-trigger area as the sub-moving area corresponding to the maximum matching degree among the matching degrees.

[0157] In one implementation, the judgment unit is used for:

[0158] Determine the average value of the pixel intensities of the pixels in the sub-trigger area to obtain the third pixel average value corresponding to the sub-trigger area;

[0159] Respectively determine the average value of the pixel intensities of the pixels corresponding to each sub-moving area to obtain the fourth pixel average value corresponding to each moving area;

[0160] Determine the matching degree between each sub-moving area and each sub-trigger area according to the pixel intensities and the third pixel average value of the pixels in the sub-trigger area, and the pixel intensities and the fourth pixel average value of the pixels in each sub-moving area.

[0161] In one implementation, the judgment unit is used for:

[0162] Respectively determine the difference between the pixel intensity of each pixel in the sub-trigger area and the third pixel average value to obtain each third pixel difference;

[0163] For each sub-movement area, perform the following steps:

[0164] Determine the difference between the pixel intensity of each pixel in the sub-movement area and the fourth pixel average respectively, and obtain each fourth pixel difference;

[0165] Determine the covariance of each third pixel difference and each fourth pixel difference, and obtain the second covariance;

[0166] Determine the standard deviation of each third pixel difference, and obtain the third standard deviation;

[0167] Determine the standard deviation of each fourth pixel difference, and obtain the fourth standard deviation;

[0168] According to the second covariance, the third standard deviation, and the fourth standard deviation, determine the matching degree between the sub-movement area and the sub-trigger area; the matching degree is positively correlated with the second covariance and negatively correlated with both the third standard deviation and the fourth standard deviation.

[0169] In one implementation, the judgment unit is used for:

[0170] Determine the displacement length between the target sub-movement area and the sub-trigger area corresponding to each sub-grid respectively;

[0171] From each sub-grid, screen out the sub-grids whose corresponding maximum matching degree is higher than the correlation threshold and whose corresponding displacement length is not higher than the length threshold;

[0172] Determine the number of grids of the screened-out sub-grids;

[0173] If the number of grids is not higher than the grid threshold, determine that there is no target matching area; otherwise, determine that there is a target matching area.

[0174] In one implementation, the judgment unit is also used for:

[0175] Determine the variance of the displacement lengths of the screened-out sub-grids, and obtain the displacement variance;

[0176] If the displacement variance is not higher than the variance threshold, offset the zoom indication area according to the average value of the displacement lengths of the screened-out sub-grids to obtain the target matching area;

[0177] If the displacement variance is higher than the variance threshold, cluster the displacement lengths of the screened-out sub-grids, and offset the zoom indication area according to the clustering result to obtain the target matching area.

[0178] In one implementation, the judgment unit is also used for:

[0179] Determine the variance of the displacement lengths of each category respectively;

[0180] Select the target category corresponding to the minimum value among the variances.

[0181] Determine the average value of each displacement length of the target category to obtain the category average value.

[0182] Offset the zoom indication area according to the category average value to obtain the target matching area.

[0183] In one implementation, the judgment unit is further configured to:

[0184] If it is determined that there is no target matching area, obtain the image to be zoomed according to the zoom indication area.

[0185] On the one hand, an electronic device is provided in an embodiment of the present application, including:

[0186] A processor; and

[0187] A memory storing computer instructions for causing the processor to execute the steps of the method provided in any of the various optional implementations of image zooming as described above.

[0188] On the one hand, a storage medium is provided in an embodiment of the present application, storing computer instructions for causing a computer to execute the steps of the method provided in any of the various optional implementations of image zooming as described above.

[0189] The method for image zooming in the embodiment of the present application includes determining a zoom indication area according to an image zoom instruction for an original image; judging whether there is a target matching area in the original image that matches the zoom indication area; if it is determined that there is a target matching area, obtaining an image to be zoomed according to the target matching area;

[0190] Performing zoom processing on the image to be zoomed to obtain a target zoomed image. In this way, image zooming is performed according to the target matching area of the zoom indication area in the original image, reducing the problem of image blurring caused by the drift phenomenon and improving the quality of the zoomed image. Description of the Drawings

[0191] In order to more clearly illustrate the specific implementation manners of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific implementation manners or the prior art. Obviously, the following drawings are some implementation manners of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0192] Figure 1 It is a flowchart of a method for image zooming in an embodiment of the present application.

[0193] Figure 2 It is an example diagram of a pixel division in an embodiment of the present application.

[0194] Figure 3 It is an example diagram of an image area in an embodiment of the present application.

[0195] Figure 4 It is a schematic diagram of a grid ratio curve in an embodiment of the present application.

[0196] Figure 5 It is an example diagram of a sub-grid division in an embodiment of the present application.

[0197] Figure 6 It is a flowchart of a method for detecting a target matching area in an embodiment of the present application.

[0198] Figure 7 It is a flowchart of a method for the first judgment rule in an embodiment of the present application.

[0199] Figure 8 It is a flowchart of a method for the second judgment rule in an embodiment of the present application.

[0200] Figure 9 It is a structural block diagram of a device for image zooming in an embodiment of the present application.

[0201] Figure 10 It is a schematic structural diagram of an electronic device in an embodiment of the present application. Detailed implementation manners

[0202] Next, the technical solutions of the present application will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application. In addition, the technical features involved in different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0203] First, some terms involved in the embodiments of the present application will be explained to facilitate the understanding of those skilled in the art.

[0204] Terminal device: It can be a mobile terminal, a fixed terminal or a portable terminal, such as a mobile phone, a site, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a personal communication system device, a personal navigation device, a personal digital assistant, an audio / video player, a digital camera / video camera, a positioning device, a TV receiver, a radio broadcast receiver, an e-book device, a gaming device or any combination thereof, including accessories and peripherals of these devices or any combination thereof. It is also foreseeable that the terminal device can support any type of user interface (such as a wearable device), etc.

[0205] Server: It can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms.

[0206] Zoom: It is used to magnify distant objects during shooting, including optical zoom and digital zoom, etc. Optical zoom can support adding more pixels after the main body of the image is formed, making the main body not only larger but also relatively clearer, and the resolution and image quality will not change. Digital zoom can only crop the original image size to make the image larger on the screen, but it does not help to make the details clearer. In the embodiments of the present application, digital zoom is mainly used for zooming.

[0207] In an actual image shooting scenario, usually, the shooting picture is zoomed by zooming to capture more details. However, due to the amplification effect of jitter, the picture usually drifts, resulting in blurred images and poor image quality.

[0208] Under traditional technologies, to ensure the image quality after zooming, the following methods are usually adopted:

[0209] Method 1: Use optical image stabilization for image zooming. Specifically, through hardware settings, instrument jitter during the process of capturing optical signals is avoided or reduced to improve the imaging quality.

[0210] However, adopting this method requires specific hardware, and the hardware cost is relatively high, making it difficult to popularize in low-end imaging devices.

[0211] Method 2: Use electronic image stabilization for image zooming. Specifically, the edge image is used for compensation, and the jitter is compensated by reducing the image quality to improve the imaging quality.

[0212] However, in this way, image compensation cannot be performed in the flat area scenario, and the applicable range is small.

[0213] Based on the defects of the above related technologies, the embodiments of the present application provide a method, device, electronic device, and storage medium for image zooming, aiming to improve the quality of zoomed images when zooming in on captured images.

[0214] The embodiments of the present application provide a method for image zooming. This method can be applied to an electronic device. The present application does not limit the type of the electronic device, which can be any device type suitable for implementation, such as a terminal device and a server, etc. The present application will not elaborate on this.

[0215] Refer to Figure 1 As shown in the flowchart of a method for image zooming in the embodiments of the present application. The following will describe this method in combination with Figure 1 This method will be described below. The specific implementation process of this method is as follows:

[0216] Step 100: Determine a zoom indication area according to an image zooming instruction for an original image.

[0217] Optionally, the image zooming instruction can be triggered by a touch operation on the touch screen, can also be sent by voice, or can be automatically triggered by the system when determining a captured image.

[0218] As an example, the electronic device is a mobile phone. After the mobile phone enables the high-magnification digital zoom mode of the camera, the user manually triggers a certain position of the camera screen (i.e., the original image) twice to trigger the image zooming instruction.

[0219] Among them, the captured image of the electronic device is the original image, and the zoom indication area is the area to be zoomed determined according to the image zooming instruction.

[0220] As an example, determine the trigger area triggered by the user in the original image (such as the touch point of the finger on the touch screen), and based on the trigger area, divide the zoom indication area from the original image. Among them, the zoom indication area includes the trigger area. Specifically, according to the magnification of the zoomed image and the size of the image display window, determine the size of the image before magnification, and with the trigger area as the center, divide the zoom indication area of this image size from the original image. That is to say, the size of the zoom indication area after zooming processing is the size of the image display window.

[0221] Furthermore, for the convenience of subsequent image zooming, the original image can also be subjected to grayscale conversion to obtain the converted original image.

[0222] Furthermore, for the convenience of subsequent pixel calculation, the pixels in the original image can also be merged to obtain the original image after pixel merging.

[0223] In one implementation, when merging the pixels in the original image, the following steps can be adopted:

[0224] S1001: Divide each pixel in the original image to obtain a plurality of pixel blocks.

[0225] Among them, each pixel block contains a plurality of original pixels.

[0226] S1002: Respectively determine the average value of the pixel intensities of the pixels included in each pixel block to obtain the pixel intensities corresponding to the respective pixel blocks.

[0227] S1003: Merge each pixel block into a corresponding single pixel to obtain the original image after pixel merging.

[0228] Among them, the size of the original image can be expressed as m×n, and the pixel block size can be expressed as p×q, where m, n, p, and q are all positive numbers. The following combines Figure 2 to illustrate the pixel division of the original image by way of example. Refer to Figure 2 As shown, it is an example diagram of pixel division. Figure 2 The smallest grid in represents a pixel. Divide the multiple pixels in the original image to obtain a plurality of pixel blocks. It should be noted that Figure 2 is only used to illustrate the pixels and pixel blocks in the original image. If there are problems such as unclear image lines, it does not affect the clarity of the specification. For example, if both p and q are 4, the size of the original image after pixel merging is (m / 4)×(n / 4). The pixel intensity of any merged pixel (i.e., the p×q pixel block) in the original image after pixel merging is the average value of the pixel intensities of its corresponding original pixels (i.e., the pixels in the original image before pixel merging).

[0229] Step 101: Determine whether there is a target matching area that matches the zoom indication area in the original image.

[0230] In one implementation, when performing step 101, the following steps can be adopted:

[0231] S1011: Obtain the pixel intensities of the pixels in the original image.

[0232] In one implementation, obtain the pixel intensities of the pixels (i.e., merged pixels) in the original image after pixel merging.

[0233] S1012: Determine whether each pixel intensity meets the image non-flat condition. If so, execute S1013; otherwise, execute S1014.

[0234] In one implementation, when determining whether each pixel intensity meets the image non-flat condition, the following steps can be adopted:

[0235] S1012-1: Determine the pixel intensity horizontal change rate of each pixel respectively according to the pixel intensities of each pair of horizontally adjacent pixels.

[0236] In one implementation, determine the absolute value of the difference between the pixel intensity of the previous pixel, i.e., pixel (i, j - 1), and the pixel intensity of the next pixel, i.e., pixel (i, j), in each row, and determine the ratio of the absolute value to the pixel intensity of the previous pixel as the pixel intensity horizontal change rate of pixel (i, j).

[0237] Optionally, when determining the pixel intensity horizontal change rate of pixel (i, j) in the image, the following formula can be used:

[0238]

[0239] where i represents the row number of the pixel in the image, j represents the column number of the pixel in the image, I(i, j) represents the pixel intensity of pixel (i, j), and I H-ratio (i, j) represents the pixel intensity horizontal change rate of pixel (i, j).

[0240] S1012-2: Determine the pixel intensity vertical change rate of each pixel respectively according to the pixel intensities of each pair of vertically adjacent pixels.

[0241] Similarly, the pixel intensity vertical change rate of each pixel can be determined. Optionally, when determining the pixel intensity vertical change rate of pixel (i, j) in the image, the following formula can be used:

[0242]

[0243] where I V-ratio (i, j) represents the pixel intensity vertical change rate of pixel (i, j).

[0244] S1012-3: Count the number of first pixels whose corresponding pixel intensity horizontal change rate is not less than the horizontal change rate threshold.

[0245] S1012-4: Count the number of second pixels whose corresponding pixel intensity vertical change rate is not less than the vertical change rate threshold.

[0246] In practical applications, the horizontal change rate threshold and the vertical change rate threshold can be the same or different, and can be set according to the actual application scenario, which is not limited here.

[0247] S1012-5: Determine the sum of the number of first pixels and the number of second pixels to obtain the total number of pixels.

[0248] Specifically, both the horizontal change rate threshold and the vertical change rate threshold are represented as δ. When I H-ratio (i, j) ≥ δ or I V-ratio (i, j) ≥ δ, it indicates that the intensity change of the pixel (i, j) is effective. Therefore, the total number of pixels N with effective intensity changes in each row and each column is counted HV-ratio .

[0249] S1012 - 6: Determine whether the image non - flat condition is met according to the total number of pixels

[0250] In one implementation, when executing S1012 - 6, the following steps can be adopted

[0251] S1012 - 61: Obtain the number of row pixels and the number of column pixels of the original image

[0252] Specifically, the number of row pixels in each row of the original image is the same. Therefore, count the number of pixels in any row to obtain the number of row pixels. Similarly, obtain the number of column pixels

[0253] Furthermore, for the original image after pixel merging, the number of row pixels can be expressed as m / p, and the number of column pixels can be expressed as n / q. Where m and n are respectively the number of row pixels and the number of column pixels of the original image before pixel merging, and p and q are respectively the number of row pixels and the number of column pixels of the pixel block

[0254] S1012 - 62: Determine the pixel change ratio according to the number of row pixels, the number of column pixels, and the total number of pixels

[0255] Among them, the pixel change ratio is positively correlated with the total number of pixels, and negatively correlated with both the number of row pixels and the number of column pixels

[0256] Optionally, when determining the pixel change ratio I valid-propor , the following formula can be adopted

[0257]

[0258] S1012 - 63: If the pixel change ratio is not less than the ratio threshold, determine that the image non - flat condition is met; otherwise, determine that the image non - flat condition is not met

[0259] In one implementation, the ratio threshold can be represented as μ. If I valid-propor ≥ μ, determine that the image non - flat condition is met; otherwise, determine that the image non - flat condition is not met

[0260] In practical applications, the ratio threshold can be set according to the actual application scenario and is not limited here

[0261] S1013: Use the first judgment rule to determine whether there is a target matching area.

[0262] In one implementation, when executing S1013, the following steps can be adopted:

[0263] S1013-1: According to the image zoom instruction, determine the trigger area included in the zoom indication area and the floating area including the zoom indication area.

[0264] Among them, the trigger area is a sub-area of the zoom indication area. The zoom indication area is a sub-area of the floating area.

[0265] S1013-2: Generate a sliding window according to the trigger area.

[0266] Among them, the size of the sliding window is the same as that of the trigger area.

[0267] S1013-3: Obtain multiple moving areas included in the floating area of the original image according to the sliding window and the specified step size.

[0268] Among them, adjacent moving areas overlap, and the interval width between the two (i.e., the width of the non-overlapping part) is the specified step size; the floating area is obtained by expanding the trigger area.

[0269] In practical applications, the specified length can be set according to the actual application scenario.

[0270] In one implementation, move the sliding window multiple times in the floating area of the original image according to the specified direction and the specified step size, and obtain the moving area in the sliding window after each movement.

[0271] As an example, if the specified step size is one pixel, then in the floating area, move the sliding window one pixel from left to right or from top to bottom, and use the area in the moved sliding window as the moving area.

[0272] In one implementation, expand the zoom indication area according to the specified floating ratio (e.g., 1.2) to obtain the floating area in the original image. Specifically, expand the height and width of the zoom indication area respectively according to the specified floating ratio to obtain the floating area.

[0273] In practical applications, the specified floating ratio can be set according to the actual application scenario and is not limited here.

[0274] The following combines Figure 3 to illustrate the image area. Refer to Figure 3 As shown, it is an example diagram of an image area. Figure 3 It is the original image I display, the original image contains a floating area I Ssearch , the floating area contains a zoom indication area I dis_pre , the zoom indication area Idis_pre contains a trigger area I refer .

[0275] S1013-4: Determine whether there is a target moving area in each moving area that matches the trigger area. If so, determine that there is a target matching area; otherwise, determine that there is no target matching area.

[0276] In one implementation, when determining whether there is a target moving area in each moving area that matches the trigger area, the following steps can be adopted:

[0277] S1013-41: Determine the average value of the pixel intensities of each pixel in the trigger area to obtain the first pixel average value corresponding to the trigger area.

[0278] Optionally, when determining the first pixel average value, the following formula can be used:

[0279]

[0280] where, I Mean-ref is the first pixel average value, m ref and n ref respectively represent the number of row pixels and the number of column pixels of the trigger area, and I ref (i,j) represents the pixel intensity of the pixel at the i-th row and j-th column in the trigger area, that is, the pixel (i,j).

[0281] S1013-41: Respectively determine the average value of the pixel intensities of the corresponding pixels in each moving area to obtain the second pixel average value corresponding to each moving area.

[0282] Optionally, when determining the second pixel average value of any moving area, the following formula can be used:

[0283]

[0284] where, I Mean-Slid is the second pixel average value, I Slid (i,j) represents the pixel intensity of the pixel (i,j) in the moving area. The number of row pixels and the number of column pixels of the moving area and the trigger area are the same, both being m ref and n ref .

[0285] S1013 - 43: Determine the matching degrees between the trigger area and each moving area according to the pixel intensities of the pixels in the trigger area and the first pixel average value, as well as the pixel intensities of the pixels corresponding to each moving area and the second pixel average value.

[0286] In one implementation, when executing S1013 - 43, the following steps can be adopted:

[0287] S1013 - 431: Determine the differences between the pixel intensities of each pixel in the trigger area and the first pixel average value respectively, and obtain each first pixel difference.

[0288] Optionally, when determining the first pixel difference Dif ref (i, j) corresponding to the pixel (i, j) in the trigger area, the following formula can be used:

[0289] Dif ref (i, j) = I ref (i, j) - I Mean-ref .

[0290] S1013 - 432: For each moving area respectively, execute the following steps:

[0291] Determine the differences between the pixel intensities of each pixel in the moving area and the corresponding second pixel average value respectively, and obtain each second pixel difference; determine the covariance of each first pixel difference and each second pixel difference, and obtain the first covariance; determine the standard deviation of each first pixel difference, and obtain the first standard deviation; determine the standard deviation of each second pixel difference, and obtain the second standard deviation; determine the matching degree between the moving area and the trigger area according to the first covariance, the first standard deviation and the second standard deviation.

[0292] Among them, the matching degree is positively correlated with the first covariance and negatively correlated with both the first standard deviation and the second standard deviation.

[0293] In the embodiments of the present application, the normalized correlation coefficient NCC between different areas is used as the matching degree.

[0294] Optionally, when determining the second pixel difference Dif Slid (i, j) corresponding to the pixel (i, j) in the moving area, the following formula can be used:

[0295] Dif Slid (i, j) = I Slid (i, j) - I Mean-Slid .

[0296] Optionally, when determining the matching degree NCC(M, N) between the moving area (M, N) and the trigger area, the following formula can be used:

[0297]

[0298] Among them, NCC(M, N) represents the matching degree between the moving area (M, N) and the triggering area. Both M and N are natural numbers, representing the number of rows and columns of the moving area in the floating area respectively. That is to say, each moving area in the floating area is sorted by row and column, and the number of rows and columns of each moving area is obtained.

[0299] S1013 - 44: Determine the maximum matching degree among the matching degrees.

[0300] Furthermore, a matching degree matrix can also be generated based on each NCC(M, N), and then the maximum matching degree NCC in this matching degree matrix can be obtained. max 。

[0301] S1013 - 45: If the maximum matching degree is higher than the correlation threshold, determine the moving area corresponding to the maximum matching degree as the target moving area; otherwise, determine that there is no target moving area.

[0302] In one implementation, the correlation threshold can be expressed as σ. If NCC max > σ, determine the moving area corresponding to the maximum matching degree as the target moving area; otherwise, determine that there is no target moving area.

[0303] In practical applications, the correlation threshold can be set according to the actual application scenario and is not limited here.

[0304] In this way, the target moving area is the best target matching area of the triggering area in the floating area.

[0305] Furthermore, if it is determined that there is a target moving area, the target matching area can be determined according to the target moving area.

[0306] In one implementation, when determining the target matching area, the following steps can be adopted:

[0307] S1013 - 451: Determine the displacement between the target moving area and the triggering area to obtain the target displacement. Optionally, when determining the target displacement, the following formula can be used:

[0308] Offset = (Δx, Δy);

[0309] Among them, Offset represents the target displacement, Δx represents the displacement in the x - direction of different areas, and Δy represents the displacement in the y - direction of different areas.

[0310] S1013 - 452: Offset the zoom indication area according to the target displacement to obtain the target matching area.

[0311] Assume the zoom indication area I dis_pre If the coordinates of the upper left corner pixel are (X display , Y display ), it can be offset according to the target displacement to obtain the offset target matching area I dis_pre_offset , and the coordinates of the upper left corner pixel thereof are (X display + Δx, Y display + Δy).

[0312] In this way, the target matching area matching the zoom indication area can be obtained.

[0313] S1014: Adopt the second judgment rule to judge whether there is a target matching area.

[0314] In one implementation, when executing S1014, the following steps can be adopted:

[0315] S1014-1: Segment the original image to obtain multiple sub-grids.

[0316] In one implementation, when executing S1014-1, the following steps can be adopted:

[0317] S1014-11: If the pixel change ratio is not lower than the first threshold and lower than the second threshold, determine the grid ratio according to the product of the proportional coefficient and the pixel change ratio; the grid ratio is positively correlated with the product; if the pixel change ratio is not lower than the second threshold and lower than the third threshold, determine the specified ratio value as the grid ratio.

[0318] Among them, the grid ratio is the ratio between the diagonal line of the sub-grid and the diagonal line of the original image. In practical applications, the first threshold, the second threshold, the third threshold, the proportional coefficient, and the specified ratio value can all be set according to the actual application scenario and are not limited here.

[0319] Optionally, when determining the grid ratio, the following formula can be used:

[0320]

[0321] Among them, grid ratio is the grid ratio, α1 is the first threshold, α2 is the second threshold, 1 is the third threshold, β1 is the specified ratio value, is the proportional coefficient, and β2 is a constant. Optionally, 0.5 ≤ β1 < β2 ≤ 0.8; μ ≤ α1 < α2 ≤ 0.9.

[0322] The following is combined with Figure 4 to illustrate the change of the grid ratio. Refer to Figure 4 shown, which is a schematic diagram of a grid ratio curve. Figure 4When the pixel change ratio is not less than the first threshold and less than the second threshold, determine the grid ratio according to the product of the proportional coefficient and the pixel change ratio; when the pixel change ratio is not less than the second threshold and less than the third threshold, use the specified ratio value as the grid ratio.

[0323] S1014-12: Determine the size of the sub-grid according to the grid ratio.

[0324] S1014-13: Divide the original image into multiple sub-grids according to the size of the sub-grid.

[0325] In this way, each sub-grid can be regarded as a different floating area.

[0326] S1014-2: Determine the corresponding sub-trigger areas within each sub-grid.

[0327] In one implementation, in each sub-grid, select a smaller area as the sub-trigger area. In practical applications, the sub-trigger area can be selected according to the actual application scenario, which is not limited here.

[0328] The following combines Figure 5 to illustrate the grid division. Figure 5 It is an example diagram of sub-grid division. Figure 5 In it, the original image is divided into multiple sub-grids, and the sub-trigger areas in each sub-grid are determined respectively.

[0329] S1014-3: Determine the target sub-movement areas matched by each sub-trigger area within the corresponding sub-grid.

[0330] In one implementation, for each sub-grid, perform the following steps:

[0331] S1014-31: Generate a sub-sliding window according to the sub-trigger area within the sub-grid.

[0332] Among them, the size of the sub-sliding window is the same as that of the sub-trigger area.

[0333] S1014-32: Obtain multiple sub-movement areas included in the sub-grid according to the sub-sliding window and the specified step size; the interval width between adjacent sub-movement areas is the specified step size.

[0334] It should be noted that the specified step size corresponding to the sub-sliding window and the specified step size corresponding to the sliding window can be the same or different, which is not limited here.

[0335] S1014-33: Determine the matching degree between each sub-movement area and each sub-trigger area.

[0336] In one implementation, when performing S1014-33, the following steps can be adopted:

[0337] S1014-331: Determine the average of the pixel intensities of each pixel in the sub-trigger region to obtain the third pixel average corresponding to the sub-trigger region.

[0338] S1014-332: Respectively determine the average of the pixel intensities of the corresponding pixels in each sub-movement region to obtain the fourth pixel average corresponding to each movement region.

[0339] S1014-333: Determine the matching degree between each sub-movement region and each sub-trigger region according to the pixel intensities of the pixels in the sub-trigger region and the third pixel average, and the pixel intensities of the pixels in each sub-movement region and the fourth pixel average.

[0340] In one implementation, when executing S1014-333, the following steps can be adopted:

[0341] S1014-3331: Respectively determine the difference between the pixel intensity of each pixel in the sub-trigger region and the third pixel average to obtain each third pixel difference;

[0342] S1014-3332: For each sub-movement region, execute the following steps:

[0343] Respectively determine the difference between the pixel intensity of each pixel in the sub-movement region and the fourth pixel average to obtain each fourth pixel difference; determine the covariance of each third pixel difference and each fourth pixel difference to obtain the second covariance; determine the standard deviation of each third pixel difference to obtain the third standard deviation; determine the standard deviation of each fourth pixel difference to obtain the fourth standard deviation; determine the matching degree between the sub-movement region and the sub-trigger region according to the second covariance, the third standard deviation, and the fourth standard deviation.

[0344] Among them, the matching degree is positively correlated with the second covariance and negatively correlated with both the third standard deviation and the fourth standard deviation.

[0345] It should be noted that the principle similar to that for determining the sliding window, the movement region, and the matching degree between the movement region and the trigger region can be adopted to determine the sub-sliding window, the sub-movement region, and the matching degree between the sub-movement region and the sub-trigger region, which will not be elaborated here.

[0346] S1014-34: Determine the sub-movement region corresponding to the maximum matching degree among the matching degrees as the target sub-movement region matched by the sub-trigger region.

[0347] S1014-4: Judge whether there is a target matching region according to each target sub-movement region.

[0348] In one implementation, when executing S1014-4, the following steps can be adopted:

[0349] S1014-41: Determine the displacement length between the target sub-movement area and the sub-trigger area corresponding to each sub-grid respectively.

[0350] In one implementation, determine the displacement between the target sub-movement area and the sub-trigger area, and determine the displacement length according to this displacement.

[0351] Optionally, the displacement Offset(h,v) between the target sub-movement area and the sub-trigger area in the sub-grid (h, v) can be expressed as:

[0352] Offset(h,v) = (Δx h,v , Δy h,v );

[0353] where, Δx h,v represents the displacement in the x direction between the target sub-movement area and the sub-trigger area in the sub-grid (h, v), and Δy h,v represents the displacement in the y direction between the target sub-movement area and the sub-trigger area in the sub-grid (h, v). h and v represent the row and column numbers of the sub-grid. That is, sort each sub-grid in the original image to obtain the row and column numbers of each sub-grid.

[0354] where, when determining the displacement length ΔL(h,v) corresponding to the sub-grid (h, v), the following formula can be adopted:

[0355]

[0356] S1014-42: Screen out the sub-grids from each sub-grid whose corresponding maximum matching degree is higher than the correlation threshold and whose corresponding displacement length is not higher than the length threshold.

[0357] S1014-43: Determine the number of grids of the screened sub-grids.

[0358] Specifically, screen out the number of grids z of the sub-grids that meet NCC max (h,v) > σ and ΔL(h,v) ≤ ΔL max from each sub-grid. Where, NCC max (h,v) is the maximum matching degree corresponding to the sub-grid (h, v), and ΔL max is the length threshold.

[0359] In practical applications, both the correlation threshold and the length threshold can be set according to the actual application scenario, which is not limited here.

[0360] S1014-44: If the number of grids is not higher than the grid threshold, it is determined that there is no target matching area; otherwise, it is determined that there is a target matching area.

[0361] Specifically, if z ≤ T1, it is determined that there is no target matching area, indicating that the electronic device moves significantly or the focused picture changes significantly at this time; otherwise, it is determined that there is a target matching area, indicating that the moving range of the electronic device is small or the focused picture does not change much. Here, T1 is the grid threshold.

[0362] In practical applications, the grid threshold can be set according to the actual application scenario and is not limited here.

[0363] Furthermore, if it is determined that there is a target matching area, then determine the target matching area.

[0364] In one implementation, when determining the target matching area, the following steps can be adopted:

[0365] S1014-441: Determine the variance of the displacement lengths of the selected sub-grids to obtain the displacement variance ΔL(h,v) Var 。

[0366] S1014-442: If the displacement variance ΔL(h,v) Var is not higher than the variance threshold Ω, then, according to the average value Offset of the displacement lengths of the selected sub-grids mean , offset the zoom indication area I dis_pre to obtain the target matching area I dis_pre_offset 。

[0367] In this way, since the sub-grids and the trigger area are on the same plane, the displacement changes of the sub-grids and the zoom indication area are the same. Therefore, the average value can be used as the displacement change of the zoom indication area, and based on this displacement change, the target matching area can be obtained.

[0368] S1014-443: If the displacement variance is higher than the variance threshold, cluster the displacement lengths of the selected sub-grids, and based on the clustering result, offset the zoom indication area to obtain the target matching area.

[0369] In one implementation, if ΔL(h,v) Var > Ω, use a clustering algorithm (such as the DBSCAN clustering algorithm) to cluster the displacement lengths ΔL Best (h,v) of the selected sub-grids to obtain multiple categories.

[0370] As an example, when clustering, set the radius to ξ and the minimum number of points to MinPts = 2, and for each ΔL BestPerform DBSCAN clustering on (h, v). Among them, ξ is a positive number.

[0371] In one implementation, when performing offset on the zoom indication area according to the clustering result to obtain the target matching area, the following steps can be adopted:

[0372] S1014-4431: Determine the variance ΔL(h, v) of the displacement lengths of each category respectively DBSCAN-Var .

[0373] S1014-4432: Screen out the target category corresponding to the minimum value among the variances.

[0374] S1014-4433: Determine the average value of the displacement lengths of the target category to obtain the category average value Offset DBSCAN-mean ;

[0375] S1014-4434: Perform offset on the zoom indication area according to the category average value Offset DBSCAN-mean to obtain the target matching area.

[0376] Similarly, use this category average value as the displacement change of the zoom indication area, and obtain the target matching area according to this displacement change.

[0377] Step 102: If it is determined that there is a target matching area, obtain the image to be zoomed according to the target matching area.

[0378] Specifically, obtain the image to be zoomed that only contains the target matching area.

[0379] Furthermore, if it is determined that there is no target matching area, obtain the image to be zoomed according to the zoom indication area. Specifically, obtain the image to be zoomed that only contains the zoom indication area.

[0380] Step 103: Perform zoom processing on the image to be zoomed to obtain the target zoomed image.

[0381] In one implementation, perform interpolation magnification on the image to be zoomed to obtain the target zoomed image.

[0382] Specifically, if there is a target matching area I dis_pre_offset , then perform interpolation magnification on the target matching area I dis_pre_offset to obtain the target image I display_offset .

[0383] The following further describes the method for determining whether there is a target matching area in the above embodiments with reference to Figure 6 As shown in Figure 6 , it is a flowchart of a method for detecting a target matching area, and the specific process of this method is as follows:

[0384] Step 600: Determine a zoom indication area according to an image zoom instruction for an original image.

[0385] Step 601: Perform grayscale conversion on the original image to obtain the converted original image.

[0386] Step 602: Perform pixel merging on the converted original image to obtain the original image after pixel merging.

[0387] Step 603: Determine the pixel change ratio of the original image after pixel merging.

[0388] Step 604: Determine whether the pixel change ratio is not lower than a ratio threshold. If so, execute Step 605; otherwise, execute Step 606.

[0389] Step 605: Use a first judgment rule to determine whether there is a target matching area.

[0390] Step 606: Use a second judgment rule to determine whether there is a target matching area.

[0391] Specifically, when executing Steps 600 - 606, for the specific steps, refer to the above Steps 100 - 103.

[0392] The following combines Figure 7 to elaborate in detail on the method of the first judgment rule. Refer to Figure 7 as shown, which is a flowchart of the method of the first judgment rule. The specific process of this method is as follows:

[0393] Step 700: According to the image zoom instruction, determine a trigger area, a zoom indication area, and a floating area in the original image after pixel merging.

[0394] Step 701: Determine the matching degree between the trigger area and each moving area in the floating area respectively.

[0395] Step 702: According to each matching degree, determine whether there is a target moving area that matches the trigger area. If so, execute Step 703; otherwise, execute Step 705.

[0396] Step 703: Offset the zoom indication area according to the trigger area and the target moving area to obtain a target matching area.

[0397] Step 704: Obtain a to-be-zoomed image that only contains the target matching area, and execute Step 706.

[0398] Step 705: Obtain a to-be-zoomed image that only contains the zoom indication area.

[0399] Step 706: Perform zoom processing on the to-be-zoomed image to obtain a target zoomed image.

[0400] Specifically, when performing steps 700 - 706, for the specific steps, refer to the above steps 100 - 103.

[0401] The following combines Figure 8 to elaborate on the method of the second judgment rule. Refer to Figure 8 As shown, it is a flowchart of the method of the second judgment rule. The specific process of this method is as follows:

[0402] Step 800: Segment the original image to obtain multiple sub - grids.

[0403] Step 801: Determine the corresponding sub - trigger regions and sub - movement regions within each sub - grid.

[0404] Step 802: Determine the matching degree between the corresponding sub - movement regions and sub - trigger regions within each sub - grid.

[0405] Step 803: According to each matching degree, determine the target sub - movement region that the sub - trigger region within each sub - grid matches.

[0406] Step 804: Determine the displacement length between each sub - trigger region and the corresponding target sub - movement region.

[0407] Step 805: According to each matching degree and each displacement length, screen each sub - grid to obtain the number of grids of the screened sub - grids.

[0408] Step 806: Judge whether the number of grids is not higher than the grid threshold. If so, execute step 807; otherwise, execute step 808.

[0409] Step 807: Determine that there is no target matching region.

[0410] Step 808: According to the displacement lengths of the screened sub - grids, determine the displacement variance.

[0411] Step 809: Judge whether the displacement variance is not higher than the variance threshold. If so, execute step 810; otherwise, execute step 811.

[0412] Step 810: Offset the zoom indication area according to the average value of the displacement lengths of the screened sub - grids to obtain a target matching region.

[0413] Step 811: Cluster the displacement lengths of the screened sub - grids.

[0414] Step 812: Offset the zoom indication area according to the clustering result to obtain a target matching region.

[0415] Specifically, when performing steps 800 - 812, refer to the above steps 100 - 103 for specific steps.

[0416] In the embodiments of the present application, according to the change of the pixel intensity of each pixel in the image, it is determined whether the image is a flat area, and according to the determination result of the flat area of the image, it is determined whether there is a target matching area that matches the zoom indication area in the image, so as to perform zoom output on the zoom indication area when the picture changes greatly, and perform zoom output on the target matching area when the focus picture changes little. No additional hardware configuration is required, reducing the hardware cost, which can be popularized in low - end imaging devices, and can consider flat area scenarios, with a wider range of use, reducing the problem of image blurring, and improving the stability and image quality of the imaging device in zoom (such as, ultra - high magnification zoom) scenarios.

[0417] Based on the same inventive concept, an image zooming device is also provided in the embodiments of the present application. Since the principle of solving problems by the above - mentioned device and equipment is similar to that of an image zooming method, therefore, the implementation of the above - mentioned device can refer to the implementation of the method, and the repeated parts will not be elaborated. This device can be applied to electronic devices. The present application does not limit the type of electronic devices, which can be any device type suitable for implementation, such as terminal devices and servers, etc. The present application will not elaborate on this.

[0418] Refer to Figure 9 As shown, it is a structural block diagram of an image zooming device in the embodiments of the present application. In some embodiments, the image zooming device exemplified in the present application includes:

[0419] A determination unit 901, configured to determine a zoom indication area according to an image zooming instruction for an original image;

[0420] A judgment unit 902, configured to judge whether there is a target matching area in the original image that matches the zoom indication area;

[0421] An obtaining unit 903, configured to obtain a to - be - zoomed image according to the target matching area if it is determined that there is a target matching area;

[0422] A zoom unit 904, configured to perform zoom processing on the to - be - zoomed image to obtain a target zoom image.

[0423] In one embodiment, the judgment unit 902 is configured to:

[0424] Obtain the pixel intensity of each pixel in the original image;

[0425] Judge whether each pixel intensity meets the non - flat image condition. If so, adopt the first judgment rule to judge whether there is a target matching area;

[0426] Otherwise, the second judgment rule is adopted to judge whether there is a target matching area.

[0427] In one implementation, the judgment unit 902 is configured to:

[0428] According to the pixel intensities of each pair of horizontally adjacent pixels, respectively determine the pixel intensity horizontal change rate of each pixel;

[0429] According to the pixel intensities of each pair of vertically adjacent pixels, respectively determine the pixel intensity vertical change rate of each pixel;

[0430] Count the number of first pixels whose corresponding pixel intensity horizontal change rate is not lower than the horizontal change rate threshold;

[0431] Count the number of second pixels whose corresponding pixel intensity vertical change rate is not lower than the vertical change rate threshold;

[0432] Determine the sum of the number of first pixels and the number of second pixels to obtain the total number of pixels;

[0433] According to the total number of pixels, judge whether the image non-flat condition is met.

[0434] In one implementation, the judgment unit 902 is configured to:

[0435] Obtain the number of row pixels and the number of column pixels of the original image;

[0436] According to the number of row pixels, the number of column pixels and the total number of pixels, determine the pixel change ratio; the pixel change ratio is positively correlated with the total number of pixels and negatively correlated with both the number of row pixels and the number of column pixels;

[0437] If the pixel change ratio is not lower than the ratio threshold, it is determined that the image non-flat condition is met; otherwise, it is determined that the image non-flat condition is not met.

[0438] In one implementation, the judgment unit 902 is further configured to:

[0439] Divide each pixel in the original image to obtain a plurality of pixel blocks;

[0440] Respectively determine the average value of the pixel intensities of the pixels included in each pixel block to obtain the pixel intensity corresponding to each pixel block;

[0441] Merge each pixel block into a corresponding single pixel to obtain the original image after pixel merging.

[0442] In one implementation, the judgment unit 902 is configured to:

[0443] According to the image zoom instruction, determine the trigger area included in the zoom indication area and the floating area including the zoom indication area;

[0444] Generate a sliding window according to the trigger area; the sliding window has the same size as the trigger area;

[0445] Obtain multiple moving areas included in the floating area according to the sliding window and the specified step size; the interval width between adjacent moving areas is the specified step size;

[0446] Determine whether there is a target moving area that matches the trigger area in each moving area. If so, it is determined that there is a target matching area; otherwise, it is determined that there is no target matching area.

[0447] In one implementation, the determining unit 902 is configured to:

[0448] Determine the average value of the pixel intensities of each pixel in the trigger area to obtain the first pixel average value corresponding to the trigger area;

[0449] Respectively determine the average value of the pixel intensities of the corresponding pixels in each moving area to obtain the second pixel average value corresponding to each moving area;

[0450] According to the pixel intensities of the pixels in the trigger area and the first pixel average value, and the pixel intensities of the pixels corresponding to each moving area and the second pixel average value, determine the matching degree between the trigger area and each moving area;

[0451] Determine the maximum matching degree among the matching degrees;

[0452] If the maximum matching degree is higher than the associated threshold, determine the moving area corresponding to the maximum matching degree as the target moving area; otherwise, determine that there is no target moving area.

[0453] In one implementation, the determining unit 902 is configured to:

[0454] Respectively determine the difference between the pixel intensity of each pixel in the trigger area and the first pixel average value to obtain the first pixel differences;

[0455] For each moving area, perform the following steps:

[0456] Respectively determine the difference between the pixel intensity of each pixel in the moving area and the corresponding second pixel average value to obtain the second pixel differences;

[0457] Determine the covariance of the first pixel differences and the second pixel differences to obtain the first covariance;

[0458] Determine the standard deviation of the first pixel differences to obtain the first standard deviation;

[0459] Determine the standard deviation of the second pixel differences to obtain the second standard deviation;

[0460] Determine the matching degree between the moving area and the triggering area according to the first covariance, the first standard deviation, and the second standard deviation; the matching degree is positively correlated with the first covariance and negatively correlated with both the first standard deviation and the second standard deviation.

[0461] In one implementation, the determining unit 902 is further configured to:

[0462] Determine the displacement between the target moving area and the triggering area to obtain the target displacement;

[0463] Offset the zoom indication area according to the target displacement to obtain the target matching area.

[0464] In one implementation, the determining unit 902 is configured to:

[0465] Segment the original image to obtain a plurality of sub-grids;

[0466] Determine the corresponding sub-triggering areas within each sub-grid;

[0467] Determine the target sub-moving areas matched within the corresponding sub-grids by the respective sub-triggering areas;

[0468] Judge whether there is a target matching area according to each target sub-moving area.

[0469] In one implementation, the determining unit 902 is configured to:

[0470] If the pixel change ratio is not less than the first threshold and less than the second threshold, then determine the grid ratio according to the product of the proportional coefficient and the pixel change ratio; the grid ratio is positively correlated with the product; the proportional coefficient is determined according to the first threshold and the second threshold;

[0471] If the pixel change ratio is not less than the second threshold and less than the third threshold, then determine the specified ratio value as the grid ratio;

[0472] Determine the size of the sub-grid according to the grid ratio;

[0473] Divide the original image into a plurality of sub-grids according to the size of the sub-grid.

[0474] In one implementation, the determining unit 902 is configured to:

[0475] For each sub-grid respectively, perform the following steps:

[0476] Generate a sub-sliding window according to the sub-triggering area within the sub-grid; the sub-sliding window has the same size as the sub-triggering area;

[0477] Obtain multiple sub-moving regions included in the sub-grid according to the sub-sliding window and the specified step size; the interval width between adjacent sub-moving regions is the specified step size;

[0478] Determine the matching degree of each sub-moving region with each sub-trigger region;

[0479] Determine the sub-moving region corresponding to the maximum matching degree among the matching degrees as the target sub-moving region matched by the sub-trigger region.

[0480] In one implementation, the determination unit 902 is used for:

[0481] Determine the average value of the pixel intensities of each pixel in the sub-trigger region to obtain the third pixel average value corresponding to the sub-trigger region;

[0482] Respectively determine the average value of the pixel intensities of the corresponding pixels in each sub-moving region to obtain the fourth pixel average value corresponding to each moving region;

[0483] According to the pixel intensities and the third pixel average value of the pixels in the sub-trigger region, and the pixel intensities and the fourth pixel average value of the pixels in each sub-moving region, determine the matching degree of each sub-moving region with each sub-trigger region.

[0484] In one implementation, the determination unit 902 is used for:

[0485] Respectively determine the difference between the pixel intensity of each pixel in the sub-trigger region and the third pixel average value to obtain each third pixel difference;

[0486] For each sub-moving region, perform the following steps:

[0487] Respectively determine the difference between the pixel intensity of each pixel in the sub-moving region and the fourth pixel average value to obtain each fourth pixel difference;

[0488] Determine the covariance of each third pixel difference and each fourth pixel difference to obtain the second covariance;

[0489] Determine the standard deviation of each third pixel difference to obtain the third standard deviation;

[0490] Determine the standard deviation of each fourth pixel difference to obtain the fourth standard deviation;

[0491] According to the second covariance, the third standard deviation, and the fourth standard deviation, determine the matching degree between the sub-moving region and the sub-trigger region; the matching degree is positively correlated with the second covariance and negatively correlated with both the third standard deviation and the fourth standard deviation.

[0492] In one implementation, the determination unit 902 is used for:

[0493] Determine the displacement length between the target sub-movement area and the sub-trigger area corresponding to each sub-grid respectively;

[0494] From each sub-grid, filter out the sub-grids whose corresponding maximum matching degree is higher than the correlation threshold and whose corresponding displacement length is not higher than the length threshold;

[0495] Determine the number of grids of the filtered sub-grids;

[0496] If the number of grids is not higher than the grid threshold, determine that there is no target matching area, otherwise, determine that there is a target matching area.

[0497] In one implementation, the judgment unit 902 is further configured to:

[0498] Determine the variance of the displacement lengths of the filtered sub-grids respectively, and obtain the displacement variance;

[0499] If the displacement variance is not higher than the variance threshold, offset the zoom indication area according to the average value of the displacement lengths of the filtered sub-grids to obtain the target matching area;

[0500] If the displacement variance is higher than the variance threshold, cluster the displacement lengths of the filtered sub-grids, and offset the zoom indication area according to the clustering result to obtain the target matching area.

[0501] In one implementation, the judgment unit 902 is further configured to:

[0502] Determine the variance of the displacement lengths of each category respectively;

[0503] Filter out the target category corresponding to the minimum value among the variances;

[0504] Determine the average value of the displacement lengths of the target category to obtain the category average value;

[0505] Offset the zoom indication area according to the category average value to obtain the target matching area.

[0506] In one implementation, the judgment unit 902 is further configured to:

[0507] If it is determined that there is no target matching area, obtain the image to be zoomed according to the zoom indication area.

[0508] The method for image zooming in the embodiments of the present application includes determining a zoom indication area according to an image zooming instruction for an original image; determining whether there is a target matching area in the original image that matches the zoom indication area; if it is determined that there is a target matching area, obtaining the image to be zoomed according to the target matching area;

[0509] Perform zoom processing on the zoom image to obtain the target zoom image. In this way, according to the target matching area of the zoom indication area in the original image, image zooming is performed, reducing the image blurring problem caused by the drift phenomenon and improving the quality of the zoom image.

[0510] In an embodiment of the present application, an electronic device is provided, including:

[0511] A processor; and

[0512] A memory storing computer instructions for causing the processor to execute the method of any of the above embodiments.

[0513] In an embodiment of the present application, a storage medium is provided, storing computer instructions for causing a computer to execute the method of any of the above embodiments. Figure 10 A schematic structural diagram of an electronic device 1000 is shown. Refer to Figure 10 As shown, the electronic device 1000 includes: a processor 1010 and a memory 1020. Optionally, it may further include a power supply 1030, a display unit 1040, and an input unit 1050.

[0514] The processor 1010 is the control center of the electronic device 1000, connecting each component using various interfaces and lines, and performing various functions of the electronic device 1000 by running or executing software programs and / or data stored in the memory 1020, thereby performing overall monitoring of the electronic device 1000.

[0515] In an embodiment of the present application, when the processor 1010 calls the computer program stored in the memory 1020, it executes each step in the above embodiment.

[0516] Optionally, the processor 1010 may include one or more processing units; preferably, the processor 1010 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, applications, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 1010. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be separately implemented on independent chips.

[0517] The memory 1020 may mainly include a program storage area and a data storage area. Among them, the program storage area may store the operating system, various applications, etc.; the data storage area may store data created according to the use of the electronic device 1000, etc. In addition, the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.

[0518] The electronic device 1000 further includes a power supply 1030 (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 1010 through a power management system, so as to manage functions such as charging, discharging, and power consumption through the power management system.

[0519] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 1000. In the embodiments of the present application, it is mainly used to display the display interfaces of various applications in the electronic device 1000 and objects such as text and pictures displayed in the display interfaces. The display unit 1040 may include a display panel 1041. The display panel 1041 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0520] The input unit 1050 can be used to receive information such as numbers or characters input by the user. The input unit 1050 may include a touch panel 1051 and other input devices 1052. Among them, the touch panel 1051, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 1051).

[0521] Specifically, the touch panel 1051 can detect the touch operation of the user, detect the signals brought by the touch operation, convert these signals into contact coordinates, send them to the processor 1010, and receive and execute the commands sent by the processor 1010. In addition, the touch panel 1051 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. The other input devices 1052 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0522] Of course, the touch panel 1051 can cover the display panel 1041. After the touch panel 1051 detects a touch operation on or near it, it is transmitted to the processor 1010 to determine the type of touch event. Subsequently, the processor 1010 provides a corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 10 the touch panel 1051 and the display panel 1041 are implemented as two independent components to realize the input and output functions of the electronic device 1000, in some embodiments, the touch panel 1051 and the display panel 1041 can be integrated to realize the input and output functions of the electronic device 1000.

[0523] The electronic device 1000 may further include one or more sensors, such as a pressure sensor, a gravitational acceleration sensor, a proximity light sensor, etc. Of course, according to the needs in specific applications, the above-mentioned electronic device 1000 may further include other components such as a camera. Since these components are not the key components used in the embodiments of the present application, therefore, in Figure 10 it is not shown and will not be described in detail.

[0524] Those skilled in the art can understand that Figure 10 this is only an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown in the figure, or combine certain components, or different components.

[0525] For the convenience of description, the above parts are divided into various modules (or units) according to their functions and described separately. Of course, when implementing the present application, the functions of the various modules (or units) can be implemented in the same or multiple software or hardware.

[0526] Obviously, the above embodiments are only examples clearly described and not limitations on the embodiments. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to enumerate all the embodiments here. And the obvious changes or modifications derived therefrom are still within the protection scope of the present invention.

Claims

1. A method for image zooming, characterized in that, The method includes: Determining a zoom indication area according to an image zoom instruction for an original image; Judging whether there is a target matching area in the original image that matches the zoom indication area; If it is determined that there is the target matching area, obtaining a to-be-zoomed image according to the target matching area; Performing zoom processing on the to-be-zoomed image to obtain a target zoomed image.

2. The method according to claim 1, characterized in that The judging whether there is a target matching area in the original image that matches the zoom indication area includes: Obtaining the pixel intensity of each pixel in the original image; Judging whether each pixel intensity meets an image non-flat condition. If so, using a first judgment rule to judge whether there is the target matching area; Otherwise, using a second judgment rule to judge whether there is the target matching area.

3. The method according to claim 2, wherein The judging whether each pixel intensity meets the image non-flat condition includes: Respectively determining the pixel intensity horizontal change rate of each pixel according to the pixel intensities of each pair of horizontally adjacent pixels; Respectively determining the pixel intensity vertical change rate of each pixel according to the pixel intensities of each pair of vertically adjacent pixels; Counting the number of first pixels whose corresponding pixel intensity horizontal change rate is not lower than a horizontal change rate threshold; Counting the number of second pixels whose corresponding pixel intensity vertical change rate is not lower than a vertical change rate threshold; Determining the sum of the number of the first pixels and the number of the second pixels to obtain the total number of pixels; Judging whether it meets the image non-flat condition according to the total number of pixels.

4. The method according to claim 3, wherein The judging whether it meets the image non-flat condition according to the total number of pixels includes: Obtaining the number of row pixels and the number of column pixels of the original image; Determining a pixel change ratio according to the number of row pixels, the number of column pixels and the total number of pixels; the pixel change ratio is positively correlated with the total number of pixels and negatively correlated with both the number of row pixels and the number of column pixels; If the pixel change ratio is not lower than a ratio threshold, determining that it meets the image non-flat condition; otherwise, determining that it does not meet the image non-flat condition.

5. The method according to any one of claims 2-4, characterized in that Before judging whether each pixel intensity meets the image non-flat condition, the method further includes: Dividing each pixel in the original image to obtain a plurality of pixel blocks; Respectively determining the average value of the pixel intensities of the pixels included in each pixel block to obtain the pixel intensity corresponding to each pixel block; Merging each pixel block into a corresponding single pixel to obtain the original image after pixel merging.

6. The method according to any one of claims 2-4, characterized in that The using the first judgment rule to judge whether there is the target matching area includes: Determining a trigger area included in the zoom indication area and a floating area including the zoom indication area according to the image zoom instruction; Generating a sliding window according to the trigger area; the sliding window has the same size as the trigger area; Obtaining a plurality of moving areas included in the floating area according to the sliding window and a specified step length; the interval width between adjacent moving areas is the specified step length; Determine whether there is a target moving area in each moving area that matches the trigger area. If so, determine that there is the target matching area; otherwise, determine that there is no such target matching area.

7. The method according to claim 6, wherein The determining whether there is a target moving area in each moving area that matches the trigger area includes: Determine the average value of the pixel intensities of each pixel in the trigger area to obtain a first pixel average value corresponding to the trigger area; Respectively determine the average value of the pixel intensities of the corresponding pixels in each moving area to obtain a second pixel average value corresponding to each moving area; According to the pixel intensities of each pixel in the trigger area and the first pixel average value, and the pixel intensities of the corresponding pixels in each moving area and the second pixel average value, determine the matching degree between the trigger area and each moving area; Determine the maximum matching degree among the matching degrees; If the maximum matching degree is higher than the associated threshold, determine that the moving area corresponding to the maximum matching degree is the target moving area; otherwise, determine that there is no such target moving area.

8. The method according to claim 7, characterized in that The determining the matching degree between the trigger area and each moving area according to the pixel intensities of each pixel in the trigger area and the first pixel average value, and the pixel intensities of the corresponding pixels in each moving area and the second pixel average value includes: Respectively determine the difference between the pixel intensity of each pixel in the trigger area and the first pixel average value to obtain respective first pixel differences; For each moving area, perform the following steps: Respectively determine the difference between the pixel intensity of each pixel in the moving area and the corresponding second pixel average value to obtain respective second pixel differences; Determine the covariance of the respective first pixel differences and the respective second pixel differences to obtain a first covariance; Determine the standard deviation of the respective first pixel differences to obtain a first standard deviation; Determine the standard deviation of the respective second pixel differences to obtain a second standard deviation; According to the first covariance, the first standard deviation, and the second standard deviation, determine the matching degree between the moving area and the trigger area; the matching degree is positively correlated with the first covariance and negatively correlated with both the first standard deviation and the second standard deviation.

9. The method according to claim 6, characterized in that, Before obtaining the image to be zoomed according to the target matching area, the method further includes: Determine the displacement between the target moving area and the trigger area to obtain a target displacement; According to the target displacement, offset the zoom indication area to obtain the target matching area.

10. The method according to claim 4, characterized in that The using a second judgment rule to judge whether there is the target matching area includes: Segment the original image to obtain a plurality of sub-grids; Determine the corresponding sub-trigger areas within each sub-grid; Determine the target sub-moving areas matched by the respective sub-trigger areas within the corresponding sub-grids; According to the respective target sub-moving areas, judge whether there is the target matching area.

11. The method according to claim 10, wherein The segmenting the original image to obtain a plurality of sub-grids includes: If the pixel change ratio is not less than the first threshold and less than the second threshold, determine a grid ratio according to the product of a proportionality coefficient and the pixel change ratio; the grid ratio is positively correlated with the product; the proportionality coefficient is determined according to the first threshold and the second threshold; If the pixel change ratio is not less than the second threshold and less than the third threshold, determine a specified ratio value as the grid ratio; Determine the size of a sub-grid according to the grid ratio; Divide the original image into a plurality of sub-grids according to the size of the sub-grid.

12. The method according to claim 10, wherein The determining of the target sub-movement area matched by each sub-trigger area in the corresponding sub-grid includes: For each sub-grid, perform the following steps: Generate a sub-sliding window according to the sub-trigger area in the sub-grid; the sub-sliding window has the same size as the sub-trigger area; Obtain a plurality of sub-movement areas included in the sub-grid according to the sub-sliding window and a specified step size; the interval width between adjacent sub-movement areas is the specified step size; Determine the matching degree of each sub-movement area with each sub-trigger area; Determine the sub-movement area corresponding to the maximum matching degree among the matching degrees as the target sub-movement area matched by the sub-trigger area.

13. The method according to claim 12, characterized in that, The determining of the matching degree of each sub-movement area with each sub-trigger area includes: Determine the average value of the pixel intensities of the pixels in the sub-trigger area to obtain a third pixel average value corresponding to the sub-trigger area; Respectively determine the average value of the pixel intensities of the corresponding pixels in each sub-movement area to obtain fourth pixel average values corresponding to the respective movement areas; Determine the matching degree of each sub-movement area with each sub-trigger area according to the pixel intensities of the pixels in the sub-trigger area and the third pixel average value, and the pixel intensities of the pixels in each sub-movement area and the fourth pixel average value.

14. The method according to claim 13, wherein The determining of the matching degree of each sub-movement area with each sub-trigger area according to the pixel intensities of the pixels in the sub-trigger area and the third pixel average value, and the pixel intensities of the pixels in each sub-movement area and the fourth pixel average value includes: Respectively determine the difference between the pixel intensity of each pixel in the sub-trigger area and the third pixel average value to obtain third pixel differences; For each sub-movement area, perform the following steps: Respectively determine the difference between the pixel intensity of each pixel in the sub-movement area and the fourth pixel average value to obtain fourth pixel differences; Determine the covariance of the third pixel differences and the fourth pixel differences to obtain a second covariance; Determine the standard deviation of the third pixel differences to obtain a third standard deviation; Determine the standard deviation of the fourth pixel differences to obtain a fourth standard deviation; Determine the matching degree between the sub-movement area and the sub-trigger area according to the second covariance, the third standard deviation, and the fourth standard deviation; the matching degree is positively correlated with the second covariance and negatively correlated with both the third standard deviation and the fourth standard deviation.

15. The method according to any one of claims 10-14, characterized in that, The judging of whether there is the target matching area according to each target sub-movement area includes: Determine the displacement length between the target sub - movement area and the sub - trigger area corresponding to each sub - grid respectively; From each sub - grid, filter out the sub - grids whose corresponding maximum matching degree is higher than the correlation threshold and whose corresponding displacement length is not higher than the length threshold; Determine the number of grids of the filtered sub - grids; If the number of grids is not higher than the grid threshold, determine that the target matching area does not exist; otherwise, determine that the target matching area exists.

16. The method according to claim 15, wherein Before obtaining the image to be zoomed according to the target matching area, the method further includes: Determine the variance of the displacement lengths of the filtered sub - grids to obtain the displacement variance; If the displacement variance is not higher than the variance threshold, offset the zoom indication area according to the average value of the displacement lengths of the filtered sub - grids to obtain the target matching area; If the displacement variance is higher than the variance threshold, cluster the displacement lengths of the filtered sub - grids and offset the zoom indication area according to the clustering result to obtain the target matching area.

17. The method according to claim 16, characterized in that The offsetting the zoom indication area according to the clustering result to obtain the target matching area includes: Determine the variance of the displacement lengths of each category respectively; Filter out the target category corresponding to the minimum value among the variances; Determine the average value of the displacement lengths of the target category to obtain the category average value; Offset the zoom indication area according to the category average value to obtain the target matching area.

18. The method according to any one of claims 1-4, characterized in that, Before performing zoom processing on the image to be zoomed to obtain the target zoomed image, the method further includes: If it is determined that the target matching area does not exist, obtain the image to be zoomed according to the zoom indication area.

19. An image zooming device, characterized in that, The device includes: A determination unit, configured to determine a zoom indication area according to an image zoom instruction for an original image; A judgment unit, configured to judge whether there is a target matching area in the original image that matches the zoom indication area; An obtaining unit, configured to, if it is determined that the target matching area exists, obtain the image to be zoomed according to the target matching area; A zoom unit, configured to perform zoom processing on the image to be zoomed to obtain a target zoomed image.

20. An electronic device, characterized in that, Includes: A processor; And A memory, storing computer instructions, where the computer instructions are used to cause the processor to execute the method according to any one of claims 1 to 18.

21. A storage medium, characterized in that, Storing computer instructions, where the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 18.