CN112532879B - Image processing method and device - Google Patents
Image processing method and device Download PDFInfo
- Publication number
- CN112532879B CN112532879B CN202011350234.0A CN202011350234A CN112532879B CN 112532879 B CN112532879 B CN 112532879B CN 202011350234 A CN202011350234 A CN 202011350234A CN 112532879 B CN112532879 B CN 112532879B
- Authority
- CN
- China
- Prior art keywords
- brightness
- area
- image
- target
- determining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 18
- 238000000034 method Methods 0.000 claims abstract description 43
- 238000004891 communication Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000003384 imaging method Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/62—Control of parameters via user interfaces
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
- H04N23/632—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Studio Devices (AREA)
Abstract
The application discloses an image processing method and device, and belongs to the technical field of communication. The method comprises the following steps: the method comprises the steps of obtaining a first image through a first camera, determining a first position where a target light source is located through a second camera, determining a target shadow area in the first image according to the first position and a second position where electronic equipment is located, and adjusting the brightness of the target shadow area to obtain a target image, so that shadow of the electronic equipment does not exist in the target image.
Description
Technical Field
The present application belongs to the field of communication technologies, and in particular, to an image processing method and apparatus.
Background
With the improvement of software and hardware technology of electronic equipment, a user can take a picture or record a video by using a camera function on the electronic equipment.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art: when a user takes a picture by using electronic equipment in sunlight or lamplight, if a light source, the electronic equipment and a photographed object are positioned on the same straight line, the shadow of the electronic equipment appears in the picture, and the aesthetic feeling of the picture is influenced. In order to avoid the appearance of shadows of electronic equipment in the photos, a user needs to adjust the shooting angle until the light source, the mobile phone and the shot object are not in the same straight line, so that the problem that the user operation is complicated exists.
Disclosure of Invention
The embodiment of the application aims to provide an image processing method and device, and the problem that in the prior art, in order to avoid the occurrence of shadows of electronic equipment in a picture, a user needs to adjust a shooting angle until a light source, a mobile phone and a shot object are not in the same straight line, so that the operation of the user is complicated is solved.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, where the electronic device includes a first camera and a second camera, and the method includes:
acquiring a first image through the first camera;
determining a first position of a target light source through the second camera;
determining a target shadow area in the first image according to the first position and a second position of the electronic equipment;
and adjusting the brightness of the target shadow area to obtain a target image.
In a second aspect, an embodiment of the present application provides an image processing apparatus, which is applied to an electronic device, where the electronic device includes a first camera and a second camera, and includes:
the first acquisition module is used for acquiring a preview first image through the first camera;
the first determining module is used for determining a first position of the target light source through the second camera;
a second determining module, configured to determine a target shadow area in the first image according to the first position and a second position where the electronic device is located;
and the adjusting module is used for adjusting the brightness of the target shadow area to obtain a target image.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In this embodiment of the present application, in the image processing method provided in this embodiment, a first image is obtained by a first camera, a first position where a target light source is located is determined by a second camera, a target shadow area in the first image is determined according to the first position and a second position where an electronic device is located, and brightness of the target shadow area is adjusted to obtain a target image, so that a shadow of the electronic device does not exist in the target image, and because the method does not require a user to adjust a shooting angle, a shadow of the electronic device does not exist in a preview image, thereby simplifying user operations.
Drawings
FIG. 1 is a flow chart of steps of an image processing method provided in an embodiment of the present application;
FIG. 2 is a flow chart of steps of another image processing method provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a process of determining a first area according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an image processing apparatus provided in an embodiment of the present application;
fig. 5 is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of another electronic device for implementing the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The image processing method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, fig. 1 is a flowchart of steps of an image processing method provided in an embodiment of the present application, and is applied to an electronic device, where the electronic device includes a first camera and a second camera, and the electronic device includes, for example, a smartphone, a tablet computer, and the like, and the method may include the following steps:
The method comprises the steps that a camera of a mobile phone is used, shooting and previewing are usually two sets of processes, a shooting application downloaded by a third party is sometimes the same set of process, and in the method, shooting or previewing is not specifically limited, namely a first image can be a preview image or a shooting image.
And 102, determining a first position of the target light source through the second camera.
The second camera is, for example, a front camera in a mobile phone, and the first position where the target light source is located can be determined according to an image obtained by the front camera.
And 103, determining a target shadow area in the first image according to the first position and the second position of the electronic equipment.
Wherein, the target shadow area refers to a shadow area formed by the projection of the electronic equipment in the first image.
And step 104, adjusting the brightness of the target shadow area to obtain a target image.
In this embodiment, after the first image is acquired, whether a projection area of the electronic device in the first image is a target shadow area may be determined according to the first position and the second position where the electronic device is located, and when the projection area is the target shadow area, the brightness of the target shadow area is adjusted to obtain the target image.
The brightness of the target shadow area is adjusted to obtain a target image, and the method can be realized by the following steps:
and adjusting the brightness of the target shadow area according to the ambient brightness of the electronic equipment to obtain a target image.
According to the ambient brightness of the electronic device, adjusting the brightness of the target shadow area to obtain the target image can be realized by the following steps:
determining the expected brightness of each pixel point in the target shadow region according to the ambient brightness;
and adjusting the brightness of each pixel point in the target shadow area according to the expected brightness of each pixel point in the target shadow area.
For example, pixel 1, pixel 2, and pixel 3 are included in the target shadow region, where the expected brightness of pixel 1 is expected brightness 1, the expected brightness of pixel 2 is expected brightness 2, and the brightness of pixel 3 is expected brightness 3. Before the brightness of the pixel point in the target shadow region is not adjusted, the brightness of the pixel point 1 is brightness 1, the brightness of the pixel point 2 is brightness 2, and the brightness of the pixel point 3 is brightness 3, then the brightness 1 is adjusted to be the expected brightness 1, the brightness 2 is adjusted to be the expected brightness 2, and the brightness 3 is adjusted to be the expected brightness 3, so that the brightness of the pixel point 1, the brightness of the pixel point 2, and the brightness of the pixel point 3 are improved, that is, the brightness of the target shadow region is also improved, and the shadow in the first image is removed.
In the image processing method provided by this embodiment, the first camera acquires the first image, the second camera determines the first position of the target light source, the target shadow area in the first image is determined according to the first position and the second position of the electronic device, and the brightness of the target shadow area is adjusted to obtain the target image, so that the shadow of the electronic device does not exist in the target image.
Referring to fig. 2, fig. 2 is a flowchart illustrating steps of another image processing method provided in an embodiment of the present application, where the method may include the steps of:
Step 203, determining a first area in the first image according to the first position and the second position of the electronic device.
Wherein, according to the first position and the second position of the electronic device, determining the first area in the first image may be implemented as follows:
acquiring depth information of a shot object in a preview image;
obtaining two-dimensional space information of projection of the electronic equipment on a preview image according to a first position of the target light source, a second position of the electronic equipment and the depth information;
and determining the first area according to the projected two-dimensional space information and the two-dimensional space information of the shot object on the preview image.
To describe the process of determining the first area more clearly, it is assumed that the target light source and the mobile phone are in a two-dimensional space, as shown in fig. 3, fig. 3 is a schematic diagram of a process of determining the first area according to an embodiment of the present application, a point a represents the light source, BC represents the length of the electronic device, a point C represents a first camera end of the electronic device, and EF represents the length of the projection of the electronic device on the object to be photographed. The purpose is to find the length of EF so that the position of the projection of the electronic device in the first image can be calculated, i.e. the first area is determined, by the lens imaging principle of the camera.
The horizontal angle of the electronic equipment is obtained through the gyroscope sensor to be alpha, the second position of the electronic equipment comprises the horizontal angle of the electronic equipment, the horizontal angle refers to an included angle between the electronic equipment and a horizontal line, and the horizontal angle of the light source is obtained through a front camera of the electronic equipment to be beta. The length of the AC and the length of the CF can be obtained using the Time of flight (ToF) philosophy. The basic ToF principle is that modulated light pulses are emitted by an infrared emitter, and after the modulated light pulses encounter an object to be reflected, the reflected light pulses are received by a receiver, and the distance between a camera and the object is calculated according to the round-trip time of the light pulses. According to the principle of similar triangles, it can be found that:
AD/AF=BD/EF (1)
from the sine theorem and the cosine theorem of triangles, we can obtain:
BD=BC×cosα+BC×sinα×cotβ (2)
CD=(BC·sinα)/sinα (3)
from the formula (3), the length of CD is obtained, and the length of AC is known, and AD can be obtained
AD=AC+CD (4)
AC. The length of the CF segment is known, and AF can be found
AF=AC+CF (5)
The length of EF can be obtained by bringing the equations (2), (3), (4) and (5) into the equation (1), which is equivalent to obtaining the position of the shadow on the shot object, and the position of EF in the preview image can be obtained according to the imaging principle of the lens, namely the two-dimensional space information of the projection of the electronic equipment on the first image.
For example, a boundary line which equally divides the imaging region into two regions is used as a reference, a pixel point in the preview image, which is horizontally away from the boundary line by less than or equal to a first preset threshold value, forms an adjacent region of the imaging region, and the horizontal distance between the pixel point in the preview image and the boundary line is used as the horizontal distance from the pixel point to the imaging region.
Step 205, determining that the first region is the target shadow region when the brightness of the first region and the brightness of the adjacent region meet the preset condition.
Wherein, judging whether the first region is the target shadow region according to the brightness of the first region and the brightness of the adjacent region can be realized by the following method:
determining the first area as a target shadow area under the condition that the brightness of the first area is less than that of the adjacent area and the difference value between the brightness of the first area and the brightness of the adjacent area is less than or equal to a second preset threshold value; or,
and under the condition that the brightness of the first area is less than that of the adjacent area and the ratio of the brightness of the first area to that of the adjacent area is less than or equal to a third preset threshold, determining that the first area is a target shadow area.
When the luminance of the first region is less than the luminance of the adjacent region and the difference between the luminance of the first region and the luminance of the adjacent region is less than or equal to a second preset threshold, or when the luminance of the first region is less than the luminance of the adjacent region and the ratio of the luminance of the first region to the luminance of the adjacent region is less than or equal to a third preset threshold, it may be determined that the luminance of the first region and the luminance of the adjacent region satisfy a preset condition.
And step 205, adjusting the brightness of the target shadow area to obtain a target image.
According to the image processing method provided by the embodiment, the first area in the first image is determined according to the first position and the second position where the electronic device is located, the brightness of the first area and the brightness of the adjacent area of the first area are obtained, the first area is determined to be the target shadow area under the condition that the brightness of the first area and the brightness of the adjacent area meet the preset condition, and the brightness of the target shadow area is adjusted to obtain the target image, so that the shadow of the electronic device in the first image is removed, the picture without the shadow of the electronic device can be shot without manually adjusting the shooting angle by a user, and the user operation is simplified.
It should be noted that, in the image processing method provided in the embodiment of the present application, the execution subject may be an image processing apparatus, or a control module for executing the method of image processing in the image processing apparatus. The embodiment of the present application takes a method for executing image processing by an image processing apparatus as an example, and describes an apparatus for image processing provided in the embodiment of the present application.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an image processing apparatus provided in an embodiment of the present application, where the image processing apparatus 400 includes:
a first obtaining module 410, configured to obtain a preview first image through the first camera;
the first determining module 420 is configured to determine, by the second camera, a first position where the target light source is located;
a second determining module 430, configured to determine a target shadow area in the first image according to the first position and a second position where the electronic device is located;
the adjusting module 440 is configured to adjust the brightness of the target shadow area to obtain a target image.
The image processing apparatus provided in this embodiment obtains the first image through the first camera, determines the first position where the target light source is located through the second camera, determines the target shadow area in the first image according to the first position and the second position where the electronic device is located, and adjusts the brightness of the target shadow area to obtain the target image, so that the target image does not have a shadow of the electronic device.
Optionally, the second determining module 430 specifically includes:
a first determining unit, configured to determine a first area in the first image according to the first position and a second position where the electronic device is located;
the acquisition unit is used for acquiring the brightness of the first area and the brightness of an adjacent area of the first area, wherein the horizontal distance between each pixel point in the adjacent area and the first area is less than or equal to a first preset threshold value;
and the second determining unit is used for determining the first area as the target shadow area under the condition that the brightness of the first area and the brightness of the adjacent area meet preset conditions.
Optionally, the first determining unit is specifically configured to acquire depth information of a captured object in the preview image;
obtaining two-dimensional space information of the projection of the electronic equipment on the preview image according to the first position of the target light source, the second position of the electronic equipment and the depth information;
and determining the first area according to the projected two-dimensional space information and the two-dimensional space information of the shot object on the preview image.
Optionally, the adjusting module 440 is specifically configured to adjust the brightness of the target shadow area according to the ambient brightness of the electronic device, so as to obtain the target image.
Optionally, the adjusting module 440 is specifically configured to determine an expected brightness of each pixel point in the target shadow region according to the ambient brightness; and adjusting the brightness of each pixel point in the target shadow region according to the expected brightness of each pixel point in the target shadow region.
The image processing apparatus in the embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The image processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The image processing apparatus provided in the embodiment of the present application can implement each process implemented by the image processing apparatus in the method embodiments of fig. 1 and fig. 2, and is not described herein again to avoid repetition.
Optionally, an electronic device is further provided in an embodiment of the present application, as shown in fig. 5, fig. 5 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application. The electronic device 500 includes a processor 501, a memory 502, and a program or an instruction stored in the memory 502 and executable on the processor 501, where the program or the instruction implements each process of the image processing method embodiment when executed by the processor 501, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 6 is a schematic hardware structure diagram of another electronic device for implementing the embodiment of the present application.
The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and the like.
Those skilled in the art will appreciate that the electronic device 600 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 610 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 610 is configured to acquire a first image through the first camera;
determining a first position of a target light source through the second camera;
determining a target shadow area in the first image according to the first position and a second position of the electronic equipment;
and adjusting the brightness of the target shadow area to obtain a target image.
A processor 610, further configured to determine a first region in the first image according to the first position and a second position where the electronic device is located;
acquiring the brightness of the first area and the brightness of an adjacent area of the first area, wherein the horizontal distance between each pixel point in the adjacent area and the first area is less than or equal to a first preset threshold value;
and under the condition that the brightness of the first area and the brightness of the adjacent area meet preset conditions, determining that the first area is the target shadow area.
The processor 610 is further configured to obtain depth information of the photographed object in the preview image;
obtaining two-dimensional space information of the projection of the electronic equipment on the preview image according to the first position of the target light source, the second position of the electronic equipment and the depth information;
and determining the first area according to the projected two-dimensional space information and the two-dimensional space information of the shot object on the preview image.
The processor 610 is further configured to adjust the brightness of the target shadow area according to the brightness of the environment where the electronic device is located, so as to obtain a target image.
The processor 610 is further configured to determine an expected brightness of each pixel point in the target shadow region according to the ambient brightness;
and adjusting the brightness of each pixel point in the target shadow region according to the expected brightness of each pixel point in the target shadow region.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above noise reduction function control method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device in the above embodiment. Readable storage media, including computer-readable storage media, such as Read-Only Memory (ROM), random-access Memory (RAM), magnetic or optical disks, etc.
It is to be understood that, in the embodiment of the present application, the input Unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042, and the Graphics Processing Unit 6041 processes image data of a still picture or a video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 607 includes a touch panel 6071 and other input devices 6072. A touch panel 6071, also referred to as a touch screen. The touch panel 6071 may include two parts of a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 609 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. The processor 610 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 610.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the embodiment of the image processing method, and the same technical effect can be achieved.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (10)
1. An image processing method is applied to an electronic device, the electronic device comprises a first camera and a second camera, and the method is characterized by comprising the following steps:
acquiring a first image through the first camera;
determining a first position of a target light source through the second camera;
determining a target shadow area in the first image according to the first position and a second position of the electronic equipment;
adjusting the brightness of the target shadow area to obtain a target image;
the target light source is in the same space as the electronic device.
2. The method according to claim 1, wherein the determining the target shadow region in the first image according to the first position and the second position where the electronic device is located specifically includes:
determining a first area in the first image according to the first position and a second position of the electronic equipment;
acquiring the brightness of the first area and the brightness of an adjacent area of the first area, wherein the horizontal distance between each pixel point in the adjacent area and the first area is less than or equal to a first preset threshold value;
and under the condition that the brightness of the first area and the brightness of the adjacent area meet preset conditions, determining that the first area is the target shadow area.
3. The method according to claim 2, wherein determining the first region in the first image according to the first position and the second position where the electronic device is located specifically includes:
acquiring depth information of a shot object in the first image;
obtaining two-dimensional space information of the projection of the electronic equipment on the first image according to the first position of the target light source, the second position of the electronic equipment and the depth information;
and determining the first area according to the projected two-dimensional space information and the two-dimensional space information of the shot object on the first image.
4. The method according to claim 1, wherein the adjusting the brightness of the target shadow region to obtain the target image specifically comprises:
and adjusting the brightness of the target shadow area according to the ambient brightness of the electronic equipment to obtain a target image.
5. The method according to claim 4, wherein the adjusting the brightness of the target shadow area according to the ambient brightness of the electronic device to obtain the target image specifically comprises:
determining the expected brightness of each pixel point in the target shadow region according to the environment brightness;
and adjusting the brightness of each pixel point in the target shadow region according to the expected brightness of each pixel point in the target shadow region.
6. An image processing apparatus applied to an electronic device, the electronic device including a first camera and a second camera, the image processing apparatus comprising:
the first acquisition module is used for acquiring a preview first image through the first camera;
the first determining module is used for determining a first position of the target light source through the second camera;
a second determining module, configured to determine a target shadow area in the first image according to the first position and a second position where the electronic device is located;
the adjusting module is used for adjusting the brightness of the target shadow area to obtain a target image;
wherein the target light source is in the same space as the electronic device.
7. The apparatus of claim 6, wherein the second determining module specifically comprises:
a first determining unit, configured to determine a first area in the first image according to the first position and a second position where the electronic device is located;
the acquisition unit is used for acquiring the brightness of the first area and the brightness of an adjacent area of the first area, wherein the horizontal distance between each pixel point in the adjacent area and the first area is less than or equal to a first preset threshold value;
and the second determining unit is used for determining the first area as the target shadow area under the condition that the brightness of the first area and the brightness of the adjacent area meet preset conditions.
8. The apparatus of claim 7,
the first determining unit is specifically configured to acquire depth information of a photographed object in the first image;
obtaining two-dimensional space information of the projection of the electronic equipment on the first image according to the first position of the target light source, the second position of the electronic equipment and the depth information;
and determining the first area according to the projected two-dimensional space information and the two-dimensional space information of the shot object on the first image.
9. The apparatus of claim 6,
the adjusting module is specifically configured to adjust the brightness of the target shadow area according to the ambient brightness of the electronic device, so as to obtain a target image.
10. The apparatus of claim 9,
the adjusting module is specifically configured to determine an expected brightness of each pixel point in the target shadow region according to the ambient brightness; and adjusting the brightness of each pixel point in the target shadow region according to the expected brightness of each pixel point in the target shadow region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011350234.0A CN112532879B (en) | 2020-11-26 | 2020-11-26 | Image processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011350234.0A CN112532879B (en) | 2020-11-26 | 2020-11-26 | Image processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112532879A CN112532879A (en) | 2021-03-19 |
CN112532879B true CN112532879B (en) | 2022-04-12 |
Family
ID=74993775
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011350234.0A Active CN112532879B (en) | 2020-11-26 | 2020-11-26 | Image processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112532879B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102494610A (en) * | 2011-10-05 | 2012-06-13 | 友达光电股份有限公司 | Projection type image identification device and image identification method thereof |
CN104079802A (en) * | 2013-03-29 | 2014-10-01 | 现代Mnsoft公司 | Method and apparatus for removing shadow from aerial or satellite photograph |
CN108525298A (en) * | 2018-03-26 | 2018-09-14 | 广东欧珀移动通信有限公司 | Image processing method, device, storage medium and electronic equipment |
CN109446945A (en) * | 2018-10-15 | 2019-03-08 | Oppo广东移动通信有限公司 | Threedimensional model treating method and apparatus, electronic equipment, computer readable storage medium |
CN109544605A (en) * | 2018-05-23 | 2019-03-29 | 安徽大学 | Moving shadow detection method based on space-time relation modeling |
CN110363729A (en) * | 2019-07-30 | 2019-10-22 | 维沃移动通信有限公司 | A kind of image processing method, terminal device and computer readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006119817A (en) * | 2004-10-20 | 2006-05-11 | Fuji Photo Film Co Ltd | Image processor |
WO2018011930A1 (en) * | 2016-07-13 | 2018-01-18 | 楽天株式会社 | Image processing device, image processing method, and program |
WO2020019133A1 (en) * | 2018-07-23 | 2020-01-30 | 太平洋未来科技(深圳)有限公司 | Method and device for determining shadow effect and electronic device |
-
2020
- 2020-11-26 CN CN202011350234.0A patent/CN112532879B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102494610A (en) * | 2011-10-05 | 2012-06-13 | 友达光电股份有限公司 | Projection type image identification device and image identification method thereof |
CN104079802A (en) * | 2013-03-29 | 2014-10-01 | 现代Mnsoft公司 | Method and apparatus for removing shadow from aerial or satellite photograph |
CN108525298A (en) * | 2018-03-26 | 2018-09-14 | 广东欧珀移动通信有限公司 | Image processing method, device, storage medium and electronic equipment |
CN109544605A (en) * | 2018-05-23 | 2019-03-29 | 安徽大学 | Moving shadow detection method based on space-time relation modeling |
CN109446945A (en) * | 2018-10-15 | 2019-03-08 | Oppo广东移动通信有限公司 | Threedimensional model treating method and apparatus, electronic equipment, computer readable storage medium |
CN110363729A (en) * | 2019-07-30 | 2019-10-22 | 维沃移动通信有限公司 | A kind of image processing method, terminal device and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112532879A (en) | 2021-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107197169B (en) | high dynamic range image shooting method and mobile terminal | |
US20170124833A1 (en) | Alarming method and device | |
WO2016192325A1 (en) | Method and device for processing logo on video file | |
CN111601066B (en) | Information acquisition method and device, electronic equipment and storage medium | |
CN112954199B (en) | Video recording method and device | |
CN112437232A (en) | Shooting method, shooting device, electronic equipment and readable storage medium | |
CN112291473B (en) | Focusing method and device and electronic equipment | |
CN112333382B (en) | Shooting method and device and electronic equipment | |
US20150187056A1 (en) | Electronic apparatus and image processing method | |
CN112492201B (en) | Photographing method and device and electronic equipment | |
WO2022156673A1 (en) | Display control method and apparatus, electronic device, and medium | |
CN113794831B (en) | Video shooting method, device, electronic equipment and medium | |
CN112788244B (en) | Shooting method, shooting device and electronic equipment | |
CN112383708B (en) | Shooting method and device, electronic equipment and readable storage medium | |
CN112532879B (en) | Image processing method and device | |
CN113473008B (en) | Shooting method and device | |
CN112584110B (en) | White balance adjusting method and device, electronic equipment and storage medium | |
CN112565605B (en) | Image display method and device and electronic equipment | |
CN112261300B (en) | Focusing method and device and electronic equipment | |
CN114745505A (en) | Shooting method, shooting device, electronic equipment and readable storage medium | |
CN113989706A (en) | Image processing method and device, server, electronic device and readable storage medium | |
CN114339051A (en) | Shooting method, shooting device, electronic equipment and readable storage medium | |
CN113962840A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN110619257B (en) | Text region determining method and device | |
CN113794833A (en) | Shooting method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |