Image processing method and device, equipment and medium
By obtaining the content information of the target image, determining the position of the mirror line and dividing the area, personalized mirror processing is achieved, and the problems of insufficient image infectiousness and limited mirroring effect in the prior art are solved, and the visual impact effect and mirroring content are improved Fitness.
Patent Information
- Application Number
- CN202310768363.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2024-12-27
AI Technical Summary
The existing image processing methods are not very attractive, have poor visual impact effects, and the mirroring effect is limited by water surface scenes, making it difficult to meet user needs.
By acquiring the content information of the target image, determining the position of the mirror line, dividing the image into two areas, and determining the mirror content of the first area based on the position of the mirror line and the second area, covering the image content of the second area, realizing the implementation of the image content of the second area. Personalized mirroring.
It improves the infectiousness and visual impact of the image, and the mirrored content is more in line with the actual scene, providing a personalized viewing, and is not limited to specific scenes, achieving diversified mirroring effects.
Smart Images

Figure CN119205981A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, equipment and medium. Background Art
[0002] Nowadays, more and more users choose to use editing software or image design tools to process original images. The inventor has found through research that the existing image processing methods are relatively common, such as simple image beautification, adding filters, etc., which have weak image appeal and poor visual impact. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, apparatus, device and medium.
[0004] An embodiment of the present disclosure provides an image processing method, the method comprising: obtaining a target image to be processed; obtaining content information of the target image; determining a position of a mirror line in the target image according to the content information; wherein the mirror line divides the target image into a first area and a second area; determining a mirror content corresponding to an image content of the first area based on the position of the mirror line in the target image and the second area; and using the mirror content to cover the image content of the second area to obtain a processed target image.
[0005] Optionally, the step of determining the position of the mirror line in the target image according to the content information includes: determining, according to the content information, a target scene category to which the target image belongs from a plurality of preset scene categories; and determining the position of the mirror line in the target image according to the target scene category.
[0006] Optionally, the step of determining the position of the mirror line in the target image according to the target scene category includes: determining a target angle according to the target scene category; wherein the target angle is an angle between the mirror line and a preset baseline; and determining the position of the mirror line in the target image according to the target angle and the content information.
[0007] Optionally, the step of determining the target angle according to the target scene category includes: determining the target angle corresponding to the target scene category according to a preset correspondence between the scene category and the mirror line angle.
[0008] Optionally, the step of determining the position of the mirror line in the target image based on the target angle and the content information includes: obtaining a preset image division condition; determining the position of the mirror line in the target image based on the target angle, the content information and the image division condition; wherein the first area and the second area obtained by dividing the mirror line meet the image division condition.
[0009] Optionally, the image division conditions include one or more of the following conditions: the area of the first region is not smaller than the area of the second region; the main object in the target image is located in the first region, and the main object is determined based on the content information of the target image; the proportion of the second region relative to the target image is within a preset proportion range.
[0010] Optionally, the main object is determined in the following manner: a heat map of the target image is generated according to content information of the target image, and the main object is determined according to the heat map.
[0011] Optionally, the step of determining the position of the mirror line in the target image based on the target angle, the content information and the image division condition includes: determining the target initial position corresponding to the target angle based on a correspondence between a preset mirror line angle and the mirror line initial position; and in a case where a first area and a second area divided by the mirror line located at the target initial position do not meet the image division condition, adjusting the position of the mirror line from the target initial position until the adjusted first area and second area divided by the mirror line meet the image division condition.
[0012] Optionally, the step of adjusting the position of the mirror line from the target initial position includes: starting from the target initial position, moving the position of the mirror line in parallel according to a preset step length.
[0013] Optionally, the step of obtaining the target image to be processed includes: obtaining an original image, and obtaining a global main direction of the original image; when the global main direction of the original image is inconsistent with a preset direction, correcting the original image to obtain the target image to be processed.
[0014] The embodiment of the present disclosure also provides an image processing device, including: an image acquisition module, used to acquire a target image to be processed; a content acquisition module, used to acquire content information of the target image; a mirror line determination module, used to determine the position of the mirror line in the target image according to the content information; wherein the mirror line divides the target image into a first area and a second area; a mirror content determination module, used to determine the mirror content corresponding to the image content of the first area based on the position of the mirror line in the target image and the second area; and a content covering module, used to cover the image content of the second area with the mirror content to obtain a processed target image.
[0015] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the image processing method provided by the embodiment of the present disclosure.
[0016] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the image processing method provided by the embodiment of the present disclosure.
[0017] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein the computer program implements the image processing method provided by the embodiments of the present disclosure when executed by a processor.
[0018] The above technical solution provided by the embodiment of the present disclosure can obtain content information of the target image and determine the position of the mirror line in the image according to the content information. The mirror line can divide the target image into two areas. The mirror content of the image content of the first image can be determined based on the position of the mirror line and the second area, and the image content of the second area is covered with the mirror content, so that the processed target image can better present the image content of the first area and the mirror content of the first area, and conveniently and quickly present a mirror perception to the user. Moreover, since the position of the mirror line is not fixed but is determined based on the image content information, the obtained mirror content is more in line with the actual scene, has a stronger image appeal, and can effectively enhance the visual impact effect.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of a main direction of an image provided by an embodiment of the present disclosure;
[0024] Figure 3 Schematic diagram of angles of various mirror lines provided for embodiments of the present disclosure;
[0025] Figure 4 A schematic diagram of a comparison between an original image and a heat map provided in an embodiment of the present disclosure;
[0026] Figure 5 A schematic diagram of adjusting the position of a mirror line provided in an embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of a processed target image provided by an embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram of a processed target image provided by an embodiment of the present disclosure;
[0029] Figure 8 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;
[0030] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0032] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0033] The existing image processing methods have weak image appeal and poor visual impact. The inventors have found that the image mirroring effect usually has a certain appeal and can bring a strong visual impact to users. However, in reality, there are few scenes where the image mirroring effect can be achieved. For example, most users need to shoot reflections in scenes with water surfaces to achieve the image mirroring effect, which is time-consuming and labor-intensive. Moreover, the achievable mirroring effect is single, and most of them can only be horizontal mirroring, which is difficult to meet user needs. In order to improve at least one of the above problems, the embodiments of the present disclosure provide an image processing method, device, equipment and medium, which are not limited to water surface scenes, but can achieve the mirroring effect directly through image processing. Moreover, the embodiments of the present disclosure can directly perform targeted mirroring based on the image content. The obtained mirroring content is more in line with the actual scene, has a stronger image appeal, can provide users with personalized viewing experience, and can effectively improve the visual impact effect. For ease of understanding, the following is a detailed explanation.
[0034] Figure 1 The following is a flow chart of an image processing method provided by an embodiment of the present disclosure. The method can be executed by an image processing device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S110:
[0035] Step S102, obtaining a target image to be processed.
[0036] The disclosed embodiments do not limit the image content of the target image and the method of obtaining the target image. For example, the target image can be an image taken by the user on site, or an image selected by the user locally or in the cloud. In addition, the target image can be an original image, or an image that has been pre-processed. The pre-processing can be, for example, correction processing, beautification processing, etc., which are not limited here.
[0037] Step S104: acquiring content information of the target image.
[0038] In some implementation examples, one or more object detection algorithms may be used to detect various types of objects contained in a target image, including but not limited to people, animals, street signs, vehicles, buildings, trees, water surfaces, and the like, without limitation. The content information of the target image may include object type information, location information, etc. contained in the target image, and may also include scene information obtained based on object recognition, etc., without limitation.
[0039] Step S106, determining the position of the mirror line in the target image according to the content information, wherein the mirror line divides the target image into a first area and a second area. In other words, the mirror line is the boundary line between the first area and the second area.
[0040] For example, the scene type to which the target image belongs can be identified based on the content information, and the mirror line directions corresponding to different scene types are different. The main object in the target image can be identified based on the content information, and then the specific position of the mirror line can be determined based on the type and / or position of the main object. The above method can directly determine the mirror line based on the content information. Compared with the method of fixedly setting the mirror line or requiring the user to specify the mirror line in the related art, the above method provided by the embodiment of the present disclosure is not only more convenient and quick, but also can effectively ensure the image mirroring effect.
[0041] Step S108: determining the mirror image content corresponding to the image content of the first area based on the position of the mirror image line in the target image and the second area.
[0042] In practical applications, the first area can be mirrored along the mirror line according to the position of the mirror line in the target image to obtain mirrored content that matches the shape and size of the second area. It should be noted that when the area of the second area is smaller than that of the first area, the image content of the first area can be mirrored only based on the shape and size of the second area and the position of the mirror line, without mirroring all the image content of the first area.
[0043] Step S110: Using the mirror image content to cover the image content of the second area to obtain a processed target image.
[0044] In some specific implementation examples, the area of the first region is not less than that of the second region, and the mirror image content corresponding to the image content of the first region can completely cover the image content of the second region. The image content of the first region and the mirror image content of the second region together constitute the processed target image.
[0045] The above-mentioned image processing method provided by the embodiment of the present disclosure can conveniently and quickly present a mirror image perception to the user, and because the position of the mirror line is not fixed but is personalized based on the image content information, the obtained mirror content is more in line with the actual scene, has a stronger image appeal, and can effectively enhance the visual impact effect.
[0046] In order to further improve the image perception, the embodiment of the present disclosure provides step S102, which is an implementation method of the step of obtaining the target image to be processed, specifically including: obtaining the original image, and obtaining the global main direction of the original image; when the global main direction of the original image is inconsistent with the preset direction, correcting the original image to obtain the target image to be processed.
[0047] Among them, the global main direction can be understood as the shooting direction of the original image. For ease of understanding, Figure 2 A schematic diagram of the main direction of an image is shown, indicating that the shooting direction of the original image is not horizontal and positive, so the resulting original image gives the impression that there is a certain tilt. In related technologies, it is usually necessary to manually adjust the image direction, while in the embodiment disclosed herein, the main direction of the image can be automatically detected and the image can be corrected. In practical applications, the global main direction of the original image can be obtained through a direction detection algorithm or a deep learning model pre-trained based on training samples marked with the main direction of the image. If the original image is taken by a device that currently executes the image processing method, the parameters of the device when taking the original image can also be directly obtained, such as gyroscope information, camera parameters, and other information to analyze the global main direction of the image. The above are all exemplary descriptions, and any method that can obtain the global main direction is acceptable, and is not limited here.
[0048] When the global main direction of the original image is inconsistent with the preset direction, the original image can be rotated or other correction operations can be performed to make the global main direction of the obtained target image consistent with the preset direction. For example, the target image can be presented to the user in a horizontal and positive sense, thereby effectively improving the user's viewing experience and making it easier to subsequently determine the direction of the mirror line, and then determine the specific position of the mirror line.
[0049] In order to reasonably and reliably determine the mirror line in the target image, in some embodiments, the above step S106, i.e., the step of determining the position of the mirror line in the target image according to the content information, can be performed with reference to the following steps 1 to 2:
[0050] Step 1: According to the content information, determine the target scene category to which the target image belongs from the preset multiple scene categories. For example, the multiple scene categories include water surface or road scene, urban building scene, street scene, pedestrian scene, still life scene, etc. The still life scene can also be further divided into slender still life or short flat still life according to the shape of the still life. Specifically, multiple scene categories can be flexibly set according to actual needs, and there is no limitation here.
[0051] Step 2: Determine the position of the mirror line in the target image according to the target scene category.
[0052] It is understandable that different scene categories give people different visual perceptions and the corresponding mirror line positions are also different.
[0053] Exemplarily, the above step 2 can be performed with reference to the following steps A to B:
[0054] Step A, determining a target angle according to a target scene category; wherein the target angle is the angle between a mirror line and a preset reference line.
[0055] In some specific implementation examples, the optimal mirror line angle corresponding to each scene category can be pre-set according to the characteristics of various scene categories, and the target angle corresponding to the target scene category can be determined according to the correspondence between the pre-set scene category and the mirror line angle. For example, taking the preset reference line as a horizontal line as an example, the mirror line angle corresponding to the water surface or road scene can be 45 degrees, thereby presenting the user with a dramatic sense of folding of the water surface and road surface, while the mirror line angle corresponding to the pedestrian scene can be 90 degrees, that is, giving people a sense of vertical mirror folding; and the mirror line angle corresponding to the urban building scene can be 0 degrees, giving people a sense of horizontal mirror folding. The above are all exemplary explanations. In actual applications, the mirror line angles corresponding to various scene categories can be flexibly set according to the desired effect.
[0056] For easier understanding, see Figure 3 The angle diagrams of various mirror lines shown in the figure assume that the reference line is a horizontal line. Figure 3 (a) indicates that the angle between the mirror line and the preset reference line is 45 degrees. Figure 3 (b) indicates that the angle between the mirror line and the preset reference line is 90 degrees. Figure 3 (c) in the figure indicates that the angle between the mirror line and the preset reference line is 0 degrees. Figure 3 Three mirror line angles are simply illustrated, and can be flexibly set in actual applications, such as 60 degrees, 30 degrees, etc., and are not limited here. According to the target scene category, the angle of the mirror line in the target image (target angle) can be determined first. It can be understood that there are many positions of the mirror line with the target angle, and the optimal position of the mirror line in the target image can be further determined later.
[0057] Step B: determining the position of the mirror line in the target image according to the target angle and content information.
[0058] When the mirror line angle is known, the content information in the target image can be analyzed to determine the best position of the mirror line, so as to present a better mirror image experience to the user. For example, the following steps B1 to B2 can be referred to:
[0059] Step B1, obtaining preset image segmentation conditions. In some embodiments, the image segmentation conditions include one or more of the following conditions (1) to (3):
[0060] (1) The area of the first area is not less than the area of the second area. Since the first area is the area that needs to be mirrored, and the second area is the area that needs to be covered by the mirrored content of the first area, in order to ensure visual perception, the area of the first area is not less than the area of the second area.
[0061] (2) The main object in the target image is located in the first area, and the main object is determined based on content information of the target image.
[0062] Exemplarily, the subject object is determined in the following manner: a heat map of the target image is generated according to the content information of the target image, and the subject object is determined according to the heat map. Figure 4 The schematic diagram of the comparison between the original image and the heat map shown in the figure can clearly illustrate the main object in the image through the heat map. In practical applications, image saliency detection can be performed based on the content information of the target image to generate a heat map of the target image. The above is only an exemplary description. In practical applications, the objects contained in the target image can also be determined according to the object detection algorithm, and the main object can be determined based on the type and / or position of each object.
[0063] By limiting the main object to be located in the first area, the main object can be mirrored, thereby enhancing the visual impact of the user.
[0064] (3) The proportion of the second area relative to the target image is within a preset proportion range.
[0065] By setting the proportion range of the second area, it is possible to avoid the second area being too large or too small. In other words, it is possible to avoid the proportion of the mirrored content of the first area in the target image being within an appropriate range, thereby ensuring the user's viewing experience.
[0066] Step B2, determining the position of the mirror line in the target image (which can be understood as the optimal position) according to the target angle, content information and image division conditions; wherein the first area and the second area obtained by dividing the mirror line meet the image division conditions.
[0067] In some specific implementation examples, the following steps B2.1 to B2.2 may be referred to for execution:
[0068] Step B2.1, determining the target initial position corresponding to the target angle according to the preset correspondence between the mirror line angle and the mirror line initial position.
[0069] In practical applications, for each mirror line angle, a corresponding mirror line initial position can be pre-set. For example, taking the reference line as a horizontal line, if the mirror line angle is 90 degrees, the mirror line initial position can be set at the vertical center line of the target image. If the mirror line angle is 0 degrees, the mirror line initial position can be set at the horizontal center line of the target image. If the mirror line angle is 45 degrees, the mirror line endpoint can be set at a specified vertex of the target image.
[0070] Step B2.2, when the first area and the second area divided by the mirror line located at the initial position of the target do not meet the image division conditions, adjust the position of the mirror line from the initial position of the target until the first area and the second area divided by the adjusted mirror line meet the image division conditions.
[0071] If the first area and the second area divided by the mirror line located at the target initial position meet the image division conditions, the target initial position is used as the optimal position of the mirror line; if it does not meet the image division conditions, it is necessary to make trial adjustments starting from the target initial position until the optimal position of the mirror line is found, so that the first area and the second area divided by the adjusted mirror line meet the image division conditions.
[0072] In a specific implementation example of adjusting the position of the mirror line from the target initial position, the position of the mirror line can be moved in parallel according to a preset step length from the target initial position until the image division condition is met.
[0073] For easier understanding, see Figure 5 A schematic diagram of adjusting the position of a mirror line is shown. Taking the subject object in the target image as a person as an example, assuming that the baseline is a horizontal line, the angle between the mirror line and the preset baseline is 90 degrees, and assuming that the initial position of the mirror line is L0, but the first area and the second area obtained by segmentation do not meet the image division condition at this time, that is, the subject object is not completely located in the first area, so the mirror line can be moved according to the preset step length, and the step length can be flexibly set according to the needs. A judgment operation is performed each time it is moved until the first area and the second area divided by the mirror line after the position adjustment meet the image division condition, such as Figure 5 The mirror line position L1 in the above method can be used to quickly and effectively determine the optimal position of the mirror line.
[0074] The image processing method provided by the embodiment of the present disclosure can conveniently and quickly present a mirror image to the user. Moreover, since the mirror image line position is not fixed but is personalized based on the image content information, the obtained mirror image content is more in line with the actual scene, has a stronger image appeal, and can effectively enhance the visual impact. For ease of understanding, see Figure 6 and Figure 7A schematic diagram of a processed target image is shown respectively. Figure 6 Schematic street scene and Figure 7 In the illustrated urban building scene, for ease of understanding, Figure 6 and Figure 7 The mirror lines are marked, but in actual applications, they may not be marked. The mirror lines of different scenes are located in different positions, giving different effects, but all have a strong visual impact, and can even give users a surrealistic effect of the world being folded, such as the ocean being twisted by 90 degrees, water flowing horizontally and vertically at the same time, and urban buildings being mirrored up and down to present the scene of a future city in the sky. The above methods increase the drama and magic of the picture, providing users with a shocking new perspective to observe the world.
[0075] Corresponding to the aforementioned image processing method, Figure 8 FIG. 1 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device, such as Figure 8 As shown, the device comprises:
[0076] An image acquisition module 802 is used to acquire a target image to be processed;
[0077] Content acquisition module 804, used to acquire content information of a target image;
[0078] A mirror line determination module 806 is used to determine the position of the mirror line in the target image according to the content information; wherein the mirror line divides the target image into a first area and a second area;
[0079] A mirror content determination module 808, configured to determine the mirror content corresponding to the image content of the first area based on the position of the mirror line in the target image and the second area;
[0080] The content covering module 810 is used to cover the image content of the second area with the mirror content to obtain a processed target image.
[0081] The above-mentioned image processing device provided by the embodiment of the present disclosure can conveniently and quickly present a mirror image perception to the user, and because the position of the mirror line is not fixed but is personalized based on the image content information, the obtained mirror content is more in line with the actual scene, has a stronger image appeal, and can effectively enhance the visual impact effect.
[0082] In some implementations, the mirror line determination module 806 is specifically used to: determine the target scene category to which the target image belongs from a plurality of preset scene categories according to the content information; and determine the position of the mirror line in the target image according to the target scene category.
[0083] In some embodiments, the mirror line determination module 806 is specifically used to: determine a target angle according to the target scene category; wherein the target angle is the angle between the mirror line and a preset baseline; and determine a position of the mirror line in the target image according to the target angle and the content information.
[0084] In some implementations, the mirror line determination module 806 is specifically configured to determine a target angle corresponding to the target scene category according to a preset correspondence between the scene category and the mirror line angle.
[0085] In some embodiments, the mirror line determination module 806 is specifically used to: obtain a preset image division condition; determine the position of the mirror line in the target image according to the target angle, the content information and the image division condition; wherein the first area and the second area obtained by dividing the mirror line meet the image division condition.
[0086] In some embodiments, the image division conditions include one or more of the following conditions: the area of the first region is not less than the area of the second region; the main object in the target image is located in the first region, and the main object is determined based on the content information of the target image; the proportion of the second region relative to the target image is within a preset proportion range.
[0087] In some implementations, the subject object is determined in the following manner: a heat map of the target image is generated according to content information of the target image, and the subject object is determined according to the heat map.
[0088] In some embodiments, the mirror line determination module 806 is specifically used to: determine the target initial position corresponding to the target angle based on the correspondence between the preset mirror line angle and the mirror line initial position; when the first area and the second area divided by the mirror line located at the target initial position do not meet the image division condition, adjust the position of the mirror line from the target initial position until the adjusted first area and second area divided by the mirror line meet the image division condition.
[0089] In some implementations, the mirror line determination module 806 is specifically configured to: start from the initial position of the target and move the position of the mirror line in parallel according to a preset step length.
[0090] In some embodiments, the image acquisition module 802 is specifically used to: acquire an original image, and acquire a global main direction of the original image; when the global main direction of the original image is inconsistent with a preset direction, correct the original image to obtain a target image to be processed.
[0091] The image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0092] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.
[0093] Fig. 9 The structure diagram of an electronic device provided by the embodiment of the present disclosure is shown in FIG. Fig. 9 As shown, the electronic device 900 includes one or more processors 901 and a memory 902 .
[0094] The processor 901 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 900 to perform desired functions.
[0095] The memory 902 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 901 may run the program instructions to implement the image processing method of the embodiment of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0096] In one example, the electronic device 900 may further include: an input device 903 and an output device 904 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0097] In addition, the input device 903 may also include, for example, a keyboard, a mouse, and the like.
[0098] The output device 904 can output various information to the outside, including the determined distance information, direction information, etc. The output device 904 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0099] Of course, to simplify, Fig. 9 Only some of the components related to the present disclosure in the electronic device 900 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 900 may also include any other appropriate components.
[0100] In addition to the above-mentioned method and device, the embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, the processor executes the image processing method provided by the embodiment of the present disclosure.
[0101] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0102] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the image processing method provided by the embodiment of the present disclosure.
[0103] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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.
[0104] The embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the image processing method in the embodiment of the present disclosure when the computer program / instruction is executed by a processor.
[0105] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0106] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, characterized in that: include: Obtaining a target image to be processed; Acquire content information of the target image; Determine, according to the content information, a position of a mirror line in the target image; wherein the mirror line divides the target image into a first area and a second area; Determining, based on the position of the mirror line in the target image and the second area, mirror content corresponding to the image content of the first area; The image content of the second area is covered with the mirror image content to obtain a processed target image.
2. The method according to claim 1, characterized in that: The step of determining the position of the mirror line in the target image according to the content information comprises: Determining, according to the content information, a target scene category to which the target image belongs from a plurality of preset scene categories; According to the target scene category, a position of a mirror line in the target image is determined.
3. The method according to claim 2, characterized in that The step of determining the position of the mirror line in the target image according to the target scene category comprises: Determine a target angle according to the target scene category; wherein the target angle is the angle between the mirror line and the preset reference line; The position of the mirror line in the target image is determined according to the target angle and the content information.
4. The method according to claim 3, characterized in that The step of determining the target angle according to the target scene category comprises: According to the preset correspondence between the scene category and the mirror line angle, a target angle corresponding to the target scene category is determined.
5. The method according to claim 3, characterized in that: The step of determining the position of the mirror line in the target image according to the target angle and the content information comprises: Obtaining preset image segmentation conditions; The position of the mirror line in the target image is determined according to the target angle, the content information and the image division condition; wherein the first area and the second area divided by the mirror line meet the image division condition.
6. The method according to claim 5, characterized in that The image segmentation condition includes one or more of the following conditions: The area of the first region is not less than the area of the second region; The main object in the target image is located in the first area, and the main object is determined based on content information of the target image; The proportion of the second area relative to the target image is within a preset proportion interval.
7. The method according to claim 6, characterized in that The main object is determined in the following manner: a heat map of the target image is generated according to content information of the target image, and the main object is determined according to the heat map.
8. The method according to claim 5, characterized in that The step of determining the position of the mirror line in the target image according to the target angle, the content information and the image division condition comprises: Determine the target initial position corresponding to the target angle according to the correspondence between the preset mirror line angle and the mirror line initial position; When the first area and the second area divided by the mirror line located at the target initial position do not meet the image division condition, the position of the mirror line is adjusted from the target initial position until the first area and the second area divided by the adjusted mirror line meet the image division condition.
9. The method according to claim 8, characterized in that The step of adjusting the position of the mirror line from the target initial position comprises: Starting from the initial position of the target, the position of the mirror line is moved in parallel according to a preset step length.
10. The method according to claim 1, characterized in that The step of obtaining the target image to be processed includes: Acquire an original image, and acquire a global main direction of the original image; When the global main direction of the original image is inconsistent with the preset direction, the original image is corrected to obtain a target image to be processed.
11. An image processing device, characterized in that: include: An image acquisition module, used for acquiring a target image to be processed; A content acquisition module, used to acquire content information of the target image; A mirror line determination module, used to determine the position of the mirror line in the target image according to the content information; wherein the mirror line divides the target image into a first area and a second area; a mirror content determination module, configured to determine the mirror content corresponding to the image content of the first area based on the position of the mirror line in the target image and the second area; The content covering module is used to cover the image content of the second area with the mirror content to obtain a processed target image.
12. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the image processing method described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the image processing method described in any one of claims 1 to 10.
14. A computer program product, characterized in that The invention comprises a computer program, wherein when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Image processing method and apparatus, and device and medium
EP4693200A1
