CN107590792B - Method, apparatus and computer-readable storage medium for presenting GND filter boundary - Google Patents

Method, apparatus and computer-readable storage medium for presenting GND filter boundary Download PDF

Info

Publication number
CN107590792B
CN107590792B CN201710914736.3A CN201710914736A CN107590792B CN 107590792 B CN107590792 B CN 107590792B CN 201710914736 A CN201710914736 A CN 201710914736A CN 107590792 B CN107590792 B CN 107590792B
Authority
CN
China
Prior art keywords
current
line
boundary
gnd filter
edge line
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
Application number
CN201710914736.3A
Other languages
Chinese (zh)
Other versions
CN107590792A (en
Inventor
陈国庭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710914736.3A priority Critical patent/CN107590792B/en
Publication of CN107590792A publication Critical patent/CN107590792A/en
Application granted granted Critical
Publication of CN107590792B publication Critical patent/CN107590792B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a method for presenting a boundary of a GND filter, which comprises the following steps: when a GND filter demarcation line mode is started, acquiring a current image; when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of a current image; obtaining an edge line of the gray scale image according to the gray scale image; carrying out segmentation processing on the edge line to obtain an edge line to be processed; determining an edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of a gray scale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary; the first GND filter boundary is present on the current image. The invention also discloses equipment for presenting the boundary of the GND filter and a computer readable storage medium. By the scheme of the invention, the picture can be well balanced, the condition that part of the picture is too dark or too bright is reduced, and the shooting effect is improved.

Description

Method, apparatus and computer-readable storage medium for presenting GND filter boundary
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, and a computer-readable storage medium for presenting a boundary line of a gray-to-Gray (GND) filter.
Background
The GND filter is used for filtering light rays, the filtering effect is non-selective, the GND filter is half-transparent and half-light-resistant, and blocks a part of light rays entering the lens, correct exposure combination allowed by the camera is mainly obtained under the conditions of shallow depth of field photography, low-speed photography and strong light, and the correct exposure combination is also commonly used for balancing the tone; that is, the reduction capability of the GND filter to various light with different wavelengths is equal and uniform, only the light is weakened, and the color of the original object is not affected, so that the contrast of the scenery can be truly reproduced. When the shot picture is too bright, shooting with a required slow shutter may not be possible, and in this case, the light transmission amount can be reduced by using the GND filter, overexposure is avoided, and the shooting intention of the user is reflected.
For example, the GND filter can be used for balancing the contrast of the upper part and the lower part or the left part and the right part of a picture, is commonly used for reducing the brightness of the sky and the contrast of the sky and the ground, and can effectively darken the brightness of the sky above the lower part of the picture under the condition of ensuring the normal exposure of the lower part of the picture, so that the light and shade transition of the picture is soft, and the texture of the cloud can be effectively highlighted.
However, the boundary of the existing GND filter is relatively simple and is usually a straight line; for example, when the boundary between the sky and the ground is not a simple straight line and there are obstacles such as mountains and high-rise buildings, the boundary of the existing GND filter cannot balance the picture well, so that part of the picture is too dark or too bright, and the shooting effect is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide a method, a device, and a computer-readable storage medium for presenting boundaries of a GND filter, which can balance pictures well, reduce the occurrence of over-dark or over-bright situations in a part of the pictures, and improve the shooting effect.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a method for presenting a boundary line of a GND filter of a medium-gray gradient filter, which comprises the following steps:
when a boundary line mode of a GND filter of the medium-gray gradient filter is started, acquiring a current image;
when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of the current image;
obtaining an edge line of the gray scale image according to the gray scale image;
carrying out segmentation processing on the edge line to obtain an edge line to be processed;
determining the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
presenting the first GND filter boundary on the current image.
In the above scheme, after the acquiring the current image, the method further includes:
judging whether the mode for automatically presenting the boundary line of the GND filter is started or not;
when the mode for automatically presenting the GND filter boundary line is not started, starting a mode for manually presenting the GND filter boundary line;
when a mode of manually presenting the GND filter demarcation line is started, presenting the current image;
judging whether any one of two ends of a continuous line segment input on the current image is on any one of four boundaries of the current image;
determining a continuous line segment input on the current image as a second GND filter boundary when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
presenting the second GND filter boundary on the current image.
In the foregoing solution, the performing the segmentation processing on the edge line to obtain the edge line to be processed includes:
determining the current starting point of the edge line;
obtaining a current tangent line on the current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length;
taking the current tangent line as an axis, forming a current preset area on each of two sides of the current tangent line, wherein the length of the current preset area is the preset length, and the width of the preset area is the preset width;
calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value;
judging whether the current absolute value is smaller than the preset average threshold value or not;
deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
judging whether the edge line and the edge of the current preset area have an interaction point or not;
determining the interaction point as a next starting point when the edge line and the edge of the current preset area have the interaction point, and determining a point closest to the current tangent line as the next starting point when the edge line and the edge of the current preset area have at least two interaction points;
and determining the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and taking the undeleted part as the edge line to be processed.
In the above scheme, after the first GND filter boundary is presented on the current image, the method further includes:
providing a level option for the GND filter;
processing the current image according to the determined grade of the GND filter;
presenting the processed current image.
In the foregoing solution, the obtaining an edge line of the gray scale image according to the gray scale image includes:
and calculating by using a Sobel edge detection algorithm to obtain an edge line of the gray scale image.
The invention also provides a device for presenting a boundary line of a medium gray gradient filter (GND) filter, comprising: an interface, a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication among the interface, the processor and the memory;
the processor is used for executing the program which is stored in the memory and used for presenting the boundary line of the GND filter so as to realize the following steps:
when a boundary line mode of a GND filter of the medium-gray gradient filter is started, acquiring a current image;
when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of the current image;
obtaining an edge line of the gray scale image according to the gray scale image;
carrying out segmentation processing on the edge line to obtain an edge line to be processed;
determining the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
presenting the first GND filter boundary on the current image.
In the foregoing solution, the processor is further configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
judging whether the mode for automatically presenting the boundary line of the GND filter is started or not;
when the mode for automatically presenting the GND filter boundary line is not started, starting a mode for manually presenting the GND filter boundary line;
when a mode of manually presenting the GND filter demarcation line is started, presenting the current image;
judging whether any one of two ends of a continuous line segment input on the current image is on any one of four boundaries of the current image;
determining a continuous line segment input on the current image as a second GND filter boundary when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
presenting the second GND filter boundary on the current image.
In the foregoing solution, the processor is configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
determining the current starting point of the edge line;
obtaining a current tangent line on the current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length;
taking the current tangent line as an axis, and forming a current preset area on each of two sides of the current tangent line, wherein the length of the current preset area is a preset length, and the width of the preset area is a preset width;
calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value;
judging whether the current absolute value is smaller than the preset average threshold value or not;
deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
judging whether the edge line and the edge of the current preset area have an interaction point or not;
determining the interaction point as a next starting point when the edge line and the edge of the current preset area have the interaction point, and determining a point closest to the current tangent line as the next starting point when the edge line and the edge of the current preset area have at least two interaction points;
and determining the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and taking the undeleted part as the edge line to be processed.
In the foregoing solution, the processor is further configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
providing a level option for the GND filter;
processing the current image according to the determined grade of the GND filter;
presenting the processed current image.
The present invention also provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of the method of presenting a GND filter boundary as described above.
The method, the equipment and the computer storage medium for presenting the boundary of the GND filter, provided by the invention, are used for acquiring the current image when the GND filter mode is started; obtaining a gray scale image of a current image when a boundary mode of the GND filter is automatically presented and started; obtaining an edge line of the gray scale image by using an edge detection technology; carrying out segmentation processing on the edge line to obtain an edge line to be processed; when any one end of two ends of the edge line to be processed is on any one of four boundaries of the gray scale image, determining the edge line to be processed as a boundary line of the first GND filter; presenting a first GND filter boundary on the current image; according to the scheme provided by the invention, the positions on the image which need the GND filter boundary and the positions which do not need the GND filter boundary can be determined, and the GND filter boundary is automatically wired according to the actual form on the image, so that the situation of one-time cutting is avoided, the picture can be well balanced, the situation that part of the picture is too dark or too bright is reduced, and the shooting effect is improved.
Drawings
Fig. 1 is a schematic hardware configuration diagram of an alternative mobile terminal implementing various embodiments of the present invention;
fig. 2 is a schematic structural diagram of a communication network system in which a mobile terminal can operate according to an embodiment of the present invention;
FIG. 3 is a flowchart of a first embodiment of a method for representing boundaries of GND filters according to the present invention;
FIG. 4a is a flowchart of a second embodiment of the present invention showing boundary lines of GND filters;
FIG. 4b is a flowchart of a third embodiment of the present invention showing boundary lines of GND filters;
FIG. 5 is a diagram illustrating processing edge lines according to a third embodiment of the present invention;
FIG. 6 is a schematic diagram of a boundary line of a conventional GND filter according to a third embodiment of the present invention;
FIG. 7 is a diagram illustrating a boundary line of a GND filter according to a third embodiment of the present invention;
FIG. 8 is a schematic diagram of an embodiment of the present invention showing the boundary of the GND filter;
FIG. 9 is a schematic diagram of the structure of an embodiment of the present invention showing the boundary of the GND filter.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention, where the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex-Long Term Evolution), and TDD-LTE (Time Division duplex-Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a communication network system capable of being operated by a mobile terminal according to an embodiment of the present invention, where the communication network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio access network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
Example one
Fig. 3 is a flowchart of a first embodiment of the method for presenting a boundary of a GND filter according to the present invention, where the method for presenting a boundary of a GND filter according to the present invention can be applied to a terminal (hereinafter referred to as a terminal) for presenting a boundary of a GND filter, and if the terminal for presenting a boundary of a GND filter described in the embodiment of the present invention has an operating system, the operating system may be UNIX, Linux, Windows, Mac OS X, Android (Android), Windows Phone, or the like.
Application software (APP) is a third-party Application program of the intelligent terminal, and a user can work, entertain, acquire information and the like through various Application software, and the formats of the APP include ipa, pxl, deb, apk and the like.
As shown in fig. 3, the method for displaying the boundary of the GND filter provided by the embodiment of the present invention includes the following steps:
and 301, acquiring a current image when the GND filter demarcation mode is started.
And the terminal determines that the current image is acquired through the lens when the boundary mode of the GND filter is started, wherein the GND filter is arranged on the lens.
And step 302, when the mode of automatically presenting the GND filter boundary line is started, obtaining a gray scale image of the current image.
After the terminal acquires the current image, when the mode that the GND filter demarcation line is automatically presented is determined to be started, the gray value of each pixel in the current image is calculated, and the gray map of the current image is obtained according to the gray value of each pixel.
And 303, obtaining an edge line of the gray scale image according to the gray scale image.
And the terminal obtains the edge line of the gray-scale image by using an edge detection technology.
Specifically, the edge detection technology can be simply understood as extracting the outline of a region in an image, the division of the region in the image is based on the gray level of pixels, edge points are actually points with severe gray level jump in the image, the gray level of pixels in each region is approximately the same, the boundaries between the regions are called edges, and the purpose of searching the edges is the edge detection of the image.
Edge detection techniques can be broadly classified into two categories: based on the search and based on the zero crossing; search-based edge detection methods first calculate the edge strength, usually expressed in terms of the first derivative, e.g. the gradient mode, and then estimate the local direction of the edge by calculation, usually taking the direction of the gradient, and use this direction to find the maximum of the local gradient mode; zero-crossing based methods find the zero-crossing points of the second derivative derived from the image to locate the edges, typically using the laplace operator or the zero-crossing points of a non-linear differential equation.
The Sobel edge detection algorithm is used for illustration, is simple, is preferred in many practical application occasions, and particularly has a high requirement on efficiency, is directional and can only detect vertical edges or both; the Sobel edge detection result can well describe the image by lines, and the area with higher contrast in the source image is represented as a high-gray pixel in the result image, namely the source image is simply subjected to 'edge tracing'.
And step 304, carrying out segmentation processing on the edge line to obtain the edge line to be processed.
After the terminal obtains the edge line of the gray image, the edge line is segmented, namely the edge line is divided into a plurality of small sections, the gray values of the areas corresponding to the two sides of each small section are compared, the small sections corresponding to the areas with smaller gray value differences are deleted, and the small sections which are not removed are finally reserved to form the edge line to be processed.
Specifically, the method of step 304 may specifically include the following:
the terminal determines the current starting point of the edge line;
the terminal obtains a current tangent line at a current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length; the preset length may be a preset proportion of the current image length, and the preset proportion may be set according to actual requirements, and is not limited herein.
The terminal takes a current tangent line as an axis, a current preset area is formed on each of two sides of the current tangent line, the length of the current preset area is a preset length, and the width of the preset area is a preset width; the preset width may be a preset proportion of the width of the current image, and is the same as the preset proportion of the length of the current image.
The terminal calculates to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculates to obtain a current absolute value of a difference value between the current first average value and the current second average value;
the terminal judges whether the current absolute value is smaller than a preset average threshold value or not; the preset average threshold may be set according to actual requirements, and is not limited herein.
When the current absolute value is smaller than the preset average threshold value, the terminal deletes the edge line in the current preset area; when the current absolute value is larger than or equal to the preset average threshold value, reserving the edge line in the current preset area;
the terminal judges whether an interaction point exists between the edge line and the edge of the current preset area;
when the edge line and the edge of the current preset area have the interaction points, the terminal determines the interaction points as a next starting point, and if the edge line and the edge of the current preset area have at least two interaction points, the point closest to the current tangent line is determined as the next starting point; and processing the next starting point to form a tangent line and an edge line in the preset area.
And the terminal determines the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and takes the undeleted part as the edge line to be processed.
It should be noted that, in step 304, only one edge line is processed to describe, there may be a plurality of edge lines on the gray scale map, but when each edge line is processed, the processing method is the same, so that other edge line processing methods may refer to the detailed description in step 304, and are not described herein again.
And step 305, when any one end of two ends of the edge line to be processed is on any one of the four boundaries of the gray-scale image, determining the edge line to be processed as a first GND filter boundary line.
When the terminal determines that any one of two ends of the edge line to be processed is on any one of four boundaries of the gray scale image, determining the edge line to be processed as a boundary line of the first GND filter; wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary; here, the two ends of the edge line can be regarded as two ends of the edge line, one end being a starting point and the other end being an end point.
That is, when the terminal determines that any one of the two ends of the edge line to be processed is on any one of the upper boundary, the lower boundary, the left boundary, and the right boundary in the grayscale image, the edge line to be processed is determined as the first GND filter boundary line.
Step 306, the first GND filter boundary is presented on the current image.
The terminal presents the first GND filter boundary obtained in step 305 on the current image, that is, the terminal automatically presents the GND filter boundary on the current image for the user to use; compared with a simple straight line in the prior art, the method can well balance the picture, reduce the condition that partial picture is too dark or too bright, avoid the condition of cutting once, and improve the shooting effect.
According to the method for presenting the boundary of the GND filter, provided by the embodiment of the invention, when the terminal is started in the GND filter boundary mode, the current image is acquired; obtaining a gray scale image of a current image when a boundary mode of the GND filter is automatically presented and started; obtaining an edge line of the gray scale image according to the gray scale image; carrying out segmentation processing on the edge line to obtain an edge line to be processed; when any one end of two ends of the edge line to be processed is on any one of four boundaries of the gray scale image, determining the edge line to be processed as a boundary line of the first GND filter; presenting a first GND filter boundary on the current image; by the scheme provided by the embodiment of the invention, the positions on the image which need the GND filter boundary and the positions which do not need the GND filter boundary can be determined, and the GND filter boundary is automatically wired according to the actual form on the image, so that the situation of one-time cutting is avoided, the picture can be well balanced, the situation that part of the picture is too dark or too bright is reduced, and the shooting effect is improved.
To further illustrate the object of the present invention, the above embodiments are further illustrated.
Example two
Fig. 4a is a flowchart of a second method for presenting a boundary of a GND filter according to an embodiment of the present invention, where the method for presenting a boundary of a GND filter provided in an embodiment of the present invention is applied to a smart phone, and a camera on the smart phone is provided with GND, as shown in fig. 4a, the method may include the following steps:
and step 401a, judging whether the GND filter demarcation mode is started.
The smart phone judges whether a GND filter demarcation line mode is started or not, and if the GND filter demarcation line mode is not started, the step 402a is executed; if the GND filter boundary mode is on, step 403a is performed.
Step 402a, ending the processing task.
And the smart phone finishes the current processing task and executes the current processing task according to the current task.
Step 403a, acquiring a current image.
The smart phone acquires a current image.
And step 404a, judging whether the mode for automatically presenting the GND filter demarcation line is started.
The smart phone judges whether the mode for automatically presenting the boundary of the GND filter is started, and if the mode for automatically presenting the boundary of the GND filter is not started, the step 405a is executed; if the mode of automatically presenting the boundary of the GND filter is turned on, the steps related to automatically presenting the boundary of the GND filter are executed, and reference may be specifically made to the third embodiment shown in fig. 4b below.
And step 405a, starting a manual display GND filter demarcation mode.
Step 406a, presenting the current image.
The smart phone presents a current image on a current screen.
Step 407a, acquiring a continuous line segment input on the current image.
The smart phone acquires a continuous line segment input by a user on a current image through a finger or a touch body.
And step 408a, judging whether any one of two ends of the continuous line segment is on any one of the four boundaries of the current image.
The smart phone judges whether any one of two ends of the continuous line segment is on any one of four boundaries of the current image, and if the any one of the two ends of the continuous line segment is not on any one of the four boundaries of the current image, the step 409a is executed; if any one of the two ends of the continuous line segment is on any one of the four boundaries of the current image, executing step 410 a; here, two ends of the continuous line segment can be regarded as two ends of the continuous line segment, one end being a starting point and the other end being an end point.
Step 409a, return to execute step 407 a.
The smartphone returns to continue with step 407 a.
Step 410a, the continuous line segment is determined as a second GND filter boundary.
And the smart phone determines the continuous line segment as a boundary of the second GND filter.
Step 411a presents the second GND filter boundary on the current image.
The smart phone presents a second GND filter boundary on the current image for use and reference by the user.
Step 412a, provide the level option of the GND filter.
The smart phone can provide a grade option of the GND filter for a user in one corner of a current image, wherein the grade option of the GND filter can be set in advance according to the performance and parameters of the GND filter; for example, the gradation of the GND filter may be set to 2, 4, 8, 16, and 32.
And step 413a, processing the current image according to the determined level of the GND filter.
The smart phone processes the current image according to the determined grade of the GND filter; for example, assuming that the shutter speed of the normal exposure is T when the smartphone is not added with the GND filter, after the GND filter is added, under the same light conditions, aperture size and sensitivity setting, the shutter speed of the normal exposure is T × x, where x is the grade of the GND filter, if the grade of the GND filter is 4, x is 4, and if the grade of the GND filter is 8, x is 8; thus, after an original 1/30 second "correct" exposure time image was shaded at level 2 with a GND filter, the "correct" exposure time now became 1/15 seconds; correspondingly, the brightness is only 1/2.
And step 414a, presenting the processed current image.
And the smart phone presents the processed current image for the user to use and refer to.
According to the method for presenting the boundary of the GND filter, provided by the embodiment of the invention, the current image is acquired when the boundary mode of the GND filter is started by judging whether the boundary mode of the GND filter is started or not; judging whether the mode for automatically presenting the boundary of the GND filter is started or not, and starting the mode for manually presenting the boundary of the GND filter when the mode for automatically presenting the boundary of the GND filter is not started; presenting a current image; acquiring a continuous line segment input on a current image; judging whether any one of two ends of the continuous line segment is on any one of four boundaries of the current image; determining the continuous line segment as a boundary of the second GND filter when any one of two ends of the continuous line segment is on any one of four boundaries of the current image; presenting a second GND filter boundary on the current image; providing a level option for the GND filter; processing the current image according to the determined grade of the GND filter; and presenting the processed current image. By the scheme of the embodiment of the invention, the picture can be well balanced according to the boundary of the GND filter actively input by a user, the situation of one-time cutting is avoided, the situation that part of the picture is too dark or too bright is reduced, and the shooting effect is improved; in addition, the function of providing the grade option of the GND filter is added, so that the shooting effect can be further improved.
EXAMPLE III
Fig. 4b is a flowchart of a third method for presenting a boundary of a GND filter according to an embodiment of the present invention, where the method for presenting a boundary of a GND filter provided in an embodiment of the present invention is applied to a smart phone, and a camera on the smart phone is provided with a GND filter, as shown in fig. 4b, the method may include the following steps:
and step 401b, judging whether the GND filter demarcation line mode is started.
The smart phone judges whether the GND filter demarcation line mode is started or not, and if the GND filter demarcation line mode is not started, the step 402b is executed; if the GND filter boundary mode is on, step 403b is performed.
And step 402b, ending the processing task.
And the smart phone finishes the current processing task and executes the current processing task according to the current task.
And step 403b, acquiring a current image.
The smart phone acquires a current image.
And step 404b, judging whether the mode for automatically presenting the GND filter boundary line is started.
The smart phone judges whether the mode for automatically presenting the boundary of the GND filter is started, and if the mode for automatically presenting the boundary of the GND filter is started, the step 405b is executed; if the mode for automatically presenting the GND filter boundary is not turned on, the steps related to manually presenting the GND filter boundary are performed, which can be referred to as the second embodiment shown in fig. 4 a.
And step 405b, obtaining a gray scale map of the current image.
After the smart phone acquires the current image, the gray value of each pixel in the current image is calculated, and the gray image of the current image is obtained according to the gray value of each pixel.
And 406b, obtaining an edge line of the gray-scale image by using an edge detection technology.
The smart phone obtains an edge line of the gray scale image by using an edge detection technology; specifically, the detailed description in step 303 can be referred to for the description of the edge detection technique, which is not repeated herein.
And step 407b, determining the current starting point of the edge line.
After the smart phone obtains the edge line, the current starting point of the edge line is determined, if the edge line is a closed line, the edge line can be randomly broken, and the broken point is used as the current starting point.
And step 408b, obtaining the current tangent line at the current starting point.
The smart phone obtains a current tangent line at a current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length; the preset length may be a preset proportion of the current image length, and the preset proportion may be set according to actual requirements, and is not limited herein.
And 409b, taking the current tangent line as an axis, and forming a current preset area on each of two sides of the current tangent line.
The smart phone takes a current tangent line as an axis, and a current preset area is formed on each of two sides of the current tangent line, wherein the length of the current preset area is a preset length, and the width of the preset area is a preset width; the preset width may be a preset proportion of the width of the current image, and is the same as the preset proportion of the length of the current image.
And step 410b, calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of the difference value between the current first average value and the current second average value.
The smart phone calculates a current first average value of the gray values in 1/2 current preset regions on one side and a current second average value of the gray values in 1/2 current preset regions on the other side, and calculates a current absolute value of a difference value between the current first average value and the current second average value.
Step 411b, determining whether the current absolute value is smaller than a preset average threshold.
The smart phone judges whether the current absolute value is smaller than a preset average threshold value, and if the current absolute value is smaller than the preset average threshold value, the step 412b is executed; if the current absolute value is not less than the preset average threshold, go to step 413 b; the preset average threshold may be set according to actual requirements, and is not limited herein.
For example, fig. 5 is a schematic diagram of processing edge lines according to a third embodiment of the method for presenting boundaries of the GND filter, and in order to further show the contents of steps 407b to 411b, as shown in fig. 5, the preset length of the preset region is set to 10% of the length of the current image, and the preset width is set to 10% of the width of the current image; if the precision is more accurate, the proportion can be reduced, so that the acquisition range is reduced, and the precision is increased, for example, the preset length can be set to be 5% of the current image length, and the preset width can be set to be 5% of the current image width.
And step 412b, deleting the edge lines in the current preset area.
And when the current absolute value is smaller than the preset average threshold value, the smart phone deletes the edge line in the current preset area.
And step 413b, reserving the edge line in the current preset area.
And when the current absolute value is not less than the preset average threshold value, the smart phone keeps the edge line in the current preset area.
And step 414b, judging whether the edge line and the edge of the current preset area have an interaction point.
The smart phone judges whether an interaction point exists on the edge line and the edge of the current preset area, and if the interaction point exists on the edge line and the edge of the current preset area, step 415b is executed; if there is no interaction point between the edge line and the edge of the current default region, go to step 416 b.
Step 415b, determining the interaction point as the next starting point, and returning to step 407 b.
When the edge line and the edge of the current preset area have interaction points, the smart phone determines the interaction points as a next starting point, and if the edge line and the edge of the current preset area have at least two interaction points, the smart phone determines a point closest to the current tangent line as the next starting point; thereafter, the next starting point is set as the current starting point, and the loop is executed from step 407b to step 414 b.
And step 416b, determining the undeleted part in the edge line, and taking the undeleted part as the edge line to be processed.
When the edge line and the edge of the current preset area have no interactive point, the smart phone determines the undeleted part in the edge line, and takes the undeleted part as the edge line to be processed.
And step 417b, when any one of two ends of the edge line to be processed is on any one of the four boundaries of the gray-scale map, determining the edge line to be processed as a first GND filter boundary line.
When the smart phone determines that any one of two ends of the edge line to be processed is on any one of four boundaries of the gray scale image, determining the edge line to be processed as a boundary line of a first GND filter; wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary; here, the two ends of the edge line to be processed can be regarded as two ends of the edge line to be processed, one end is a starting point, and the other end is an end point.
Step 418b, the first GND filter boundary is rendered on the current image.
The smart phone presents the obtained first GND filter boundary on the current image, namely the smart phone automatically presents the GND filter boundary on the current image for the user to use and reference.
Fig. 6 is a schematic diagram of a boundary of a conventional GND filter, according to a third embodiment of the present invention, where as shown in fig. 6, the boundary of the GND filter shown in the current image is a straight line, which may result in a situation of cutting, and thus the image cannot be well balanced; fig. 7 is a schematic diagram of automatically presenting a boundary of a GND filter according to a third embodiment of a method for presenting a boundary of a GND filter of the present invention, and as shown in fig. 7, by using the method for automatically presenting a boundary of a GND filter provided in the embodiment of the present invention, it can be determined which places on an image need the boundary of a GND filter and which places do not need the boundary of a GND filter, and the boundary of a GND filter is wired according to an actual form on the image, so that a situation of cutting with one knife is avoided, a picture can be well balanced, a situation of over-dark or over-bright of a part of the picture is reduced, and a shooting effect is improved.
Step 419b, provide the grade option of the GND filter.
The smart phone can provide a grade option of the GND filter for a user in one corner of a current image, wherein the grade option of the GND filter can be set in advance according to the performance and parameters of the GND filter; for a specific example, refer to the content in step 412a, which is not described herein.
And step 420b, processing the current image according to the determined grade of the GND filter.
The smart phone processes the current image according to the determined grade of the GND filter; for a specific example, refer to the content in step 413a, which is not described herein.
And step 421b, presenting the processed current image.
And the smart phone presents the processed current image for the user to use and refer to.
According to the method for presenting the boundary of the GND filter, provided by the embodiment of the invention, the current image is acquired when the boundary mode of the GND filter is started by judging whether the boundary mode of the GND filter is started or not; judging whether the mode for automatically presenting the boundary of the GND filter is started or not, and obtaining a gray scale image of the current image when the mode for automatically presenting the boundary of the GND filter is started; obtaining an edge line of the gray scale image by using an edge detection technology; determining the current starting point of the edge line; obtaining a current tangent line at a current starting point; taking the current tangent line as an axis, and forming a current preset area on each of two sides of the current tangent line; calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value; judging whether the current absolute value is smaller than a preset average threshold value or not; deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value, and keeping the edge line in the current preset area when the current absolute value is not smaller than the preset average threshold value; judging whether the edge line and the edge of the current preset area have an interaction point or not; when the edge line and the edge of the current preset area have the interactive point, determining the interactive point as a next starting point, continuing processing until the edge line and the edge of the current preset area have no interactive point, determining an undeleted part in the edge line, and taking the undeleted part as the edge line to be processed; when any one end of two ends of the edge line to be processed is on any one of four boundaries of the gray scale image, determining the edge line to be processed as a boundary line of the first GND filter; presenting a first GND filter boundary on the current image; providing a level option for the GND filter; processing the current image according to the determined grade of the GND filter; presenting the processed current image; by the scheme provided by the embodiment of the invention, the positions on the image which need the GND filter boundary and do not need the GND filter boundary can be determined, and the GND filter boundary can be automatically wired according to the actual form on the image, so that the situation of one-time cutting is avoided, the picture can be well balanced, the situation that part of the picture is too dark or too bright is reduced, and the shooting effect is improved; in addition, the function of providing the grade option of the GND filter is added, so that the shooting effect can be further improved.
Example four
Fig. 8 is a schematic structural diagram of an embodiment of the device for presenting boundary of GND filter in the present invention, and as shown in fig. 8, the device 08 for presenting boundary of GND filter in the present invention includes:
the obtaining module 81 is used for obtaining a current image when the boundary mode of the medium-gray gradient filter GND filter is started;
the calculation module 82 is used for obtaining a gray scale image of the current image when the mode of automatically presenting the GND filter boundary is started;
the processing module 83 is configured to obtain an edge line of the grayscale image according to the grayscale image;
the processing module 83 is further configured to perform segmentation processing on the edge line to obtain a to-be-processed edge line;
a determining module 84, configured to determine the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, where the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
a rendering module 85, configured to render the first GND filter boundary on the current image.
Further, the apparatus further comprises:
a judging module 86, configured to judge whether the mode for automatically presenting the GND filter boundary is turned on;
the starting module 87 is used for starting the manual display GND filter demarcation mode when the automatic display GND filter demarcation mode is not started;
the presenting module 85 is further configured to present the current image when the GND filter demarcation line mode is manually presented and turned on;
the determining module 86 is further configured to determine whether any one of two ends of the continuous line segment input on the current image is on any one of four boundaries of the current image;
the determining module 84 is further configured to determine a continuous line segment input on the current image as a second GND filter boundary line when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
the rendering module 85 is further configured to render the second GND filter boundary on the current image.
Further, the processing module 83 is specifically configured to determine a current starting point of the edge line;
the processing module 83 is further specifically configured to obtain a current tangent line at the current starting point, where the direction of the current tangent line is along the direction of the edge line, and the length of the current tangent line is a preset length;
the processing module 83 is further specifically configured to form a current preset region on each of two sides of the current tangent line by taking the current tangent line as an axis, where a length of the current preset region is the preset length, and a width of the preset region is a preset width;
the processing module 83 is further specifically configured to calculate a current first average value of the gray values in the 1/2 current preset region on one side and a current second average value of the gray values in the 1/2 current preset region on the other side, and calculate a current absolute value of a difference between the current first average value and the current second average value;
the processing module 83 is further specifically configured to determine whether the current absolute value is smaller than the preset average threshold;
the processing module 83 is further specifically configured to delete the edge line in the current preset area when the current absolute value is smaller than the preset average threshold; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
the processing module 83 is further specifically configured to determine whether there is an interaction point on the edge of the edge line and the current preset region;
the processing module 83 is further specifically configured to determine, when there are interaction points on the edge line and the edge of the current preset region, the interaction point as a next starting point, and if there are at least two interaction points on the edge line and the edge of the current preset region, determine, as the next starting point, a point closest to the current tangent line;
the processing module 83 is further specifically configured to determine an undeleted portion of the edge line until there is no point where the edge line and the edge of the current preset area interact with each other, and use the undeleted portion as the edge line to be processed.
Further, the apparatus further comprises:
a providing module 88 for providing a grade option of the GND filter;
the processing module 83 is further configured to process the current image according to the determined level of the GND filter;
the presenting module 85 is further configured to present the processed current image.
Further, the processing module 83 is specifically configured to calculate an edge line of the gray scale image by using a Sobel edge detection algorithm.
The apparatus of this embodiment may be configured to implement the technical solutions of the above-described method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In practical applications, the obtaining module 81, the calculating module 82, the Processing module 83, the determining module 84, the presenting module 85, the judging module 86, the starting module 87, and the providing module 88 may be implemented by a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like, which is located in the device 08 for presenting the boundary of the GND filter.
EXAMPLE five
Fig. 9 is a schematic structural diagram of an embodiment of the device for presenting boundary of GND filter in the present invention, and as shown in fig. 9, the device 09 for presenting boundary of GND filter in the present invention includes: an interface 91, a processor 92, a memory 93, and a communication bus 94;
wherein, the communication bus 94 is used for realizing the connection communication among the interface 91, the processor 92 and the memory 93;
the processor 92 is configured to execute the program for presenting the boundary of the GND filter stored in the memory 93, so as to implement the following steps:
when a boundary line mode of a GND filter of the medium-gray gradient filter is started, acquiring a current image;
when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of the current image;
obtaining an edge line of the gray scale image according to the gray scale image;
carrying out segmentation processing on the edge line to obtain an edge line to be processed;
determining the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
presenting the first GND filter boundary on the current image.
Further, the processor 92 is further configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
judging whether the mode for automatically presenting the boundary line of the GND filter is started or not;
when the mode for automatically presenting the GND filter boundary line is not started, starting a mode for manually presenting the GND filter boundary line;
when a mode of manually presenting the GND filter demarcation line is started, presenting the current image;
judging whether any one of two ends of a continuous line segment input on the current image is on any one of four boundaries of the current image;
determining a continuous line segment input on the current image as a second GND filter boundary when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
presenting the second GND filter boundary on the current image.
Further, the processor 92 is configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
determining the current starting point of the edge line;
obtaining a current tangent line on the current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length;
taking the current tangent line as an axis, forming a current preset area on each of two sides of the current tangent line, wherein the length of the current preset area is the preset length, and the width of the preset area is the preset width;
calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value;
judging whether the current absolute value is smaller than the preset average threshold value or not;
deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
judging whether the edge line and the edge of the current preset area have an interaction point or not;
determining the interaction point as a next starting point when the edge line and the edge of the current preset area have the interaction point, and determining a point closest to the current tangent line as the next starting point when the edge line and the edge of the current preset area have at least two interaction points;
and determining the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and taking the undeleted part as the edge line to be processed.
Further, the processor 92 is further configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
providing a level option for the GND filter;
processing the current image according to the determined grade of the GND filter;
presenting the processed current image.
Further, the processor 92 is configured to execute the program for presenting the boundary of the GND filter, so as to implement the following steps:
and calculating by using a Sobel edge detection algorithm to obtain an edge line of the gray scale image.
As shown in fig. 9, the device 09 presenting the boundary of the GND filter may be a mobile phone, a computer, a digital broadcast terminal, an information transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.; it will be appreciated that the communication bus 94 includes a power bus, a control bus, and a status signal bus in addition to a data bus, but for clarity of illustration, the various buses are labeled as communication bus 94 in fig. 9.
The interface 91 may include a display, a keyboard, a mouse, a track ball, a click wheel, a button, a touch pad, a touch screen, or the like; the interface 91 may also receive and transmit various signals that can be supported, such as control signals, data signals, status signals, and the like.
It will be appreciated that the memory 93 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory; among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage; volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous link Dynamic Random Access Memory (DRAM, Synchronous Dynamic Random Access Memory), Direct Memory (DRmb Random Access Memory, Random Access Memory); the memory 93 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 93 in the embodiment of the present invention is used to store various types of data to support the operation of the device 09 that presents the boundary of the GND filter; examples of such data include: any computer program for operating on the device 09 that presents the GND filter boundary, such as operating systems and applications, contact data, phonebook data, messages, pictures, videos, etc.; the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks; the application programs may include various application programs such as a media player (MediaPlayer), a Browser (Browser), etc. for implementing various application services; the program for implementing the method of the embodiment of the present invention may be included in the application program.
The method disclosed by the above embodiment of the present invention may be applied to the processor 92, or implemented by the processor 92; the processor 92 may be an integrated circuit chip having signal processing capabilities; in implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 92; the Processor 92 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.; processor 92 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention; a general purpose processor may be a microprocessor or any conventional processor or the like; the steps of the method disclosed by the embodiment of the invention can be directly embodied as the execution of a hardware decoding processor, or the combination of hardware and software modules in the decoding processor; the software modules may be located in a storage medium located in memory 93, and processor 92 reads the information in memory 93 and performs the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the Device 09 that presents a GND filter boundary may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the foregoing methods.
The device of this embodiment may be configured to implement the technical solutions of the above-described method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
EXAMPLE six
The invention also provides a computer readable storage medium, which can be a Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk or CD-ROM; or various devices including one or any combination of the above memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.; the computer readable storage medium stores one or more programs, which are executable by one or more processors, to implement the steps of:
when a boundary line mode of a GND filter of the medium-gray gradient filter is started, acquiring a current image;
when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of the current image;
obtaining an edge line of the gray scale image according to the gray scale image;
carrying out segmentation processing on the edge line to obtain an edge line to be processed;
determining the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
presenting the first GND filter boundary on the current image.
Further, the one or more programs are also executable by the one or more processors to perform the steps of:
judging whether the mode for automatically presenting the boundary line of the GND filter is started or not;
when the mode for automatically presenting the GND filter boundary line is not started, starting a mode for manually presenting the GND filter boundary line;
when a mode of manually presenting the GND filter demarcation line is started, presenting the current image;
judging whether any one of two ends of a continuous line segment input on the current image is on any one of four boundaries of the current image;
determining a continuous line segment input on the current image as a second GND filter boundary when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
presenting the second GND filter boundary on the current image.
Further, the one or more programs are executable by the one or more processors to implement the steps of:
determining the current starting point of the edge line;
obtaining a current tangent line on the current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length;
taking the current tangent line as an axis, forming a current preset area on each of two sides of the current tangent line, wherein the length of the current preset area is the preset length, and the width of the preset area is the preset width;
calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value;
judging whether the current absolute value is smaller than the preset average threshold value or not;
deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
judging whether the edge line and the edge of the current preset area have an interaction point or not;
determining the interaction point as a next starting point when the edge line and the edge of the current preset area have the interaction point, and determining a point closest to the current tangent line as the next starting point when the edge line and the edge of the current preset area have at least two interaction points;
and determining the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and taking the undeleted part as the edge line to be processed.
Further, the one or more programs are also executable by the one or more processors to perform the steps of:
providing a level option for the GND filter;
processing the current image according to the determined grade of the GND filter;
presenting the processed current image.
Further, the one or more programs are executable by the one or more processors to implement the steps of:
and calculating by using a Sobel edge detection algorithm to obtain an edge line of the gray scale image.
The computer-readable storage medium of this embodiment may be used to implement the technical solutions of the above-mentioned method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
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.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
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 invention 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 invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method of presenting a mid-gray graded filter GND filter boundary line, the method comprising:
when a boundary line mode of a GND filter of the medium-gray gradient filter is started, acquiring a current image;
when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of the current image;
obtaining an edge line of the gray scale image according to the gray scale image;
dividing the edge line into a plurality of small sections, and deleting the small sections with the gray value difference smaller than a preset threshold value to form the edge line to be processed; the gray value difference is the gray value difference of the areas corresponding to the two sides of each small section respectively;
determining the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
presenting the first GND filter boundary on the current image.
2. The method of claim 1, wherein after said acquiring a current image, the method further comprises:
judging whether the mode for automatically presenting the boundary line of the GND filter is started or not;
when the mode for automatically presenting the GND filter boundary line is not started, starting a mode for manually presenting the GND filter boundary line;
when a mode of manually presenting the GND filter demarcation line is started, presenting the current image;
judging whether any one of two ends of a continuous line segment input on the current image is on any one of four boundaries of the current image;
determining a continuous line segment input on the current image as a second GND filter boundary when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
presenting the second GND filter boundary on the current image.
3. The method of claim 1, wherein the dividing the edge line into a plurality of segments, and deleting the segments with the gray value difference smaller than a preset threshold to form the edge line to be processed comprises:
determining the current starting point of the edge line;
obtaining a current tangent line on the current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length;
taking the current tangent line as an axis, forming a current preset area on each of two sides of the current tangent line, wherein the length of the current preset area is the preset length, and the width of the preset area is the preset width;
calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value;
judging whether the current absolute value is smaller than the preset average threshold value or not;
deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
judging whether the edge line and the edge of the current preset area have an interaction point or not;
determining the interaction point as a next starting point when the edge line and the edge of the current preset area have the interaction point, and determining a point closest to the current tangent line as the next starting point when the edge line and the edge of the current preset area have at least two interaction points;
and determining the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and taking the undeleted part as the edge line to be processed.
4. The method according to claim 1, characterized in that after presenting the first GND filter dividing line on the current image, the method further comprises:
providing a level option for the GND filter;
processing the current image according to the determined grade of the GND filter;
presenting the processed current image.
5. The method of claim 1, wherein obtaining the edge line of the gray scale map according to the gray scale map comprises:
and calculating by using a Sobel edge detection algorithm to obtain an edge line of the gray scale image.
6. A device for presenting a mid-gray graded filter GND filter dividing line, characterized in that it comprises: an interface, a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication among the interface, the processor and the memory;
the processor is used for executing the program which is stored in the memory and used for presenting the boundary line of the GND filter so as to realize the following steps:
when a boundary line mode of a GND filter of the medium-gray gradient filter is started, acquiring a current image;
when the mode of automatically presenting the boundary line of the GND filter is started, obtaining a gray scale image of the current image;
obtaining an edge line of the gray scale image according to the gray scale image;
dividing the edge line into a plurality of small sections, and deleting the small sections with the gray value difference smaller than a preset threshold value to form the edge line to be processed; the gray value difference is the gray value difference of the areas corresponding to the two sides of each small section respectively;
determining the edge line to be processed as a first GND filter boundary line when any one of two ends of the edge line to be processed is on any one of four boundaries of the grayscale map, wherein the four boundaries include: an upper boundary, a lower boundary, a left boundary, and a right boundary;
presenting the first GND filter boundary on the current image.
7. The device of claim 6, wherein the processor is further configured to execute the program for rendering the boundary of the GND filter to perform the steps of:
judging whether the mode for automatically presenting the boundary line of the GND filter is started or not;
when the mode for automatically presenting the GND filter boundary line is not started, starting a mode for manually presenting the GND filter boundary line;
when a mode of manually presenting the GND filter demarcation line is started, presenting the current image;
judging whether any one of two ends of a continuous line segment input on the current image is on any one of four boundaries of the current image;
determining a continuous line segment input on the current image as a second GND filter boundary when any one of two ends of the continuous line segment is on any one of four boundaries of the current image;
presenting the second GND filter boundary on the current image.
8. The apparatus of claim 6, wherein the processor is configured to execute the program for rendering the boundary of the GND filter to implement the steps of:
determining the current starting point of the edge line;
obtaining a current tangent line on the current starting point, wherein the direction of the current tangent line is along the trend direction of the edge line, and the length of the current tangent line is a preset length;
taking the current tangent line as an axis, and forming a current preset area on each of two sides of the current tangent line, wherein the length of the current preset area is a preset length, and the width of the preset area is a preset width;
calculating to obtain a current first average value of the gray values in the current preset area of 1/2 on one side and a current second average value of the gray values in the current preset area of 1/2 on the other side, and calculating to obtain a current absolute value of a difference value between the current first average value and the current second average value;
judging whether the current absolute value is smaller than the preset average threshold value or not;
deleting the edge line in the current preset area when the current absolute value is smaller than the preset average threshold value; when the current absolute value is greater than or equal to the preset average threshold value, reserving the edge line in the current preset area;
judging whether the edge line and the edge of the current preset area have an interaction point or not;
determining the interaction point as a next starting point when the edge line and the edge of the current preset area have the interaction point, and determining a point closest to the current tangent line as the next starting point when the edge line and the edge of the current preset area have at least two interaction points;
and determining the undeleted part in the edge line until no point is interacted between the edge line and the edge of the current preset area, and taking the undeleted part as the edge line to be processed.
9. The device of claim 6, wherein the processor is further configured to execute the program for rendering the boundary of the GND filter to perform the steps of:
providing a level option for the GND filter;
processing the current image according to the determined grade of the GND filter;
presenting the processed current image.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more programs which are executable by one or more processors to implement the steps of the method of presenting GND filter boundaries according to any of claims 1 to 5.
CN201710914736.3A 2017-09-30 2017-09-30 Method, apparatus and computer-readable storage medium for presenting GND filter boundary Active CN107590792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710914736.3A CN107590792B (en) 2017-09-30 2017-09-30 Method, apparatus and computer-readable storage medium for presenting GND filter boundary

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710914736.3A CN107590792B (en) 2017-09-30 2017-09-30 Method, apparatus and computer-readable storage medium for presenting GND filter boundary

Publications (2)

Publication Number Publication Date
CN107590792A CN107590792A (en) 2018-01-16
CN107590792B true CN107590792B (en) 2020-09-01

Family

ID=61052390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710914736.3A Active CN107590792B (en) 2017-09-30 2017-09-30 Method, apparatus and computer-readable storage medium for presenting GND filter boundary

Country Status (1)

Country Link
CN (1) CN107590792B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227865A (en) * 2015-10-29 2016-01-06 努比亚技术有限公司 A kind of image processing method and terminal
US9313375B1 (en) * 2014-06-03 2016-04-12 Amazon Technologies, Inc. Software-implemented graduated neutral density filter for balancing exposure of a photograph

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129681B (en) * 2011-02-28 2013-05-29 太原理工大学 Method for shot boundary detection
US9215345B2 (en) * 2013-03-26 2015-12-15 Xerox Corporation Method and system for inverse halftoning utilizing inverse projection of predicted errors
CN105245789B (en) * 2015-10-13 2019-10-18 浙江宇视科技有限公司 A kind of strong Xanthophyll cycle method based on gradual change gray scale mirror

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9313375B1 (en) * 2014-06-03 2016-04-12 Amazon Technologies, Inc. Software-implemented graduated neutral density filter for balancing exposure of a photograph
CN105227865A (en) * 2015-10-29 2016-01-06 努比亚技术有限公司 A kind of image processing method and terminal

Also Published As

Publication number Publication date
CN107590792A (en) 2018-01-16

Similar Documents

Publication Publication Date Title
US10497097B2 (en) Image processing method and device, computer readable storage medium and electronic device
CN107767333B (en) Method and equipment for beautifying and photographing and computer storage medium
CN108024065B (en) Terminal shooting method, terminal and computer readable storage medium
CN110035176B (en) Brightness adjusting method of mobile terminal, mobile terminal and storage medium
CN108459799B (en) Picture processing method, mobile terminal and computer readable storage medium
CN109471571B (en) Display method of suspension control, mobile terminal and computer readable storage medium
CN108198150B (en) Method for eliminating image dead pixel, terminal and storage medium
CN107172349B (en) Mobile terminal shooting method, mobile terminal and computer readable storage medium
CN109361874B (en) Photographing method and terminal
CN108182668B (en) Amplified image processing method, terminal and computer readable storage medium
CN110069122B (en) Screen control method, terminal and computer readable storage medium
CN113222850A (en) Image processing method, device and computer readable storage medium
CN113393398A (en) Image noise reduction processing method and device and computer readable storage medium
CN112598678A (en) Image processing method, terminal and computer readable storage medium
CN113421211A (en) Method for blurring light spots, terminal device and storage medium
CN108198195B (en) Focusing method, terminal and computer readable storage medium
CN107590792B (en) Method, apparatus and computer-readable storage medium for presenting GND filter boundary
CN107743204B (en) Exposure processing method, terminal, and computer-readable storage medium
CN112532838B (en) Image processing method, mobile terminal and computer storage medium
CN112532786B (en) Image display method, terminal device, and storage medium
CN114092366A (en) Image processing method, mobile terminal and storage medium
CN110456969B (en) Long screenshot implementation method, terminal and computer readable storage medium
CN110084764B (en) Image noise reduction processing method, mobile terminal, device and computer storage medium
CN113473029A (en) Lightning image shooting method and device and computer readable storage medium
CN108335301B (en) Photographing method and mobile terminal

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