Image processing method and device
By finding and merging overexposed pixel areas in pictures, basic graphics are automatically added, solving the problem of low efficiency for users to manually add special effects to pictures, and improving the efficiency and aesthetics of picture processing.
Patent Information
- Application Number
- CN202010104777.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-20
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-02-20
AI Technical Summary
It is inefficient for users to add special effects to pictures manually.
By obtaining multiple pixels of the image to be processed, find the overexposed pixels, determine the placement area based on these pixels, and place the basic graphics in the area for merging to achieve automatic addition of special effects to the image.
It improves the efficiency of adding special effects to pictures, improves the look and feel of pictures, realizes automated processing, and reduces the complexity of manual operations.
Smart Images

Figure CN113284040B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for processing an image. Background Art
[0002] In order to highlight the characteristics of pictures, such as product pictures displayed on shopping websites, and to attract the attention of viewers, it is often necessary to add some special effects such as shining effects to the pictures.
[0003] Currently, users mainly add special effects to pictures manually.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] It is inefficient for users to add special effects to pictures manually. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a method and device for image processing, which realizes automatic addition of special effects to images and can effectively improve the efficiency of adding special effects to images.
[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for processing an image is provided, comprising:
[0008] Acquire a picture to be processed, and extract a plurality of pixel points of the picture to be processed, wherein the pixel points include color value information;
[0009] According to the preset overexposure value interval and the color value information, searching for overexposed pixel points from the plurality of pixel points;
[0010] Determine a placement area for a preset basic graphic according to the overexposed pixel points;
[0011] The basic graphic is placed in the placement area, and the basic graphic and the picture to be processed are merged.
[0012] Preferably,
[0013] After extracting a plurality of pixel points of the image to be processed, the method further includes:
[0014] Mapping each of the pixel points to a preset coordinate system to determine the position coordinates of each of the pixel points;
[0015] Determining the center point of the placement area according to the position coordinates of the overexposed pixel point;
[0016] Placing the basic graphic in the placement area includes: controlling the distance between the center point of the basic graphic and the center point of the position to be no greater than a preset distance threshold.
[0017] Preferably, determining the position center point of the placement area includes:
[0018] When the number of the overexposed pixels is at least two,
[0019] According to the position coordinates of each of the overexposed pixel points, the image to be processed is divided into at least one overexposed area;
[0020] In each of the overexposed areas, a position center point is selected for a preset basic pattern.
[0021] Preferably, dividing the image to be processed into at least one overexposed area includes:
[0022] For the overexposed pixels that have not been selected, execute:
[0023] Selecting a first overexposed pixel from the overexposed pixels that have not been selected;
[0024] searching for a second overexposed pixel point that satisfies a first area limiting condition for the first overexposed pixel point according to the position coordinates of the overexposed pixel point that has not been selected and the position coordinates of the first overexposed pixel point;
[0025] After the search is completed, if the second overexposed pixel point is found, the second overexposed pixel point is selected, and the maximum area surrounded by the position coordinates of the second overexposed pixel point and the position coordinates of the first overexposed pixel point is determined as an overexposed area.
[0026] Preferably, the above-mentioned image processing method further comprises:
[0027] If the second overexposed pixel point is not found, the position coordinates of the first overexposed pixel point are used as a position center point.
[0028] Preferably, dividing the image to be processed into at least one overexposed area includes:
[0029] Each of the overexposed pixels is used as a third overexposed pixel, and for each of the third overexposed pixels, the following steps are performed:
[0030] searching for a fourth overexposed pixel point that satisfies the second region limiting condition for the third overexposed pixel point, and determining that a maximum region enclosed by the position coordinates of the third overexposed pixel point and the position coordinates of the fourth overexposed pixel point is an overexposed sub-region;
[0031] When the number of the overexposed sub-regions is at least two,
[0032] The overexposed sub-regions with the same overexposed pixel point are merged into one overexposed region, so that the overexposed pixel point belongs to only one overexposed region.
[0033] Preferably, searching for a second overexposed pixel point that satisfies a first area limiting condition for the first overexposed pixel point includes:
[0034] Loop through the following steps until the search is complete:
[0035] Searching for a fifth overexposed pixel point adjacent to the position coordinates of the first overexposed pixel point from the overexposed pixel points that have never been selected; if the fifth overexposed pixel point is found, taking the fifth overexposed pixel point as the first overexposed pixel point; if the fifth overexposed pixel point is not found, ending the search;
[0036] Determine that all the fifth overexposed pixel points found are the second overexposed pixel points that meet the first area limitation condition.
[0037] Preferably, in each of the overexposed areas, selecting a position center point for a preset basic pattern includes:
[0038] A limit edge point included in the overexposed area is determined as the position center point.
[0039] Preferably, in each of the overexposed areas, selecting a position center point for a preset basic pattern includes:
[0040] For each of the overexposed areas, the following steps are executed in a loop until all the position center points of the overexposed areas are determined:
[0041] Determine whether the theoretical center point of the overexposed area is located in the overexposed area,
[0042] If yes, the theoretical center point is determined to be the position center point, and the current process ends;
[0043] Otherwise, a straight line parallel to the coordinate axis of the coordinate system is drawn at the theoretical center point to cut the overexposed area into at least two new overexposed areas, and the new overexposed areas are used as overexposed areas.
[0044] Preferably, after placing the basic graphic in the placement area and before merging the basic graphic and the picture to be processed, the method further comprises:
[0045] The basic graphics are adjusted according to preset mapping parameters and parameter thresholds.
[0046] A picture processing device includes: an extraction unit, a search unit and a merging unit, wherein:
[0047] The extraction unit is used to obtain a picture to be processed and extract a plurality of pixel points of the picture to be processed, wherein the pixel points include color value information;
[0048] The search unit is used to search for overexposed pixels from the plurality of pixels according to a preset overexposed value interval and the color value information;
[0049] The merging unit is used to determine a placement area for a preset basic graphic according to the overexposed pixel points found by the searching unit; place the basic graphic in the placement area, and merge the basic graphic and the image to be processed.
[0050] One embodiment of the above invention has the following advantages or beneficial effects: Since the overexposed pixels of an image will affect the overall look and feel of the image, the look and feel of the image can generally be improved by superimposing a basic graphic in the overexposed pixel area. The embodiment of the present invention extracts multiple pixels of the image to be processed, and searches for overexposed pixels from multiple pixels according to a preset overexposed value interval and color value information, and then determines a placement area for a preset basic graphic according to the overexposed pixels, places the basic graphic in the placement area, and merges the basic graphic and the image to be processed. Since the placement area is determined based on the overexposed pixels, that is, the basic graphic is added to the area where the overexposed pixels are located, thereby obtaining a special effect image, thereby realizing the automatic addition of special effects to the image, and can effectively improve the efficiency of adding special effects to the image.
[0051] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0053] Figure 1 is a schematic diagram of the main process of the image processing method according to an embodiment of the present invention;
[0054] Figure 2 is a schematic diagram of an enlarged distribution of some pixels of a picture A to be processed according to an embodiment of the present invention;
[0055] Figure 3 is a schematic diagram of mapping some pixels of a picture A to be processed onto a coordinate system according to an embodiment of the present invention;
[0056] Figure 4 is a schematic diagram showing that a theoretical center point is located in an overexposed area B according to an embodiment of the present invention;
[0057] Figure 5 is a schematic diagram of dividing a new overexposed area from the overexposed area C according to an embodiment of the present invention;
[0058] Figure 6 is a schematic diagram of a special effect picture according to an embodiment of the present invention;
[0059] Figure 7 is a schematic diagram of main units of a picture processing device according to an embodiment of the present invention;
[0060] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0061] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0063] Overexposed pixels generally refer to pixels that accumulate white or close to white colors seen by the naked eye. The color value range of the overexposed pixels is generally (225, 225, 225) to (255, 255, 255), where the color value refers to the RGB value of the pixel, that is, the color value of the overexposed pixel is between RGB (225, 225, 225) and RGB (255, 255, 255), and may include two pixels with color values of (225, 225, 225) and (255, 255, 255).
[0064] The position center point refers to the position coordinates that can control the placement of the basic graphic. After the center point of the basic graphic is placed on the image to be processed, the distance between the center point of the basic graphic and the position center point is not greater than a preset deviation threshold.
[0065] Figure 1 is a picture processing method according to an embodiment of the present invention, such as Figure 1 As shown, the steps of the image processing method may include:
[0066] S101: Acquire a picture to be processed, extract a plurality of pixel points of the picture to be processed, and the pixel points include color value information;
[0067] S102: searching for overexposed pixels from a plurality of pixels according to a preset overexposed value interval and color value information;
[0068] S103: determining a placement area for a preset basic graphic according to the overexposed pixels;
[0069] S104: placing the basic graphic in the placement area, and merging the basic graphic and the image to be processed.
[0070] The extraction of multiple pixel points of the image to be processed may be the extraction of all pixel points on the image to be processed, or the extraction of pixel points within an area of the image to be processed selected by the user.
[0071] The above-mentioned preset overexposure value interval can be an RGB value interval set by the user according to the specific situation of the picture. Preferably, the RGB value interval is between RGB (225, 225, 225) and RGB (255, 255, 255).
[0072] The obtaining of the image to be processed may also be importing the image to be processed into a canvas.
[0073] Among them, a specific implementation method for searching for overexposed pixels from multiple pixels is to traverse the multiple pixels with a canvas, search for pixels within a preset overexposed value interval, and determine that the pixels within the preset overexposed value interval are overexposed pixels.
[0074] exist Figure 1 In the embodiment shown, since the overexposed pixels of the image will affect the overall look and feel of the image, the look and feel of the image can generally be improved by superimposing a basic graphic in the overexposed pixel area. The embodiment of the present invention extracts multiple pixel points of the image to be processed, and searches for overexposed pixels from multiple pixel points according to a preset overexposed value interval and color value information, then determines a placement area for a preset basic graphic based on the overexposed pixels, places the basic graphic in the placement area, and merges the basic graphic and the image to be processed. Since the placement area is determined based on the overexposed pixels, that is, the basic graphic is added to the area where the overexposed pixels are located, thereby obtaining a special effects image, thereby realizing the automatic addition of special effects to the image, and can effectively improve the efficiency of adding special effects to the image.
[0075] In one embodiment of the present invention, the specific implementation of the above step S101 may be to extract pixels from the upper left corner of the image to be processed, from left to right and from top to bottom, and sort the pixels according to the order in which they are extracted. Figure 2As shown, some pixels on the image A to be processed are extracted and sorted to obtain a pixel set, and the pixels in the pixel set include color value information (color value information of pixel 1, color value information of pixel 2, color value information of pixel 3, color value information of pixel 4, ..., color value information of pixel 10, color value information of pixel 11, color value information of pixel 12, ...). The color value information can be RGB and a transparent value, and the RGB and transparent values of each pixel can be sorted in the set according to the order of extraction. RGB is a color standard in the industry. Various colors are obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue.
[0076] In one embodiment of the present invention, after extracting multiple pixel points of the image to be processed, it may further include: mapping each pixel point to a preset coordinate system to determine the position coordinates of each pixel point; determining the position center point of the placement area according to the position coordinates of the overexposed pixel points; accordingly, placing the basic graphic in the placement area, including: controlling the distance between the center point of the basic graphic and the position center point to be no greater than a preset distance threshold. Preferably, the preset distance threshold is 0, that is, the center point of the basic graphic coincides with the position center point or the center point of the basic graphic is superimposed on the position center point. Through this mapping process and coordinate system, accurate positioning of the overexposed pixel points is achieved, thereby achieving accurate positioning of the position center point to ensure that the placement position of the basic graphic is relatively accurate.
[0077] In one embodiment of the present invention, the specific implementation method of mapping each pixel point to a preset coordinate system and determining the position coordinates of each pixel point can be, with the upper left corner of the image as the coordinate origin, mapping the extracted pixel points to the coordinate system so that the y-axis coordinates of the pixels belonging to the same row / column are the same, and correspondingly, the x-axis coordinates of the pixels belonging to the same column / row are the same. One mapping method can be, for example Figure 3 As shown, Figure 2 Some of the given pixels are mapped to the coordinate system, pixel 1 is mapped to (0, 0), pixel 2 is mapped to (1, 0), pixel 3 is mapped to (2, 0), pixel 4 is mapped to (3, 0), ..., pixel 10 is mapped to (9, 0), pixel 11 is mapped to (0, 1), pixel 12 is mapped to (1, 1), pixel 13 is mapped to (2, 1), .... Through the above-mentioned method of constructing the coordinate system and mapping, after mapping, the real state of the image to be processed can be reflected to a large extent, so that the position of the overexposed pixel can be determined more accurately.
[0078] In addition, it is worth explaining that during the mapping process, in the horizontal direction / in the same row, the spacing between two adjacent pixels can be a horizontal coordinate difference of 1, or a horizontal coordinate difference of other predetermined values such as 0.1, 0.2, 0.5, 2, etc., but the spacing between each two adjacent pixels must be kept equal. In the vertical direction / in the same column, the spacing between two adjacent pixels can be a horizontal coordinate difference of 1, or a vertical coordinate difference of other predetermined values such as 0.1, 0.2, 0.5, 2, etc., but the spacing between each two adjacent pixels must be kept equal. In addition, the coordinates of the first pixel in the upper left corner can also be other coordinate values, as long as the relative positions of the pixels in the coordinate system are consistent with the relative positions of the pixels in the image to be processed.
[0079] In addition, it is worth noting that after mapping each pixel point to a preset coordinate system, the difference between the maximum horizontal coordinate and the minimum horizontal coordinate of any row of pixel points is a fixed multiple of the actual length of the row of pixel points on the image to be processed. Preferably, the difference between the maximum horizontal coordinate and the minimum horizontal coordinate of any row of pixel points is consistent with the actual length of the row of pixel points on the image to be processed, that is, the fixed multiple is 1.
[0080] In one embodiment of the present invention, when the number of overexposed pixel points is one, the position coordinates of the overexposed pixel point are the position center point.
[0081] In one embodiment of the present invention, when the number of overexposed pixels is at least two, at least one overexposed area is divided for the image to be processed according to the position coordinates of each overexposed pixel; in each overexposed area, a position center point is selected for a preset basic graphic. The influence of the basic graphic on the non-overexposed area of the image to be processed can be effectively reduced, while improving the special effects of the synthesized image. The following two specific implementations both implement clustering, that is, clustering overexposed pixels with similar positions in the same overexposed area, which can effectively avoid a continuous overexposed area from being split, and also avoid non-continuous overexposed areas from being merged, so that the display effect of the synthesized image is better.
[0082] In one embodiment of the present invention, the above-mentioned division of at least one overexposed area for the image to be processed can be implemented by two specific implementation methods. The user can select different specific implementation methods according to the actual situation of the image to be processed, so that the division of at least one overexposed area for the image to be processed has a certain degree of flexibility.
[0083] The first is a specific implementation method for dividing a to-be-processed image into at least one overexposed area: for overexposed pixels that have not been selected, executing: selecting a first overexposed pixel from overexposed pixels that have not been selected; searching for a second overexposed pixel that meets the first area restriction condition for the first overexposed pixel based on the position coordinates of the overexposed pixels that have not been selected and the position coordinates of the first overexposed pixel; after the search is completed, if the second overexposed pixel is found, selecting the second overexposed pixel, and determining that the maximum area enclosed by the position coordinates of the second overexposed pixel and the position coordinates of the first overexposed pixel is an overexposed area.
[0084] A specific implementation of searching for a second overexposed pixel point that satisfies the first area limiting condition for the first overexposed pixel point may include:
[0085] The following steps N1 to N3 are executed repeatedly until the search is completed:
[0086] N1: Searching for a fifth overexposed pixel point adjacent to the position coordinates of the first overexposed pixel point from overexposed pixel points that have never been selected; if the fifth overexposed pixel point is found, executing N2; if the fifth overexposed pixel point is not found, executing N3;
[0087] The adjacent in this step refers to the pixel points whose x value differs from the position coordinate of the first overexposed pixel point by 1 or whose y value differs from the position coordinate of the first overexposed pixel point by 1 when the coordinate system is an xy two-dimensional coordinate system. For example, for the overexposed pixel point with position coordinate (1, 1), the position coordinates of the pixel points adjacent to it are (0, 0), (1, 0), (0, 1), (2, 2), (2, 1), (1, 2), (2, 0), and (0, 2).
[0088] N2: take the fifth overexposed pixel as the first overexposed pixel and execute N1;
[0089] N3: End the search.
[0090] Accordingly, it is determined that all the fifth overexposed pixels found by looping N1 are the second overexposed pixels that meet the first area limiting condition. For example, the selected first overexposed pixel is pixel 1. After executing N1, the adjacent overexposed pixels found for pixel 1 are pixel 2, pixel 10, and pixel 25. The above N1 is looped to continue to search for adjacent overexposed pixels for pixel 2, pixel 10, and pixel 25, respectively. Among them, the adjacent overexposed pixels found for pixel 2 are pixel 8 and pixel 26, the adjacent overexposed pixels found for pixel 10 are pixel 12 and pixel 30, the adjacent overexposed pixels found for pixel 25 are pixel 32 and pixel 40, the adjacent overexposed pixel found for pixel 8 is pixel 27, and no adjacent overexposed pixels are found for pixels 26, 12, 30, 32, 40, and 27. Then, pixel 2, pixel 10, pixel 25, pixel 8, pixel 26, pixel 12, pixel 30, pixel 32, pixel 40 and pixel 27 are overexposed pixels that meet the first area limitation condition for pixel 1.
[0091] In one embodiment of the present invention, if the second overexposed pixel point is not found, the position coordinates of the first overexposed pixel point are used as a position center point.
[0092] In one embodiment of the present invention, the maximum area enclosed by the position coordinates of the second overexposed pixel and the position coordinates of the first overexposed pixel is determined to be an overexposed area. For example, if the position coordinates of the second overexposed pixel are (1, 0), (0, 1), (2, 2), (2, 1), (1, 2), (2, 0), (0, 2), and the position coordinates of the first overexposed pixel are (1, 1), then the area enclosed by (1, 0), (0, 1), (2, 2), (2, 1), (1, 2), (2, 0), (0, 2) is an overexposed area. For another example, if the position coordinates of the first overexposed pixel are (1, 1), then the area enclosed by (2, 2), (2, 1), (1, 2), (2, 0), (0, 2) and (1, 1) is an overexposed area.
[0093] The second specific implementation method for dividing the image to be processed into at least one overexposed area may include: taking each overexposed pixel as a third overexposed pixel, and for each third overexposed pixel, executing: searching for a fourth overexposed pixel that meets the second area limitation condition for the third overexposed pixel, determining that the maximum area enclosed by the position coordinates of the third overexposed pixel and the position coordinates of the fourth overexposed pixel is an overexposed sub-area; when the number of overexposed sub-areas is at least two, merging the overexposed sub-areas with the same overexposed pixel into one overexposed area, so that the overexposed pixel belongs to only one overexposed area.
[0094] Among them, the second area limitation condition is that when the coordinate system is an xy two-dimensional coordinate system, the overexposed pixel point has an x value that differs from the position coordinate of the third overexposed pixel point by 1 or a y value that differs from the position coordinate of the third overexposed pixel point by 1. For example, for the overexposed pixel point with a position coordinate of (1, 1), the position coordinates of the pixel points adjacent to it are (0, 0), (1, 0), (0, 1), (2, 2), (2, 1), (1, 2), (2, 0), and (0, 2). Among them, the overexposed pixel points corresponding to the overexposed pixel point (1, 1) that meet the second area limitation condition are (2, 2) and (2, 1), then (1, 1), (2, 2) and (2, 1) surround the overexposed sub-area 1, and the overexposed pixel points corresponding to the overexposed pixel point (2, 2) that meet the second area limitation condition are (1, 1)(3, 2), (3, 3), then (1, 1), (2, 2), (3, 2) and (3, 3) surround the overexposed sub-area 2. Among them, if the overexposed sub-area 1 and the overexposed sub-area 2 have the same overexposed pixel points, then the overexposed sub-area 1 and the overexposed sub-area 2 are merged into one overexposed area so that the overexposed pixel points belong to only one overexposed area.
[0095] In one embodiment of the present invention, there are two implementation methods for selecting the position center point for the preset basic graphics. Different implementation methods can be flexibly selected according to different basic graphics or pictures to be processed, so that the obtained processing results are more beautiful and can provide better sensory presentation to meet user needs.
[0096] The first method is to select the center point of the preset basic graphics:
[0097] Determine the limit edge point included in the overexposed area as the position center point. The limit edge point is the overexposed pixel point located on the edge curve of the overexposed area. For example: in the overexposed area surrounded by (0, 0), (1, 1), (2, 2), (3, 2) and (3, 3), the limit edge points are (0, 0), (3, 2) and (3, 3). Figure 4 The limit edge points are given as examples. This implementation is mainly aimed at the borders with large color difference in the image to be processed. Through this process, the abruptness of the borders with large color difference can be reduced to a certain extent, and the beauty of the image can be increased.
[0098] The second method is to select the center point of the preset basic graphics:
[0099] For each of the overexposed areas, the following steps M1 to M3 are executed cyclically until all the position center points of the overexposed areas are determined:
[0100] M1: Determine whether the theoretical center point of the overexposed area is located in the overexposed area. If yes, execute M2; otherwise, execute M3;
[0101] M2: Determine the theoretical center point as the position center point, and end the current process;
[0102] M3: Draw a straight line parallel to the coordinate axis of the coordinate system at the theoretical center point to cut the overexposed area into at least two new overexposed areas, use the new overexposed areas as overexposed areas, and execute M1.
[0103] The position coordinates corresponding to the above theoretical center point can be calculated according to the following calculation formula group:
[0104]
[0105] in, Represents the position coordinates corresponding to the theoretical center point; INT() represents the rounding function; x i Represents the horizontal coordinate value of the position coordinate of the i-th overexposed pixel in an overexposed area; i Represents the ordinate value of the position coordinates of the i-th overexposed pixel in an overexposed area; i is a positive integer; n represents the total number of overexposed pixels in an overexposed area, and n is a positive integer not less than 2.
[0106] The above rounding can be rounding up or down the average of the horizontal coordinate values in the position coordinates of all the overexposed pixels in the overexposed area; rounding up or down the average of the vertical coordinate values in the position coordinates of all the overexposed pixels in the overexposed area; or rounding up the average of the horizontal coordinate values in the position coordinates of all the overexposed pixels in the overexposed area by rounding off, and rounding up the average of the vertical coordinate values in the position coordinates of all the overexposed pixels in the overexposed area by rounding off.
[0107] The above method of selecting the position center point of the preset basic graphic can realize mapping processing of the overexposed area and reduce the influence of the overexposed area on the image display.
[0108] like Figure 4 Given an overexposed area B, whose theoretical center point is located in the overexposed area, the theoretical center point is the position center point.
[0109] like Figure 5Given an overexposed area C, whose theoretical center point is located outside the above-mentioned overexposed area, then, draw a straight line parallel to the coordinate axis of the coordinate system at the theoretical center point to cut the overexposed area into at least two new overexposed areas C1, C2 and C3, and then continue to judge whether the theoretical center points of the overexposed areas C1, C2 and C3 are located in the overexposed areas respectively; if so, determine that the theoretical center point of C1 is the position center point of C1, the theoretical center point of C2 is the position center point of C2, and the theoretical center point of C3 is the position center point of C3; otherwise, continue to cut the overexposed areas C1, C2 and C3 respectively.
[0110] In one embodiment of the present invention, after placing the basic graphic on the image to be processed and before merging the basic graphic and the image to be processed, the method further includes: adjusting the basic graphic according to preset mapping parameters and parameter thresholds. The basic graphic is adjusted to make the presentation effect of the synthesized image better and more beautiful.
[0111] Based on the image processing method provided by the embodiment of the present invention, a to-be-processed image (part of the keyboard image) is processed, and the obtained processing result - the special effect image can be shown as follows: Figure 6 As shown in FIG. 1 , the position center point determined by the figure, that is, the position where the center of the basic figure is located, is the limit edge point included in the overexposed area. This processing result can attract more users to pay attention to the picture.
[0112] The above-mentioned mapping parameters may include the transparency of the basic graphics and the size of the basic graphics. In a preferred embodiment, the transparency of the basic graphics ranges from 0.3 to 0.7. The transparency can be determined based on the area of the overexposed region and the overexposure intensity. Among them, the relationship rule between the overexposed region area and the overexposure intensity and the transparency is: the larger the overexposed region area, the smaller the transparency value, and the smaller the overexposed region area, the larger the transparency value; the larger the overexposure intensity, the larger the transparency value, and the smaller the overexposure intensity, the smaller the transparency value; based on the relationship rule between the overexposed region area and the overexposure intensity and the transparency, the user can set the numerical relationship between the overexposed region area and the transparency and the numerical relationship between the overexposure intensity and the transparency.
[0113] In one embodiment of the present invention, a specific implementation method of adjusting the basic graphic is to adjust the size of the basic graphic so that the size of the adjusted basic graphic meets the following Jie Baina graphic size limitation condition.
[0114] Basic graphic size constraints:
[0115] The adjusted basic graphic size is twice the theoretical size of the overexposed area, and is no larger than 20 pixels and no smaller than 4 pixels.
[0116] The theoretical size of the overexposed area refers to the maximum horizontal coordinate x of all overexposed pixels contained in the overexposed area. max With the minimum horizontal coordinate x mix The difference (such as Figure 4 The x distance shown) and the maximum ordinate y of all overexposed pixels contained in the overexposed area max With the minimum ordinate y mix The difference (such as Figure 4 The area formed by the y distance shown).
[0117] When the size of the adjusted basic graphic is twice the theoretical size of the overexposed area and is larger than 20 pixels, the size of the adjusted basic graphic is adjusted to 20 pixels;
[0118] When the size of the adjusted basic graphic is twice the theoretical size of the overexposed area and is smaller than 4 pixels, the size of the adjusted basic graphic is adjusted to 4 pixels.
[0119] The above basic graphics may be four-pointed stars, five-pointed stars, hearts, and other basic graphics provided by users.
[0120] In addition, the special effect pictures obtained by the above-mentioned picture processing method can be directly sent to the relevant application system so that the application system can use the special effect pictures. For example, the special effect pictures obtained by processing the pictures of goods sold online by the merchant through the picture processing method provided by the embodiment of the present invention can be directly published to the merchant's sales platform system to be used as a product display picture. In addition, the special effect pictures can also be output to a printing device so that the printing device prints the special effect pictures.
[0121] In addition, the image to be processed used in the image processing method provided in the embodiment of the present invention can come from other application systems such as e-commerce platform systems, for example, the image to be processed can be an original image of a product directly from the e-commerce platform system, and can be used for decorating a mall store, beautifying products, etc.
[0122] In one embodiment of the present invention, the above-mentioned image processing method can be implemented in the form of a web page plug-in such as an H5 plug-in, an HTML plug-in, etc.
[0123] In one embodiment of the present invention, the above-mentioned image processing method can be implemented based on canvas in H5 or HTML. That is, canvas is used as a part of an H5 plug-in or HTML plug-in for implementing the image processing method, or the image processing method provided in the embodiment of the present invention is implemented by improving canvas.
[0124] Accordingly, the specific process of obtaining the image to be processed may be to call the image input interface input[file] in H5 or HTML to obtain the image file to be processed, or to use the img src image link to obtain the image to be processed.
[0125] In one embodiment of the present invention, the above-mentioned image processing method may further include: recording the position coordinates of the theoretical center point located in the overexposed area, the theoretical size of the overexposed area, and the extreme edge point of the overexposed area in the drawn array paintArr, so as to facilitate the management of the overexposed pixels and the overexposed area. When placing the basic graphics subsequently, the position center point and the size of the basic graphics can be directly determined according to the position coordinates of the theoretical center point given by the array and the theoretical size of the overexposed area, or the position center point and the size of the basic graphics can be directly determined according to the position coordinates of the extreme edge point given by the array and the theoretical size of the overexposed area.
[0126] In one embodiment of the present invention, the specific implementation of merging the basic graphics and the image to be processed may be to use a canvas drawImage method to merge the images.
[0127] In one embodiment of the present invention, a specific implementation method of merging the basic graphics and the image to be processed to obtain a special effect image may include: in the same overexposed area, using random numbers to initialize the transparency and increase / decrease mark of the initial basic graphics; and adding basic graphics to the overexposed area, and after each addition of a basic graphic, the transparency is adjusted by 0.1 according to the increase / decrease mark; when the transparency is equal to the preset transparency first threshold or greater than the preset transparency second threshold, the increase / decrease mark is flipped; when the number of frames of the basic graphics in the overexposed area increases to the preset number of frames, the gif.js open source library is used to merge the basic graphics with the image to be processed to obtain a gif animation, which can be exported to other systems. In a preferred embodiment, the preset transparency first threshold is 0.3. In a preferred embodiment, the preset transparency second threshold is 1. In a preferred embodiment, the preset number of frames is 15.
[0128] Among them, the transparency is adjusted by 0.1 according to the increase and decrease mark; when the transparency is less than 0.3 or greater than 1, the increase and decrease mark is flipped; for example, the transparency and increase and decrease mark of the first basic graphic are initialized as follows: the transparency of the basic graphic is 0.5, and the increase and decrease mark is the minus mark "-", then the second basic graphic is added, the transparency of the added basic graphic is 0.5-0.1=0.4, and the increase and decrease mark is the minus mark "-"; then the third basic graphic is added, the transparency of the added basic graphic is 0.5-0.1=0.3, and the increase and decrease mark is the plus mark "+"; the fourth basic graphic is added, the transparency of the added basic graphic is 0.3+0.1=0.4, and the increase and decrease mark is the plus mark "+"; the fifth basic graphic is added, the transparency of the added basic graphic is 0.4+0.1=0.5, and the increase and decrease mark is The mark is marked with a “+”; the sixth basic graphic is added, the transparency of the added basic graphic is 0.5+0.1=0.6, and the increase and decrease mark is marked with a “+”; the seventh basic graphic is added, the transparency of the added basic graphic is 0.6+0.1=0.7, and the increase and decrease mark is marked with a “+”; the eighth basic graphic is added, the transparency of the added basic graphic is 0.7+0.1=0.8, and the increase and decrease mark is marked with a “+”; the ninth basic graphic is added, the transparency of the added basic graphic is 0.8+0.1=0.9, and the increase and decrease mark is marked with a “+”; the tenth basic graphic is added, the transparency of the added basic graphic is 0.9+0.1=1, and the increase and decrease mark is marked with a “-”, and so on, until the number of frames of the basic graphics placed in the overexposed area reaches the preset number of frames.
[0129] The picture processing method provided by the embodiment of the present invention increases the entertainment and interest of users in processing photos.
[0130] The image processing method provided in the embodiment of the present invention can also be used to add special effects to the images when users of a shopping mall evaluate and post their orders, so as to highlight the characteristics of the products.
[0131] The image processing method provided by the embodiment of the present invention can also be used to add a shining special effect display to the product image that the user has searched for when the user searches for a product, thereby increasing the sensory characteristics of the image and improving the user experience.
[0132] like Figure 7 As shown, an embodiment of the present invention provides a picture processing device 700, which includes: an extraction unit 701, a search unit 702 and a merging unit 703, wherein:
[0133] The extraction unit 701 is used to obtain a picture to be processed and extract a plurality of pixel points of the picture to be processed, wherein the pixel points include color value information;
[0134] A searching unit 702, configured to search for overexposed pixels from the plurality of pixels extracted by the extracting unit 701 according to a preset overexposed value interval and the color value information;
[0135] The merging unit 703 is used to determine a placement area for a preset basic graphic according to the overexposed pixel points found by the searching unit 702; place the basic graphic in the placement area, and merge the basic graphic and the image to be processed.
[0136] In one embodiment of the present invention, the image processing apparatus 700 further comprises: a mapping unit (not shown in the figure),
[0137] The mapping unit is used to map each pixel point extracted by the extraction unit 701 to a preset coordinate system to determine the position coordinates of each pixel point;
[0138] The merging unit 703 is further used to determine the position center point of the placement area according to the position coordinates of the overexposed pixel points mapped by the mapping unit; and control the distance between the center point of the basic figure and the position center point to be no greater than a preset distance threshold.
[0139] In one embodiment of the present invention, the merging unit 703 is used to divide the image to be processed into at least one overexposed area according to the position coordinates of each overexposed pixel when the number of overexposed pixels found by the searching unit 702 is at least two; and in each overexposed area, select a position center point for a preset basic graphic.
[0140] In one embodiment of the present invention, the merging unit 703 is further used to execute, for overexposed pixel points that have not been selected, the following steps: selecting a first overexposed pixel point from overexposed pixel points that have not been selected; searching for a second overexposed pixel point that meets the first area limitation condition for the first overexposed pixel point based on the position coordinates of the overexposed pixel points that have not been selected and the position coordinates of the first overexposed pixel point; after the search is completed, if the second overexposed pixel point is found, selecting the second overexposed pixel point, and determining that the maximum area enclosed by the position coordinates of the second overexposed pixel point and the position coordinates of the first overexposed pixel point is an overexposed area.
[0141] In one embodiment of the present invention, the merging unit 703 is further configured to use the position coordinates of the first overexposed pixel point as a position center point if the second overexposed pixel point is not found.
[0142] In one embodiment of the present invention, the merging unit 703 is further used to take each overexposed pixel as a third overexposed pixel, and for each third overexposed pixel, perform the following steps: searching for a fourth overexposed pixel that satisfies the second region limitation condition for the third overexposed pixel, and determining that the maximum region enclosed by the position coordinates of the third overexposed pixel and the position coordinates of the fourth overexposed pixel is an overexposed sub-region; when the number of overexposed sub-regions is at least two, merging the overexposed sub-regions with the same overexposed pixel into one overexposed region, so that the overexposed pixel belongs to only one overexposed region.
[0143] In one embodiment of the present invention, the merging unit 703 is further used to execute in a loop: searching for a fifth overexposed pixel point adjacent to the position coordinates of the first overexposed pixel point from the overexposed pixel points that have never been selected; if found, taking the fifth overexposed pixel point as the first overexposed pixel point; if not found, terminating the search; until the search is terminated; determining that all the fifth overexposed pixel points found are the second overexposed pixel points that meet the first area limitation condition.
[0144] In one embodiment of the present invention, the merging unit 703 is further configured to determine the limit edge point included in the overexposed area as the position center point.
[0145] In one embodiment of the present invention, the merging unit 703 is further configured to loop through the following steps for each overexposed region until all position center points of the overexposed region are determined:
[0146] Determine whether the theoretical center point of the overexposed area is located in the overexposed area,
[0147] If yes, the theoretical center point is determined as the position center point, and the current process ends;
[0148] Otherwise, a straight line parallel to the coordinate axis of the coordinate system is drawn at the theoretical center point to cut the overexposed area into at least two new overexposed areas, and the new overexposed areas are used as overexposed areas.
[0149] In one embodiment of the present invention, the merging unit 703 is further configured to adjust the basic graphics according to preset mapping parameters and parameter thresholds.
[0150] In one embodiment of the present invention, the above-mentioned image processing device 700 may be an H5 plug-in or an HTML plug-in.
[0151] In one embodiment of the present invention, the above-mentioned image processing device 700 can be applied to a terminal or a server.
[0152] The terminal where the above-mentioned image processing device 700 is located can be connected to other systems such as an e-commerce platform to provide image processing support for the shops on the e-commerce platform.
[0153] Figure 8 An exemplary system architecture 800 is shown to which the image processing method or image processing apparatus according to the embodiment of the present invention can be applied.
[0154] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0155] The user can use the terminal devices 801, 802, and 803 to interact with the server 805 through the network 804 to receive or send images to be processed, special effect images, etc. Various communication client applications can be installed on the terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0156] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0157] The terminal devices 801 , 802 , and 803 can process the acquired pictures to be processed through the picture processing device, and send the special effect pictures to the server 805 through the above-mentioned various communication client applications.
[0158] The server 805 may be a server that provides various services, such as a background management server that provides support for shopping websites or search applications browsed by users using terminal devices 801, 802, and 803 (for example only). The background management server may allocate the received special effect images to corresponding locations according to user settings, and feed back the allocation results (for example, prompts of successful / failed deployment of special effect images - for example only) to the terminal device. The background management server may also receive the images to be processed and basic graphics sent by the terminal, perform image processing on the images to be processed and the basic graphics, obtain special effect images, and feed back the processing results (for example, special effect images - for example only) to the terminal device.
[0159] It should be noted that the image processing method provided in the embodiment of the present invention can be executed by the terminal devices 801, 802, 803, or by the server 805. Accordingly, the image processing device can be set in the terminal devices 801, 802, 803, or in the server 805.
[0160] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0161] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device / server suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0162] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0163] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0164] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.
[0165] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0166] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0167] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be provided in a processor, for example, may be described as: a processor including an extraction unit, a search unit, and a merging unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the extraction unit may also be described as "a unit for extracting a plurality of pixels of the image to be processed".
[0168] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a picture to be processed, extracting multiple pixels of the picture to be processed, and the pixels include color value information; searching for overexposed pixels from multiple pixels according to a preset overexposure value interval and color value information; determining a placement area for a preset basic graphic according to the overexposed pixels; placing the basic graphic in the placement area, and merging the basic graphic and the picture to be processed.
[0169] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the device includes: after extracting multiple pixel points of the image to be processed, further including: mapping each pixel point to a preset coordinate system to determine the position coordinates of each pixel point; determining the position center point of the placement area according to the position coordinates of the overexposed pixel points; placing the basic graphic in the placement area, including: controlling the distance between the center point of the basic graphic and the position center point to be no greater than a preset distance threshold.
[0170] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the device includes: when the number of overexposed pixels is at least two, at least one overexposed area is divided for the image to be processed according to the position coordinates of each overexposed pixel; in each overexposed area, a position center point is selected for a preset basic graphic.
[0171] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes: for unselected overexposed pixels, executing: selecting a first overexposed pixel from unselected overexposed pixels; searching for a second overexposed pixel that meets a first area limitation condition for the first overexposed pixel based on the position coordinates of the unselected overexposed pixels and the position coordinates of the first overexposed pixel; after the search is completed, if the second overexposed pixel is found, selecting the second overexposed pixel, and determining that the maximum area enclosed by the position coordinates of the second overexposed pixel and the position coordinates of the first overexposed pixel is an overexposed area.
[0172] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes: for overexposed pixels that have not been selected, executing: taking each overexposed pixel as a third overexposed pixel; for each third overexposed pixel, executing: searching for a fourth overexposed pixel that meets the second area limitation condition for the third overexposed pixel, determining that the maximum area enclosed by the position coordinates of the third overexposed pixel and the position coordinates of the fourth overexposed pixel is an overexposed sub-area; when the number of overexposed sub-areas is at least two, merging the overexposed sub-areas with the same overexposed pixels into one overexposed area, so that the overexposed pixel belongs to only one overexposed area.
[0173] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes: looping and executing the following steps until the search is finished:
[0174] Searching for a fifth overexposed pixel point adjacent to the position coordinates of the first overexposed pixel point from the overexposed pixel points that have never been selected; if the fifth overexposed pixel point is found, taking the fifth overexposed pixel point as the first overexposed pixel point; if the fifth overexposed pixel point is not found, ending the search;
[0175] Determine that all the fifth overexposed pixel points found are the second overexposed pixel points that meet the first area limitation condition.
[0176] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes: for each of the overexposed areas, loopingly executing the following steps until all position center points of the overexposed areas are determined:
[0177] Determine whether the theoretical center point of the overexposed area is located in the overexposed area,
[0178] If yes, the theoretical center point is determined to be the position center point, and the current process ends;
[0179] Otherwise, a straight line parallel to the coordinate axis of the coordinate system is drawn at the theoretical center point to cut the overexposed area into at least two new overexposed areas, and the new overexposed areas are used as overexposed areas.
[0180] According to the technical solution of the embodiment of the present invention, since the overexposed pixels of the image will affect the overall look and feel of the image, the look and feel of the image can generally be improved by superimposing a basic graphic in the overexposed pixel area. The embodiment of the present invention extracts multiple pixels of the image to be processed, and searches for overexposed pixels from multiple pixels according to a preset overexposed value interval and color value information, then determines a placement area for the preset basic graphic according to the overexposed pixels, places the basic graphic in the placement area, and merges the basic graphic and the image to be processed. Since the placement area is determined based on the overexposed pixels, that is, the basic graphic is added to the area where the overexposed pixels are located, thereby obtaining a special effects image, thereby realizing the automatic addition of special effects to the image, and can effectively improve the efficiency of adding special effects to the image.
[0181] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing an image, characterized in that: include: Acquire a picture to be processed, and extract a plurality of pixel points of the picture to be processed, wherein the pixel points include color value information; According to the preset overexposure value interval and the color value information, searching for overexposed pixel points from the plurality of pixel points; Determine a placement area for a preset basic graphic according to the overexposed pixel points; Placing the basic graphic in the placement area, and adjusting the basic graphic according to preset mapping parameters; The mapping parameters include the transparency of the basic graphic, and the transparency is determined according to the overexposure area and the overexposure intensity; The basic graphic and the image to be processed are merged.
2. The image processing method according to claim 1, characterized in that: After extracting a plurality of pixel points of the image to be processed, the method further includes: Mapping each of the pixel points to a preset coordinate system to determine the position coordinates of each of the pixel points; Determining the center point of the placement area according to the position coordinates of the overexposed pixel point; Placing the basic graphic in the placement area includes: controlling the distance between the center point of the basic graphic and the center point of the position to be no greater than a preset distance threshold.
3. The image processing method according to claim 2, characterized in that: The determining the position center point of the placement area includes: When the number of the overexposed pixels is at least two, According to the position coordinates of each of the overexposed pixel points, the image to be processed is divided into at least one overexposed area; In each of the overexposed areas, a position center point is selected for a preset basic pattern.
4. The image processing method according to claim 3, characterized in that: Dividing the image to be processed into at least one overexposed area includes: For the overexposed pixels that have not been selected, execute: Selecting a first overexposed pixel from the overexposed pixels that have not been selected; searching for a second overexposed pixel point that satisfies a first area limiting condition for the first overexposed pixel point according to the position coordinates of the overexposed pixel point that has not been selected and the position coordinates of the first overexposed pixel point; After the search is completed, if the second overexposed pixel point is found, the second overexposed pixel point is selected, and the maximum area surrounded by the position coordinates of the second overexposed pixel point and the position coordinates of the first overexposed pixel point is determined as an overexposed area.
5. The image processing method according to claim 4, characterized in that: Further including: If the second overexposed pixel point is not found, the position coordinates of the first overexposed pixel point are used as a position center point.
6. The image processing method according to claim 3, characterized in that: Dividing the image to be processed into at least one overexposed area includes: Each of the overexposed pixels is used as a third overexposed pixel, and for each of the third overexposed pixels, the following steps are performed: searching for a fourth overexposed pixel point that satisfies the second region limiting condition for the third overexposed pixel point, and determining that a maximum region enclosed by the position coordinates of the third overexposed pixel point and the position coordinates of the fourth overexposed pixel point is an overexposed sub-region; When the number of the overexposed sub-regions is at least two, The overexposed sub-regions with the same overexposed pixel point are merged into one overexposed region, so that the overexposed pixel point belongs to only one overexposed region.
7. The image processing method according to claim 4, characterized in that: Searching for a second overexposed pixel point that satisfies a first area limiting condition for the first overexposed pixel point includes: Loop through the following steps until the search is complete: Searching for a fifth overexposed pixel point adjacent to the position coordinates of the first overexposed pixel point from the overexposed pixel points that have never been selected; if the fifth overexposed pixel point is found, taking the fifth overexposed pixel point as the first overexposed pixel point; if the fifth overexposed pixel point is not found, ending the search; Determine that all the fifth overexposed pixel points found are the second overexposed pixel points that meet the first area limitation condition.
8. The image processing method according to any one of claims 4 to 7, characterized in that: In each of the overexposed areas, a position center point is selected for a preset basic pattern, including: A limit edge point included in the overexposed area is determined as the position center point.
9. The image processing method according to any one of claims 4 to 7, characterized in that: In each of the overexposed areas, a position center point is selected for a preset basic pattern, including: For each of the overexposed areas, the following steps are executed in a loop until all the position center points of the overexposed areas are determined: Determine whether the theoretical center point of the overexposed area is located in the overexposed area, If yes, the theoretical center point is determined to be the position center point, and the current process ends; Otherwise, a straight line parallel to the coordinate axis of the coordinate system is drawn at the theoretical center point to cut the overexposed area into at least two new overexposed areas, and the new overexposed areas are used as overexposed areas.
10. A picture processing device, characterized in that: include: Extraction unit, search unit and merging unit, where: The extraction unit is used to obtain a picture to be processed and extract a plurality of pixel points of the picture to be processed, wherein the pixel points include color value information; The search unit is used to search for overexposed pixels from the plurality of pixels according to a preset overexposed value interval and the color value information; The merging unit is used to determine a placement area for a preset basic graphic according to the overexposed pixel points found by the searching unit; place the basic graphic in the placement area, and adjust the basic graphic according to preset mapping parameters, wherein the mapping parameters include the transparency of the basic graphic, and the transparency is determined according to the area of the overexposed area and the overexposure intensity; and merge the basic graphic and the image to be processed.
11. An electronic device for image processing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.
12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
