WO2019174606A1 - Image processing method and terminal - Google Patents
Image processing method and terminal Download PDFInfo
- Publication number
- WO2019174606A1 WO2019174606A1 PCT/CN2019/078069 CN2019078069W WO2019174606A1 WO 2019174606 A1 WO2019174606 A1 WO 2019174606A1 CN 2019078069 W CN2019078069 W CN 2019078069W WO 2019174606 A1 WO2019174606 A1 WO 2019174606A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image data
- image
- session
- area
- user
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/82—Protecting input, output or interconnection devices
- G06F21/84—Protecting input, output or interconnection devices output devices, e.g. displays or monitors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
Definitions
- the present disclosure relates to the technical field of computer processing, and in particular to an image processing method and terminal.
- mobile terminals such as mobile phones and tablet computers are increasingly used in people's work, study, and daily communication.
- users In order to communicate using a mobile terminal, users often install communication tools in these mobile terminals to open a conversation window with other users in the installed communication tool and communicate with other users in the conversation window. In some scenarios, users will share session records in the session window when communicating with other users to facilitate other users to understand the content of the session or to obtain relevant information.
- the user usually first intercepts the screen of the session window to save the image data, and then enables a special image editing tool to smear the private information recorded in the image data, and then share the processed image data.
- an image processing method including:
- the session interface includes a session between users.
- a terminal comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor configured to run the computer program to Said terminal implementation:
- the session interface includes a session between users, and the sensitive information includes user information.
- a computer readable nonvolatile storage medium storing a computer program, wherein the computer program is executed by a processor, implements the image processing method described above.
- FIG. 1 is a schematic structural diagram of hardware of a mobile phone according to some embodiments of the present disclosure
- FIG. 2 is a flow chart of steps of an image processing method according to some embodiments of the present disclosure.
- 3A to 3H are diagrams showing an example of performing an image processing method provided by some embodiments of the present disclosure on a mobile terminal
- FIG. 4 is a structural block diagram of an image processing apparatus according to some embodiments of the present disclosure.
- the image processing method provided by some embodiments of the present disclosure may be applied to a mobile terminal, such as a mobile phone, a tablet computer, a smart wearable device (such as a smart watch, smart glasses), and the like; or may be applied to a non-mobile terminal, such as a personal computer.
- a mobile terminal such as a mobile phone, a tablet computer, a smart wearable device (such as a smart watch, smart glasses), and the like
- a non-mobile terminal such as a personal computer.
- the smart television, and the like, the embodiment of the present disclosure does not limit this.
- the operating systems of these mobile terminals and non-mobile terminals include Android (Android), IOS, and Windows Phone.
- Android Android
- IOS IOS
- Windows Phone applications that support communication are usually run, for example, instant messaging tools, email clients, microblog applications, forums. Application, etc.
- the user initiates a session interface in an instant messaging tool, a mailbox client, a microblog, a forum, etc., to engage with friends, non-friends, strangers, group users, etc., and form a session record.
- the session interface is typically in the form of a session window.
- the session window usually includes private information such as a group avatar, a group name, a user name, and a user avatar.
- the image including the session window can be protected by privacy, for example, smearing, covering, obscuring, and hollowing out.
- the privacy information is processed in a manner to protect the user's private information.
- the following is a mobile phone as an example to illustrate how the terminal implements the technical solution of the image processing method. It should be understood that the handset 100 shown in FIG. 1 is merely an example, and a handset in an actual application may have more or fewer components than the handset of FIG.
- the mobile phone 100 includes a processor 01, a signal transmitting and receiving circuit 02, a display screen 03, a touch screen 04, a power source 05, a memory 06, an audio circuit 07, a camera 08, and a sensor 09.
- the signal transceiving circuit 02 is configured to receive and transmit signals. When the mobile phone opens a conversation window to perform a chat session, the signal transceiving circuit 02 sends the information to the chat object or sends the information sent by the chat object to the processor for processing.
- the signal transceiving circuit 02 includes a radio frequency circuit, WIFI, and Bluetooth.
- the radio frequency circuit includes, for example, an antenna, an amplifier, a duplexer, and the like.
- WIFI Wireless Fidelity
- Bluetooth communicate wirelessly with other terminals using appropriate communication protocols.
- the display screen 03 is configured to display images, data, and a user interface, which may be a liquid crystal display, an organic electroluminescent display, or the like.
- the touch screen 04 is configured to input a user instruction, the user performs a touch press operation on the touch screen 04, and the touch screen 04 converts the sensed operation into a user instruction, and transmits the user instruction to the processor 01 for processing.
- the device 01 performs the corresponding function after receiving the user instruction.
- the memory 06 is capable of storing a computer software program, and the processor 01 performs various operations by running the computer software program.
- the memory 06 may be a high speed random access memory, a nonvolatile memory, or a volatile fixed memory or the like.
- the audio circuit 07 is configured to accept audio and output audio.
- the audio circuit 07 includes a microphone and a speaker capable of converting a sound signal into an electrical signal, and the speaker is capable of converting the received electrical signal into a sound signal.
- the camera 08 is configured to take still pictures or short films and is a very important additional component of the mobile phone.
- the sensor 09 is configured to sense changes in the handset and the external environment.
- the sound sensor can sense the size of the external sound and send the sensing result to the processor 01, and the processor 01 adjusts the sound volume emitted by the speaker;
- the ambient light sensor can sense the brightness of the ambient light and send the sensing result to the
- the processor 01 adjusts the brightness of the display screen 03 by the processor 01;
- the acceleration sensor can sense the magnitude and direction of the gravity to identify the usage state of the mobile phone, such as a horizontal screen display and a vertical screen display.
- the power source 05 is configured to supply power to the processor 01, the signal transceiving circuit 02, the display screen 03, the touch screen 04, the memory 06, the audio circuit 07, the camera 08, and the sensor 09.
- the image processing method to be described below can be implemented on the mobile phone 600 having the above-described hardware configuration.
- FIG. 2 is a flow chart of steps of an image processing method according to some embodiments of the present disclosure.
- the image processing method may include S100-S106:
- the screenshot operation can be implemented as a screen capture, a screenshot, a photograph, and the like.
- the screenshot operation can be monitored in at least one of the following ways:
- the listener is registered for the screenshot operation, and the broadcast sent when the screenshot operation is monitored.
- the specific rule includes one or more of the following:
- the generation time of the image data is after the start of the monitoring and is separated from the current time by a threshold (for example, 10 seconds).
- the size of the image data does not exceed the size of the screen, and if it is a sliding screen, the width or length of the image data does not exceed the width or length of the screen.
- the path of the image data contains specific keywords such as "screenshot”.
- the manner of monitoring the screenshot operation is only an example. In the implementation of the embodiment of the present disclosure, other manners of monitoring the screenshot operation may be set according to actual conditions, which is not limited by the embodiment of the present disclosure. In addition, in addition to the above manner of monitoring the screenshot operation, those skilled in the art may also adopt other manners for monitoring the screenshot operation according to actual needs, and the embodiment of the present disclosure does not limit this.
- the screenshot content corresponding to the screenshot operation may be detected, that is, the interface content at the time of the screenshot.
- the screenshot content in the image data obtained in the screenshot operation is identified; if the screenshot content includes a session window, the screenshot content is determined to be image data including a session window. If the screenshot content does not include a session window, the image data obtained by the screenshot operation is displayed.
- S100' includes:
- the screenshot content of the screenshot operation includes a session window.
- the UI (User Interface) designed for the session window is relatively stable over a period of time, and thus may be based on image data having features in the UI of the session window of different applications.
- Set the session image template to store the set session image template in the database.
- the image data obtained by the screenshot operation may be acquired, and the image data may be matched with the session image template of the specific application by means of image similarity or the like, or may be matched with the session image template one by one.
- the feature information of the image data and the feature information in the session image template may be extracted, and then the extracted feature information is subjected to similarity calculation.
- the feature information may include at least one of shape feature information and color feature information; the shape feature information may refer to information that characterizes image shape characteristics, and the color feature information may refer to information that characterizes image color characteristics.
- region feature which is mainly for the entire shape region of the image
- contour feature which is for the outer boundary of the object
- Typical methods for extracting shape feature information include boundary eigenvalue method (outer boundary of image), geometric parameter method (image geometric parameterization processing), shape invariant moment method (finding image invariant moment feature), and Fourier shape description method (Fourier transform method) and so on.
- the color feature information may be described by the color features of the image or image area, which is holistic.
- Typical methods of extracting color feature information include color histograms, color sets, color moments, and the like.
- the similarity between the image data and the session image template is higher than a preset threshold, it may be considered that the matching between the two is successful, and the screenshot content of the screenshot operation is determined to include the session window.
- those skilled in the art may also adopt other methods for detecting the content of the screenshot according to actual needs, for example, detecting an application to which the uppermost window of the operating system belongs, if the application is a loadable session window.
- the application determines that the screenshot content includes a session window, and embodiments of the present disclosure do not limit this.
- the manner in which the image is processed is determined. If the image is not required to be subjected to the privacy protection process, the image data obtained by the screenshot operation is displayed; if the image needs to be subjected to the privacy protection process, then S101 is performed.
- the user launches a session window in an instant messaging tool, a mailbox client, a microblog, a forum, etc., to engage with friends, strangers, group users, etc., and form a session record.
- the user can form image data for the session window by means of screen capture, screenshot, photographing, etc., wherein the image data is image data of the user interface layer.
- the user may perform a screen capture process on the session window, or may call a previously stored session record, or use a session record sent by another device, and use the formed or received image data as image data to be processed. .
- S102 Identify, in the image data, a target area where the sensitive information in the session window is located.
- the sensitive information is private information, and before the sharing, the target area in which it is located is identified, and the user information is protected.
- the sensitive information includes user information, and the user information includes at least one of the following:
- Group avatar group name, user name, user avatar.
- the foregoing user information is only used as an example. In some embodiments, other user information is set according to actual conditions, and the disclosure does not limit this. In addition, in addition to the foregoing user information, other user information may be used by those skilled in the art according to actual needs, and the disclosure does not limit this.
- the user information in the session window has certain characteristics (such as area, location, shape, etc.) with which the user information in the session window is identified from the image data.
- the user's own user avatar is located on the right side, and the other user's user avatar is located on the left side; the user's own user name is located on the left side of the user's own avatar, and other users' users are located.
- the name is located to the right of the other user's user avatar.
- a session window of an application when a user conducts a session with another single user, information such as a user avatar, a user name, and the like of the single user is displayed at the top of the session window, and when the user performs a session in the group, The group avatar, group name and other information of the group is displayed at the top of the session window.
- the shape of the user's avatar is square or circular in the session window of the application.
- the S102 further includes S201-S204:
- the user information that is more concerned with privacy such as group avatar, group name, user name, user avatar, etc.
- the image data can be separated, and the target image containing the user information is from the session window.
- the scene is taken out so that subsequent processing can focus on the target image where the user information is located.
- S201 includes the following sub-steps S11-S13:
- the red, green and blue three-channel pixels contained are represented as I(x,y) red , I(x,y) green , I(x,y) Yellow .
- I(x,y) gray 0.299I(x,y) red +I(x,y) green +I(x,y) blue formula 1
- I(x, y) gray is image data after gradation processing.
- the image data is subjected to gradation processing to convert the image data from color image data to grayscale image data, and then performing binarization processing to convert the image data from grayscale image data to binary value. (eg 0, 1) image data.
- the maximum inter-class variance method is an adaptive threshold determination method.
- the image data is divided into a background image and a foreground image (ie, a target) according to the gradation characteristics of the image data.
- the partial foreground image is misclassified into the background image or part of the background image is divided into the foreground image, the background will be caused.
- the difference between the image and the foreground image becomes smaller. Therefore, the segmentation that maximizes the variance between classes means that the probability of misclassification is minimal.
- the segmentation threshold of the foreground image and the background image is denoted by T
- the number of pixels belonging to the foreground image occupies the entire image data I(x, y
- the ratio of gray is ⁇ 0
- the number of pixels belonging to the background image is ⁇ 1 in the ratio of the entire image data I(x, y) gray
- the average gradation is ⁇ 1 .
- the total average gray scale of the image data I(x, y) gray is denoted by ⁇
- the variance between classes is denoted by g.
- N 0 +N 1 M ⁇ N Equation 4
- the entire image data is traversed to obtain a threshold T that maximizes the variance between the classes, and the maximum threshold T is used to divide the foreground image and the background image, and the following binary segmentation is followed:
- I(x i , y i ) binary is image data after binarization
- I(x i , y i ) is the i-th pixel point
- the image processing terminal recognizes from the image data which regions are foreground images (such as pixels having a value of 0), that is, target images containing user information.
- the manner of dividing the target image is only an example. In some embodiments, other manners of dividing the target image are set according to actual conditions. For example, after enhancing the contrast of the image data, the foreground image in the image data is extracted by using a Gaussian model as a target.
- the image is not limited in this disclosure.
- those skilled in the art may also adopt other manners of dividing the target image according to actual needs, and the disclosure does not limit this.
- Determining the boundary region that is, determining the outer boundary of the target image, the boundary of the hole, and the hierarchical relationship thereof, and the boundary regions and the regions of the image data have a one-to-one correspondence, for example, in the binarized image, the outer boundary corresponds to a pixel value of 1.
- the connected area, the hole boundary corresponds to a connected area with a pixel value of zero.
- the boundary regions are used to represent and divide the image, traversing the entire image data, thereby calibrating the boundary regions of the user information in the image data.
- the target image located in a predetermined designated area (such as a range having a certain distance from the left and right edges) is subjected to expansion processing, and the boundary image is marked on the target image after the expansion processing.
- the user information such as the user's avatar is usually located in a preset designated area, and there are many holes in the designated area. Therefore, the target image in the designated area is expanded, so that the target image becomes a whole. Convenient for subsequent processing.
- the expansion processing operation needs to set the expansion operator D, and the expansion operator D and the binary image data I(x i , y i ) binary are combined to obtain the processed binary image as II (x i , y i ) binary .
- the boundary area can be directly calibrated.
- the target area of the target image generation specification for the boundary area is calibrated.
- the largest rectangle formed by the circumscribed boundary region is calculated as the target region.
- the largest rectangle formed therein refers to the largest area of the rectangle.
- other graphics are generated, such as elliptical, circular, star, etc., and the disclosure is not limited thereto.
- the target image identified in the image data may contain other information, such as a session box, session record, time, etc., in addition to the required user information, and thus, in some embodiments, further recognition from the candidate region The target area where the user information for privacy protection is located.
- the user information to be privacy protected is a user avatar
- the target area at the location if the user information to be privacy protected is the user name, in some cases, the user name is displayed, and in other cases, the user name is not displayed.
- the candidate area in the session window in the session window is searched for in an area outside the designated area, where the session box is the area carrying the session record.
- the candidate image is outside the designated area as the area in which the user name is located, and in other embodiments, the candidate image outside the designated area is the area in which the session box, session record, time, and the like are located.
- the height and area of the image including the user name, session record, time, and the like are the same or similar, and are difficult to distinguish.
- the parameters such as the height and area of the image containing the session record of the session frame are larger than the user name, session record, time, etc.
- the image of the information is easier to distinguish, and the relative position between the user name and the session box and the user's avatar is fixed. Therefore, by comparing parameters such as height and area, the session box in the session window is found, thereby identifying the user. name.
- the user's avatar of the user is usually displayed adjacent to the session record of the user along with the session box, so that the target area and the session box where at least part of the user avatar with the same ordinate is located are searched.
- the candidate region is located, and the target region in which the user avatar is located (which may be based on the top) and the candidate region in which the session frame is located (which may be based on the top) are the ordinate difference values.
- the candidate area located between the user avatar and the session box is where the user name is located in the session window.
- Target area is where the user name is located in the session window.
- the user name is not displayed in the session window.
- the candidate area in the specified area is the target area where the user's avatar is located.
- the candidate area with the largest parameter such as traversal height and area is the area where the session box is located, and find the user avatar (candidate area) and the session box with at least the same ordinate. (candidate area), if the position difference between the user avatar and the session frame is greater than a preset threshold, the candidate image between the user avatar (candidate area) and the session frame (candidate area) is set as the user name. .
- the above manner of identifying user information is only an example.
- other ways of identifying user information are set according to actual conditions, for example, identifying a candidate area of another designated area located at the top of the session window as a user name or group.
- the target area in which the group name is located is not limited in this disclosure.
- those skilled in the art may also adopt other ways of identifying user information according to actual needs, and the disclosure does not limit this.
- S103 Perform privacy protection processing on the target area in the image data. After identifying the target area where the user information is located, in the image data, performing privacy protection processing on the target area, so that the user information cannot be clearly distinguished in the processed image, thereby protecting user information in the target area. After that, the user can share the image data to other places without revealing the user information.
- the target area in the image data is smeared with a mask image of a specified size (eg, a red image, a mosaic) to obtain the target image data.
- a mask image of a specified size eg, a red image, a mosaic
- the same type of user information uses the same size of the occlusion image, and different types of user information may use the same or different occlusion image sizes.
- the masked image that smears the user's avatar is a square
- the masked image that smears the user's name is a rectangle.
- the size of the shadow image may be adjusted according to the shaded area such that the shadow image is not applied to the shaded area.
- the upper portion of the user avatar is obscured while the lower portion is unmasked, at which point the size of the occlusion image is adjusted to smear the exposed lower portion.
- the lower portion when the user's avatar is moved in at the bottom of the conversation window, the lower portion is shaded and the upper portion is unmasked. At this time, the size of the shadow image is adjusted to smear the exposed upper portion.
- other privacy protection processes are employed, such as overlaying other occlusion images (eg, overlaying a cartoon image on a user avatar), hollowing out, etc., without limitation.
- the user information is hidden in the privacy image data, it can be displayed to the user for other processing.
- the example is applied in a mobile terminal to listen to a screenshot operation, assuming that the user performs a session and screenshots in a group of instant messaging tools.
- the mobile terminal monitors the screenshot operation, the image data obtained by the screenshot is acquired, and whether the session window is included in the image data is detected.
- a prompt message is generated to prompt the user to include privacy information in the screenshot and whether to perform privacy protection processing on the image data.
- the image data obtained by the screenshot is color image data (not shown), and the image data is subjected to gradation processing to convert the color image data into grayscale image data.
- the image data after the gradation processing is binarized to separate the foreground image (target image) from the background image.
- the foreground image includes user information such as a user box and a user name waiting for privacy protection, and includes user information such as a session box and a session record that are not protected by privacy.
- the expansion process is performed and the boundary area is calibrated, and for other foreground images (target image), the boundary area is directly calibrated.
- the maximum circumscribed rectangle of the boundary region is calculated, and the largest circumscribed rectangle is used as the candidate region.
- the target area in which the group name is located is located in the image data (color not shown in the drawing), and the masked image of the specified size is applied to the target area, thereby obtaining the privacy image data.
- the top user avatar is ready to move out of the session window, obscuring the upper portion and exposing the lower portion. Therefore, the size of the occlusion image is modified to shield the exposed lower portion without processing the upper portion of the occlusion.
- the privacy image data is displayed to the user.
- the screenshot content corresponding to the screenshot operation is detected, and if the screenshot content includes the session window, determining the processing manner of the image data obtained for the screenshot operation, if the processing method is privacy
- the protection process performs privacy protection processing on the target area of the user information in the image data, obtains the privacy image data, and displays the privacy image data, automatically protecting the privacy information of the user in the session window, and avoids enabling the special image editing tool to be performed. Manually smearing greatly reduces the efficiency of processing.
- the processing time is generally less than 200 milliseconds, which greatly reduces the processing time.
- the privacy processing program is strictly executed, avoiding excessive or too little processing, and reducing the chance of error.
- the quality of the processing is improved, and the image data is directly replaced at the time of screen capture, without affecting the normal browsing of the user.
- the operation interface for generating the privacy image data includes a sharing operation, a collecting operation, a deleting operation, and an editing operation, and when the user clicks more options, an operation interface for playing a slide show, printing, renaming, rotating, displaying on the map, etc. is displayed. For the user to choose.
- the user browses the privacy image data, and an operational interface for the privacy image data can be generated below the privacy image data.
- the user can click on one of the operation interfaces as needed, and select the operation interface to perform an image operation corresponding to the selected operation interface on the privacy image data.
- the image operation includes at least one of the following:
- the sharing operation may refer to calling an interface of another application to share the privacy image data to the application.
- a favorite operation may refer to the collection of the private image data to a specific location of the gallery.
- the delete operation may refer to deleting the privacy image data.
- the editing operation may refer to additional editing processing such as rotation, trimming, filtering, blurring, and the like of the privacy image data.
- image operations are only examples.
- other image operations may be set according to actual conditions, for example, playing a slide show, printing, renaming, rotating, displaying on a map, etc., the implementation of the present disclosure This example does not limit this.
- other image operations may be employed by those skilled in the art in addition to the above-described image operations, and the embodiments of the present disclosure do not limit this.
- the image processing method may not be completely performed in accordance with the steps and/or sequences shown in FIG. 2.
- some of the operational steps may be omitted, or the order of execution of some of the steps may be changed.
- the image processing method may include only S101 to S103, or the image processing method need not include S105 to S106 or S100 to S100"; and, for example, the execution order of S100" may be located after S101 (instead of before).
- FIG. 4 is a structural block diagram showing an image processing provided by some embodiments of the present disclosure.
- the image processing apparatus 4 includes a memory 41, a processor 42, and a computer program 411 stored in the memory 41 and operable on the processor 42.
- the processor 42 is configured to:
- the user information includes at least one of the following:
- Group avatar group name, user name, user avatar.
- the processor when configured to (2) identify in the image data the target area in which the user information is located in the session window, the processor is further configured to:
- the processor when configured to (21) divide a target image from image data, the processor is further configured to:
- the foreground image is divided from the image data after the binarization processing as a target image.
- the processor when the processor is configured to (22) calibrate a boundary region to a target image, the processor is further configured to:
- the processor is configured to (23) generate a candidate region based on the boundary region, the processor further configured to:
- the processor is configured to (24) determine, in the candidate region, a target region in which the user information is located in the session window, the processor further configured to:
- the processor is configured to (3) when performing privacy protection processing on the target area in the image data, the processor is further configured to:
- a masked image of a specified size is applied to the target area in the image data.
- the processor is further configured to:
- the image operation comprises at least one of the following:
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- Some embodiments of the present disclosure provide a computer readable storage medium storing a computer program, wherein the image processing method is implemented when the computer program is executed by a processor.
- embodiments of the present disclosure may be provided as a method, apparatus, or computer program product.
- embodiments of the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
- embodiments of the present disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- Embodiments of the present disclosure are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device Means are generated that are configured to implement the functions specified in one or more blocks of the flowchart or in a block or blocks of the flowchart.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Description
本申请要求于2018年3月15日提交中国专利局、申请号为201810215678.X、名称为“一种图像处理方法和装置”以及2018年3月15日提交中国专利局、申请号为201810215115.0、名称为“一种截图方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application is required to be submitted to the Chinese Patent Office on March 15, 2018, application number 201810215678.X, the name is "an image processing method and device", and submitted to the Chinese Patent Office on March 15, 2018, the application number is 201810215115.0. The priority of the Chinese Patent Application, which is incorporated herein by reference in its entirety in its entirety in its entirety in the the the the the the the the the
本公开涉及计算机处理的技术领域,特别是涉及一种图像处理方法和终端。The present disclosure relates to the technical field of computer processing, and in particular to an image processing method and terminal.
随着科技的发展,诸如手机、平板电脑之类的移动终端在人们的工作、学习、日常交流等各方面的使用率越来越高。With the development of technology, mobile terminals such as mobile phones and tablet computers are increasingly used in people's work, study, and daily communication.
为了使用移动终端进行通信,用户经常在这些移动终端中安装通信工具,以在安装的通信工具中开启与其他用户联系的会话窗口,并在会话窗口中与其他用户进行交流。在某些情景中,用户会将会话窗口中与其他用户通信时的会话记录分享出去,以方便其他用户了解会话中的内容或获取相关信息。In order to communicate using a mobile terminal, users often install communication tools in these mobile terminals to open a conversation window with other users in the installed communication tool and communicate with other users in the conversation window. In some scenarios, users will share session records in the session window when communicating with other users to facilitate other users to understand the content of the session or to obtain relevant information.
在分享的时候,用户通常分享会话窗口内容。然而,为了保护隐私,用户一般会选择保护一些隐私信息。When sharing, users usually share the content of the session window. However, in order to protect privacy, users generally choose to protect some private information.
为此,用户通常首先对会话窗口进行截取屏幕,以保存图像数据,然后启用专门的图像编辑工具对该图像数据中记录的隐私信息进行涂抹,之后再分享处理后的图像数据。To this end, the user usually first intercepts the screen of the session window to save the image data, and then enables a special image editing tool to smear the private information recorded in the image data, and then share the processed image data.
发明内容Summary of the invention
根据本公开的一个方面,提供了一种图像处理方法,包括:According to an aspect of the present disclosure, an image processing method is provided, including:
获取包含会话界面的图像数据;Obtain image data containing a session interface;
在所述图像数据中识别所述会话界面中敏感信息所处的目标区域;Identifying, in the image data, a target area in which the sensitive information in the session interface is located;
在所述图像数据中对所述目标区域进行隐私保护处理,获得隐私图像数据;Performing a privacy protection process on the target area in the image data to obtain privacy image data;
其中,所述会话界面包括用户之间进行的会话。The session interface includes a session between users.
根据本公开的另一方面,提供了一种终端,包括存储器和处理器,所述存储器存储能够在所述处理器上运行的计算机程序,所述处理器配置为运行所述计算机程序以使所述终端实现:In accordance with another aspect of the present disclosure, a terminal is provided comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor configured to run the computer program to Said terminal implementation:
获取包含会话界面的图像数据;Obtain image data containing a session interface;
识别所述图像数据中所述会话界面中敏感信息所处的目标区域;以及Identifying a target area in which the sensitive information in the session interface is located in the image data;
在所述图像数据中对所述目标区域进行隐私保护处理,获得隐私图像数据;Performing a privacy protection process on the target area in the image data to obtain privacy image data;
其中,所述会话界面包括用户之间进行的会话,所述敏感信息包括用户信息。The session interface includes a session between users, and the sensitive information includes user information.
根据本公开的又一方面,提供了一种计算机可读非易失性存储介质,所述存储介质存储有计算机程序,其中,所述计算机程序被处理器执行时实现上述图像处理方法。According to still another aspect of the present disclosure, a computer readable nonvolatile storage medium storing a computer program, wherein the computer program is executed by a processor, implements the image processing method described above.
为了更清楚地说明本公开实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present disclosure, Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1是本公开一些实施例提供的一种手机的硬件结构示意图;1 is a schematic structural diagram of hardware of a mobile phone according to some embodiments of the present disclosure;
图2是本公开一些实施例提供的一种图像处理方法的步骤流程图;2 is a flow chart of steps of an image processing method according to some embodiments of the present disclosure;
图3A至图3H是在移动终端上执行本公开一些实施例提供的图像处理方法的示例图;3A to 3H are diagrams showing an example of performing an image processing method provided by some embodiments of the present disclosure on a mobile terminal;
图4是本公开一些实施例提供的一种图像处理装置的结构框图。FIG. 4 is a structural block diagram of an image processing apparatus according to some embodiments of the present disclosure.
为使本公开的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本公开作进一步详细的说明。The above-described objects, features and advantages of the present disclosure will become more apparent from the aspects of the appended claims.
本公开一些实施例提供的图像处理方法可以应用于如下移动终端中,例如手机、平板电脑、智能穿戴设备(如智能手表、智能眼镜)等等;也可以应用在非移动终端中,例如个人电脑、智能电视,等等,本公开的 实施例对此不加以限制。The image processing method provided by some embodiments of the present disclosure may be applied to a mobile terminal, such as a mobile phone, a tablet computer, a smart wearable device (such as a smart watch, smart glasses), and the like; or may be applied to a non-mobile terminal, such as a personal computer. The smart television, and the like, the embodiment of the present disclosure does not limit this.
这些移动终端、非移动终端的操作系统包括Android(安卓)、IOS以及Windows Phone等,在这些操作系统上通常可以运行支持通信的应用,例如,即时通讯工具、邮箱客户端、微博应用、论坛应用等。在一些实施例中,用户在即时通讯工具、邮箱客户端、微博、论坛等应用中启动会话界面,以与好友、非好友、陌生人、群组用户等进行会话,并形成会话记录。The operating systems of these mobile terminals and non-mobile terminals include Android (Android), IOS, and Windows Phone. On these operating systems, applications that support communication are usually run, for example, instant messaging tools, email clients, microblog applications, forums. Application, etc. In some embodiments, the user initiates a session interface in an instant messaging tool, a mailbox client, a microblog, a forum, etc., to engage with friends, non-friends, strangers, group users, etc., and form a session record.
所述会话界面一般是会话窗口的形式。其中,会话窗口中通常包括群组头像、群组名称、用户名称、用户头像等隐私信息,在上述终端中能够对包含会话窗口的图像进行隐私保护处理,例如使用涂抹、覆盖、遮蔽、挖空等方式处理隐私信息,以保护用户的隐私信息。The session interface is typically in the form of a session window. The session window usually includes private information such as a group avatar, a group name, a user name, and a user avatar. In the terminal, the image including the session window can be protected by privacy, for example, smearing, covering, obscuring, and hollowing out. The privacy information is processed in a manner to protect the user's private information.
下面以手机为例来说明终端如何实现所述图像处理方法的技术方案。应该理解的是,图1所示的手机100仅仅是一个示例,实际应用中的手机可以具有比图1中的手机更多或者更少的零部件。The following is a mobile phone as an example to illustrate how the terminal implements the technical solution of the image processing method. It should be understood that the
如图1所示,手机100包括:处理器01、信号收发电路02,显示屏03,触控屏04,电源05,存储器06,音频电路07,摄像头08以及传感器09。As shown in FIG. 1, the
信号收发电路02配置为接收和发送信号,当手机开启对话窗口进行聊天对话时,信号收发电路02将信息发送给聊天对象或将聊天对象发来的信息发送至处理器进行处理。在一些实施例中,信号收发电路02包括射频电路、WIFI和蓝牙。射频电路例如包括天线、放大器、双工器等器件。无线保真(WIFI)和蓝牙使用适当的通信协议与其他终端进行无线通信。The signal transceiving
所述显示屏03配置为进行图像、数据和用户界面的显示,其可以是液晶显示屏、有机电致发光显示屏等。The
所述触控屏04配置为输入用户指令,用户在触控屏04上进行触摸按压等操作,触控屏04将感受到的操作转化为用户指令,并将用户指令传送至处理器01,处理器01接收到用户指令后执行相应的功能。The
所述存储器06能够存储计算机软件程序,处理器01通过运行该计 算机软件程序执行各种操作。其中,所述存储器06可以是高速随机存取存储器、非易失性存储器、或易失性固定存储器等。The
所述音频电路07配置为接受音频和输出音频。所述音频电路07包括麦克风和扬声器,麦克风能够将声音信号转变为电信号,扬声器能够将接收的电信号转换为声音信号。The
所述摄像头08配置为拍摄静态图片或短片,是手机的一个非常重要的附加零部件。The
所述传感器09配置为感应手机与外界环境的变化。例如,声音传感器可感测外界声音大小并将感测结果发送给处理器01,由处理器01调节扬声器发出的声音大小;环境光传感器可感测外界环境光线的明暗并将感测结果发送给处理器01,由处理器01调节显示屏03的亮度;加速度传感器可感测重力大小及方向从而识别手机的使用状态,例如横屏显示、竖屏显示。The
所述电源05配置为给所述处理器01、信号收发电路02,显示屏03,触控屏04,存储器06,音频电路07,摄像头08以及传感器09供电。The
以下将要描述的图像处理方法能够在具有上述硬件结构的手机600上实现。The image processing method to be described below can be implemented on the mobile phone 600 having the above-described hardware configuration.
图2为本公开一些实施例提供的一种图像处理方法的步骤流程图。所述图像处理方法可以包括S100-S106:FIG. 2 is a flow chart of steps of an image processing method according to some embodiments of the present disclosure. The image processing method may include S100-S106:
S100,监听截图操作。S100, monitor the screenshot operation.
所述截图操作可以实现为截屏、截图、拍照等操作。在一些实施例中,可以通过如下的至少一种方式监听截图操作:The screenshot operation can be implemented as a screen capture, a screenshot, a photograph, and the like. In some embodiments, the screenshot operation can be monitored in at least one of the following ways:
1、监听广播1, listening to the broadcast
在操作系统中对截图操作注册监听器,监听截图操作时发送的广播。In the operating system, the listener is registered for the screenshot operation, and the broadcast sent when the screenshot operation is monitored.
2、监听物理按键2, monitor the physical button
在移动终端中,大多支持物理按键组合快速执行截图操作,例如,同时按下电源键与音量减键执行截图操作,监听物理按键的组合可以实现截图操作的监听。In the mobile terminal, most of the physical button combinations are supported to perform the screenshot operation quickly. For example, pressing the power button and the volume down button simultaneously performs a screenshot operation, and the combination of the physical buttons can be monitored by the screenshot operation.
3、监听图像数据的变化3, monitor image data changes
在Android系统有一个媒体数据库,每拍一张照片,或使用系统截屏截取一张图片,都会将其详细信息加入到媒体数据库,并发出内容改变通知,因此,可以利用内容观察者(Content Observer)监听媒体数据库的变化,当数据库有变化时,获取最后插入的一条图像数据,如果该图像数据符合特定的规则,则认为执行了截图操作。There is a media database in the Android system. Each time you take a photo, or use the system screen capture to capture an image, it will add its details to the media database and issue a content change notification. Therefore, you can use the content observer (Content Observer). Listening to changes in the media database, when the database changes, the last inserted image data is obtained, and if the image data meets a specific rule, the screenshot operation is considered to be performed.
以截屏操作为例,所述特定的规则包括如下的一个或多个:Taking a screen capture operation as an example, the specific rule includes one or more of the following:
3.1、时间规则3.1, time rules
图像数据的生成时间在开始监听之后,并与当前时间相隔一阈值(如10秒)内。The generation time of the image data is after the start of the monitoring and is separated from the current time by a threshold (for example, 10 seconds).
3.2、尺寸规则3.2, size rules
图像数据的尺寸没有超过屏幕的尺寸,如果是滑动截屏,则图像数据的宽度或长度没有超过屏幕的宽度或长度。The size of the image data does not exceed the size of the screen, and if it is a sliding screen, the width or length of the image data does not exceed the width or length of the screen.
3.3、路径判断3.3, path judgment
图像数据的路径包含特定的关键词,如“screenshot”。The path of the image data contains specific keywords such as "screenshot".
当然,上述监听截图操作的方式只是作为示例,在实施本公开实施例时,可以根据实际情况设置其他监听截图操作的方式,本公开实施例对此不加以限制。另外,除了上述监听截图操作的方式外,本领域技术人员还可以根据实际需要采用其它监听截图操作的方式,本公开的实施例对此也不加以限制。Of course, the manner of monitoring the screenshot operation is only an example. In the implementation of the embodiment of the present disclosure, other manners of monitoring the screenshot operation may be set according to actual conditions, which is not limited by the embodiment of the present disclosure. In addition, in addition to the above manner of monitoring the screenshot operation, those skilled in the art may also adopt other manners for monitoring the screenshot operation according to actual needs, and the embodiment of the present disclosure does not limit this.
若监听到用户执行了截图操作,则可以检测截图操作对应的截图内容,即截图时的界面内容。If the user is monitored to perform the screenshot operation, the screenshot content corresponding to the screenshot operation may be detected, that is, the interface content at the time of the screenshot.
S100’,识别截图操作中获得的图像数据中的截图内容是否包含会话窗口。S100', identifying whether the screenshot content in the image data obtained in the screenshot operation includes a session window.
当检测到截图操作时,识别所述截图操作中所获得的图像数据中的截图内容;若所述截图内容包括会话窗口,则确定所述截图内容为包含会话窗口的图像数据。若所述截图内容不包括会话窗口,则显示所述截图操作所获得的图像数据。When the screenshot operation is detected, the screenshot content in the image data obtained in the screenshot operation is identified; if the screenshot content includes a session window, the screenshot content is determined to be image data including a session window. If the screenshot content does not include a session window, the image data obtained by the screenshot operation is displayed.
本公开的一些实施例中,S100’包括:In some embodiments of the present disclosure, S100' includes:
将所述截图操作获得的图像数据与预设的会话图像模板进行匹配;Matching the image data obtained by the screenshot operation with a preset session image template;
当所述图像数据与所述会话图像模板匹配成功时,确定所述截图操作的截图内容包括会话窗口。When the image data is successfully matched with the session image template, it is determined that the screenshot content of the screenshot operation includes a session window.
在本公开的一些实施例中,应用针对会话窗口设计的UI(User Interface,用户界面)在一段时间内是相对稳定的,因此,可以根据不同应用的会话窗口的UI中具有特征的图像数据来设置会话图像模板,将设置的会话图像模板存储在数据库中。In some embodiments of the present disclosure, the UI (User Interface) designed for the session window is relatively stable over a period of time, and thus may be based on image data having features in the UI of the session window of different applications. Set the session image template to store the set session image template in the database.
若检测到截图操作,则可以获取截图操作获得的图像数据,通过图片相似度等方式将该图像数据与特定应用的会话图像模板进行匹配,或者逐一与会话图像模板进行匹配。If the screenshot operation is detected, the image data obtained by the screenshot operation may be acquired, and the image data may be matched with the session image template of the specific application by means of image similarity or the like, or may be matched with the session image template one by one.
在本公开一些实施例中,可以提取图像数据的特征信息与会话图像模板中的特征信息,然后将提取到的特征信息进行相似度的计算。In some embodiments of the present disclosure, the feature information of the image data and the feature information in the session image template may be extracted, and then the extracted feature information is subjected to similarity calculation.
其中,特征信息可以包括形状特征信息和颜色特征信息中的至少一种;形状特征信息可以指表征图像形状特性的信息,颜色特征信息可以指表征图像颜色特性的信息。The feature information may include at least one of shape feature information and color feature information; the shape feature information may refer to information that characterizes image shape characteristics, and the color feature information may refer to information that characterizes image color characteristics.
形状特征信息的表示方法主要有两类,一类是区域特征,其主要针对图像的整个形状区域;另一类是轮廓特征,其针对的是物体的外边界。There are two main types of representation methods for shape feature information, one is the region feature, which is mainly for the entire shape region of the image, and the other is the contour feature, which is for the outer boundary of the object.
提取形状特征信息的典型方法包括边界特征值法(图像的外边界)、几何参数法(图像几何参数化处理)、形状不变矩法(找图像不变矩特征)、傅里叶形状描述法(傅里叶变换法)等等。Typical methods for extracting shape feature information include boundary eigenvalue method (outer boundary of image), geometric parameter method (image geometric parameterization processing), shape invariant moment method (finding image invariant moment feature), and Fourier shape description method (Fourier transform method) and so on.
颜色特征信息可以是通过图像或图像区域的颜色特征来描述,它具有整体性。The color feature information may be described by the color features of the image or image area, which is holistic.
提取颜色特征信息的典型方法包括颜色直方图、颜色集、颜色矩等等。Typical methods of extracting color feature information include color histograms, color sets, color moments, and the like.
当然,上述特征信息只是作为示例,在实施本公开实施例时,可以根据实际情况设置其他特征信息,本公开实施例对此不加以限制。Of course, the above-mentioned feature information is only an example. When the embodiment of the present disclosure is implemented, other feature information may be set according to actual conditions, which is not limited by the embodiment of the present disclosure.
若图像数据与会话图像模板之间的相似度高于预设的阈值,则可以认为两者之间匹配成功,确定截图操作的截图内容包括会话窗口。If the similarity between the image data and the session image template is higher than a preset threshold, it may be considered that the matching between the two is successful, and the screenshot content of the screenshot operation is determined to include the session window.
除了上述与会话图像模板进行匹配的方式外,本领域技术人员还可以根据实际需要采用其它检测截图内容的方式,例如,检测操作系统最上 层窗口所属的应用,若该应用为可加载会话窗口的应用,则确定截图内容包括会话窗口,本公开的实施例对此也不加以限制。In addition to the above manner of matching with the session image template, those skilled in the art may also adopt other methods for detecting the content of the screenshot according to actual needs, for example, detecting an application to which the uppermost window of the operating system belongs, if the application is a loadable session window. The application determines that the screenshot content includes a session window, and embodiments of the present disclosure do not limit this.
S100”,判断是否对包含会话窗口的图像进行隐私保护处理。S100", determining whether to perform privacy protection processing on the image including the session window.
若所述截图内容包括会话窗口,则确定对图像的处理方式。若不需要对图像进行隐私保护处理,则显示所述截图操作所获得的图像数据;若需要对所述图像进行隐私保护处理,则进行S101。If the screenshot content includes a session window, then the manner in which the image is processed is determined. If the image is not required to be subjected to the privacy protection process, the image data obtained by the screenshot operation is displayed; if the image needs to be subjected to the privacy protection process, then S101 is performed.
S101,获取包含会话窗口的图像数据。S101. Acquire image data including a session window.
在一些实施例中,用户在即时通讯工具、邮箱客户端、微博、论坛等应用中启动会话窗口,以与好友、陌生人、群组用户等进行会话,并形成会话记录。In some embodiments, the user launches a session window in an instant messaging tool, a mailbox client, a microblog, a forum, etc., to engage with friends, strangers, group users, etc., and form a session record.
此时,用户可以通过截屏、截图、拍照等方式对该会话窗口形成图像数据,其中该图像数据为用户界面层的图像数据。在一些实施例中,用户可以对会话窗口进行截屏处理,还可以调用此前存储的会话记录,或者使用其他设备发送过来的会话记录,并将形成的或接收到的图像数据作为需要处理的图像数据。At this time, the user can form image data for the session window by means of screen capture, screenshot, photographing, etc., wherein the image data is image data of the user interface layer. In some embodiments, the user may perform a screen capture process on the session window, or may call a previously stored session record, or use a session record sent by another device, and use the formed or received image data as image data to be processed. .
S102,在所述图像数据中识别所述会话窗口中敏感信息所处的目标区域。在本公开的一些实施例中,敏感信息为隐私信息,在分享之前,识别其所处的目标区域,对所述用户信息进行保护。S102. Identify, in the image data, a target area where the sensitive information in the session window is located. In some embodiments of the present disclosure, the sensitive information is private information, and before the sharing, the target area in which it is located is identified, and the user information is protected.
其中,所述敏感信息包括用户信息,所述用户信息包括如下的至少一种:The sensitive information includes user information, and the user information includes at least one of the following:
群组头像、群组名称、用户名称、用户头像。Group avatar, group name, user name, user avatar.
当然,上述用户信息只是作为示例,在一些实施例中,根据实际情况设置其他用户信息,本公开对此不加以限制。另外,除了上述用户信息外,本领域技术人员还可以根据实际需要采用其它的用户信息,本公开对此也不加以限制。Of course, the foregoing user information is only used as an example. In some embodiments, other user information is set according to actual conditions, and the disclosure does not limit this. In addition, in addition to the foregoing user information, other user information may be used by those skilled in the art according to actual needs, and the disclosure does not limit this.
会话窗口中的用户信息具有一定的特征(如面积、位置、形状等),利用这些特征从所述图像数据中识别会话窗口中的用户信息。The user information in the session window has certain characteristics (such as area, location, shape, etc.) with which the user information in the session window is identified from the image data.
在一些实施例中,在应用的会话窗口中,用户自身的用户头像位于右侧,其他用户的用户头像位于左侧;用户自身的用户名称位于该用 户自身的头像的左侧,其他用户的用户名称位于该其他用户的用户头像右侧。In some embodiments, in the session window of the application, the user's own user avatar is located on the right side, and the other user's user avatar is located on the left side; the user's own user name is located on the left side of the user's own avatar, and other users' users are located. The name is located to the right of the other user's user avatar.
在一些实施例中,在应用的会话窗口中,用户与另一单个用户进行会话时,该单个用户的用户头像、用户名称等信息显示在会话窗口的最上方,用户在群组进行会话时,该群组的群组头像、群组名称等信息显示在会话窗口的最上方。In some embodiments, in a session window of an application, when a user conducts a session with another single user, information such as a user avatar, a user name, and the like of the single user is displayed at the top of the session window, and when the user performs a session in the group, The group avatar, group name and other information of the group is displayed at the top of the session window.
在一些实施例中,在应用的会话窗口中,用户头像的形状为正方形或圆形。In some embodiments, the shape of the user's avatar is square or circular in the session window of the application.
在一些实施例中,所述S102还包括S201-S204:In some embodiments, the S102 further includes S201-S204:
S201,从所述图像数据中划分目标图像。S201. Divide a target image from the image data.
在会话窗口中,往往关心的是较为隐私的用户信息,如群组头像、群组名称、用户名称、用户头像等,因此可以对图像数据进行分离,将包含用户信息的目标图像从会话窗口的场景中取出来,使得后续的处理可以集中考虑用户信息所在的目标图像。In the session window, the user information that is more concerned with privacy, such as group avatar, group name, user name, user avatar, etc., can be separated, so that the image data can be separated, and the target image containing the user information is from the session window. The scene is taken out so that subsequent processing can focus on the target image where the user information is located.
在一些实施例中,S201包括如下子步骤S11-S13:In some embodiments, S201 includes the following sub-steps S11-S13:
S11,对所述图像数据进行灰度处理。S11, performing grayscale processing on the image data.
对于给定的图像数据I(x,y) color,其所包含的红绿蓝三通道的像素分别表示为I(x,y) red,I(x,y) green,I(x,y) yellow。 For a given image data I(x,y) color , the red, green and blue three-channel pixels contained are represented as I(x,y) red , I(x,y) green , I(x,y) Yellow .
其中,x,y分别代表图像中横坐标与纵坐标的索引位置,通过如下公式对所述图像数据进行灰度处理:Where x, y represent the index positions of the abscissa and the ordinate in the image, respectively, and the image data is grayscale processed by the following formula:
I(x,y)
gray=0.299I(x,y)
red+I(x,y)
green+I(x,y)
blue 公式①
I(x,y) gray =0.299I(x,y) red +I(x,y) green +I(x,y) blue
其中,I(x,y) gray为灰度处理之后的图像数据。 Where I(x, y) gray is image data after gradation processing.
S12,对灰度处理之后的图像数据进行二值化处理。S12, performing binarization processing on the image data after the gradation processing.
首先对所述图像数据进行灰度处理,以将所述图像数据从彩色图像数据转换为灰度图像数据,之后,进行二值化处理,将所述图像数据从灰度图像数据转换为二值(如0、1)图像数据。First, the image data is subjected to gradation processing to convert the image data from color image data to grayscale image data, and then performing binarization processing to convert the image data from grayscale image data to binary value. (eg 0, 1) image data.
以最大类间方差法为例,最大类间方差法是一种自适应的阈值确定的方法,按图像数据的灰度特性,将图像数据分成背景图像和前景图像(即目标)。Taking the maximum inter-class variance method as an example, the maximum inter-class variance method is an adaptive threshold determination method. The image data is divided into a background image and a foreground image (ie, a target) according to the gradation characteristics of the image data.
背景图像和前景图像之间的类间方差越大,说明构成图像数据的背景图像和前景图像的差别越大,当部分前景图像错分为背景图像或部分背景图像错分为前景图像都会导致背景图像和前景图像差别变小。因此,使类间方差最大的分割意味着错分概率最小。The larger the variance between the background image and the foreground image, the greater the difference between the background image and the foreground image constituting the image data. When the partial foreground image is misclassified into the background image or part of the background image is divided into the foreground image, the background will be caused. The difference between the image and the foreground image becomes smaller. Therefore, the segmentation that maximizes the variance between classes means that the probability of misclassification is minimal.
在一些实施例中,对于灰度处理之后的图像数据I(x,y) gray,前景图像和背景图像的分割阈值记作T,属于前景图像的像素点数占整幅图像数据I(x,y) gray的比例记为ω 0,其平均灰度μ 0,属于背景图像的像素点数占整幅图像数据I(x,y) gray的比例为ω 1,其平均灰度为μ 1。图像数据I(x,y) gray的总平均灰度记为μ,类间方差记为g。 In some embodiments, for the image data I(x, y) gray after the gradation processing, the segmentation threshold of the foreground image and the background image is denoted by T, and the number of pixels belonging to the foreground image occupies the entire image data I(x, y The ratio of gray is ω 0 , and its average gradation μ 0 , the number of pixels belonging to the background image is ω 1 in the ratio of the entire image data I(x, y) gray , and the average gradation is μ 1 . The total average gray scale of the image data I(x, y) gray is denoted by μ, and the variance between classes is denoted by g.
假设图像数据I(x,y) gray的背景较暗,并且图像数据I(x,y) gray的大小为M×N,图像数据I(x,y) gray中灰度值小于阈值T的像素个数记作N 0,像素灰度大于阈值T的像素个数记作N 1,则有如下条件: It is assumed that the background of the image data I(x, y) gray is dark, and the size of the image data I(x, y) gray is M×N, and the pixel in the image data I(x, y) gray is smaller than the threshold T. The number is recorded as N 0 , and the number of pixels whose pixel gradation is greater than the threshold T is denoted as N 1 , and the following conditions are met:
ω 0=N 0/M×N 公式② ω 0 =N 0 /M×N Equation 2
ω 1=N 1/M×N 公式③ ω 1 =N 1 /M×N Equation 3
N
0+N
1=M×N 公式④
N 0 +N 1 =M×
ω 0+ω 1=1 公式⑤ ω 0 +ω 1 =1 Equation 5
μ=ω
0*μ
0+ω
1*μ
1 公式⑥
μ = ω 0 * μ 0 +
g=ω 0(μ 0-μ) 2+ω 1(μ 1-μ) 2 公式⑦ g=ω 0 (μ 0 -μ) 2 +ω 1 (μ 1 -μ) 2 Equation 7
结合上述条件,得到等价公式:g=ω 0ω 1(μ 0-μ 1) 2 公式⑧ Combining the above conditions, the equivalent formula is obtained: g = ω 0 ω 1 (μ 0 - μ 1 ) 2 Equation 8
遍历整个图像数据,得到使类间方差最大的阈值T,利用最大的阈值T做前景图像和背景图像的分割即可,遵循如下二值分割:The entire image data is traversed to obtain a threshold T that maximizes the variance between the classes, and the maximum threshold T is used to divide the foreground image and the background image, and the following binary segmentation is followed:
若I(x i,y i)>T,则I(x i,y i) binary=1 If I(x i , y i )>T, then I(x i , y i ) binary =1
若I(x i,y i)<T,则I(x i,y i) binary=0 If I(x i , y i ) < T, then I(x i , y i ) binary =0
其中,I(x i,y i) binary为二值化之后的图像数据,I(x i,y i)为第i个像素点。 Where I(x i , y i ) binary is image data after binarization, and I(x i , y i ) is the i-th pixel point.
S13,从二值化处理之后的图像数据中划分前景图像,将划分出的前景图像作为目标图像。S13, dividing the foreground image from the image data after the binarization processing, and using the divided foreground image as the target image.
进行了二值化处理之后,图像处理终端从图像数据中识别出哪些区域为前景图像(如值为0的像素点),即包含用户信息的目标图像。After the binarization processing, the image processing terminal recognizes from the image data which regions are foreground images (such as pixels having a value of 0), that is, target images containing user information.
当然,上述划分目标图像的方式只是作为示例,在一些实施例中,根据实际情况设置其他划分目标图像的方式,例如,增强图像数据的对比度之后,采用高斯模型提取图像数据中的前景图像作为目标图像,本公开对此不加以限制。另外,除了上述划分目标图像的方式外,本领域技术人员还可以根据实际需要采用其它划分目标图像的方式,本公开对此也不加以限制。Of course, the manner of dividing the target image is only an example. In some embodiments, other manners of dividing the target image are set according to actual conditions. For example, after enhancing the contrast of the image data, the foreground image in the image data is extracted by using a Gaussian model as a target. The image is not limited in this disclosure. In addition, in addition to the above-described manner of dividing the target image, those skilled in the art may also adopt other manners of dividing the target image according to actual needs, and the disclosure does not limit this.
S202,对目标图像标定边界区域。S202. Mark a boundary area of the target image.
确定边界区域,即确定目标图像的外边界、孔边界及其层次关系,这些边界区域和图像数据的区域具有一一对应关系,例如,在二值化图像中,外边界对应像素值为1的连通区域,孔边界对应像素值为0的连通区域。Determining the boundary region, that is, determining the outer boundary of the target image, the boundary of the hole, and the hierarchical relationship thereof, and the boundary regions and the regions of the image data have a one-to-one correspondence, for example, in the binarized image, the outer boundary corresponds to a pixel value of 1. The connected area, the hole boundary corresponds to a connected area with a pixel value of zero.
因此,在一些实施例中,用边界区域来表示和划分图像,不断遍历整个图像数据,从而标定出图像数据中用户信息的边界区域。Thus, in some embodiments, the boundary regions are used to represent and divide the image, traversing the entire image data, thereby calibrating the boundary regions of the user information in the image data.
在一些实施例中,对位于预设的指定区域(如离左侧和右侧边缘有一定距离的范围)中的目标图像进行扩充处理,对扩充处理之后的目标图像标定边界区域。In some embodiments, the target image located in a predetermined designated area (such as a range having a certain distance from the left and right edges) is subjected to expansion processing, and the boundary image is marked on the target image after the expansion processing.
在一些实施例中,用户头像等用户信息通常位于预设的指定区域,该指定区域内部存在较多的孔洞,因此,对该指定区域中的目标图像进行扩充处理,使得目标图像成为一个整体,方便进行后续的处理。In some embodiments, the user information such as the user's avatar is usually located in a preset designated area, and there are many holes in the designated area. Therefore, the target image in the designated area is expanded, so that the target image becomes a whole. Convenient for subsequent processing.
其中,扩充处理操作需要设定扩充算子D,将扩充算子D与二值图像数据I(x i,y i) binary做合并处理,得到处理后的二值图像为II(x i,y i) binary。 The expansion processing operation needs to set the expansion operator D, and the expansion operator D and the binary image data I(x i , y i ) binary are combined to obtain the processed binary image as II (x i , y i ) binary .
当然,对于用户名称等用户信息,或者会话框、会话记录、时间等并非待进行隐私保护的用户信息,则可以直接标定边界区域。Of course, for user information such as a user name, or user information that is not to be protected by privacy, such as a session frame, a session record, and a time, the boundary area can be directly calibrated.
S203,在所述边界区域的基础上生成候选区域。S203. Generate a candidate area on the basis of the boundary area.
对标定了边界区域的目标图像生成规范的目标区域。The target area of the target image generation specification for the boundary area is calibrated.
在一些实施例中,计算外接边界区域形成的最大矩形,作为目标区域。其中形成的最大矩形指矩形的面积最大。当然,除了矩形之外,在另一些实施例中,生成其他图形,例如,椭圆形、圆形、星形等,本公开对 此不加以限制。In some embodiments, the largest rectangle formed by the circumscribed boundary region is calculated as the target region. The largest rectangle formed therein refers to the largest area of the rectangle. Of course, in addition to the rectangle, in other embodiments, other graphics are generated, such as elliptical, circular, star, etc., and the disclosure is not limited thereto.
S204,在候选区域中确定会话窗口中用户信息所处的目标区域。S204. Determine, in the candidate area, a target area where the user information is located in the session window.
在图像数据中识别的目标图像,除了所需的用户信息之外,还可能包含其他信息,如会话框、会话记录、时间等,因此,在一些实施例中,从候选区域中进一步识别出待进行隐私保护的用户信息所处的目标区域。The target image identified in the image data may contain other information, such as a session box, session record, time, etc., in addition to the required user information, and thus, in some embodiments, further recognition from the candidate region The target area where the user information for privacy protection is located.
在一些实施例中,若待进行隐私保护的用户信息为用户头像,则确定位于预设的指定区域(如左侧和右侧边缘一定距离的范围)中的候选区域为会话窗口中用户头像所处的目标区域。在另一些实施例中,若待进行隐私保护的用户信息为用户名称,在一些情况下,该用户名称会进行显示,在另一些情况下,该用户名称不会进行显示。In some embodiments, if the user information to be privacy protected is a user avatar, determining that the candidate area in the preset designated area (such as a range of a certain distance from the left and right edges) is the user avatar in the session window. The target area at the location. In other embodiments, if the user information to be privacy protected is the user name, in some cases, the user name is displayed, and in other cases, the user name is not displayed.
因此,在识别用户名称时,在位于指定区域之外的区域查找会话窗口中会话框所处的候选区域,其中,会话框即为承载会话记录的区域。Therefore, when the user name is identified, the candidate area in the session window in the session window is searched for in an area outside the designated area, where the session box is the area carrying the session record.
在一些实施例中,位于指定区域之外候选图像为用户名称所处的区域,在另一些实施例中,位于指定区域之外候选图像为会话框、会话记录、时间等所处的区域。In some embodiments, the candidate image is outside the designated area as the area in which the user name is located, and in other embodiments, the candidate image outside the designated area is the area in which the session box, session record, time, and the like are located.
包含用户名称、会话记录、时间等信息的图像的高度、面积相同或相似,较难区分,而包含会话框承载会话记录的图像的高度、面积等参数均大于包含用户名称、会话记录、时间等信息的图像,较易区分,并且,用户名称与会话框、用户头像之间的相对位置是固定的,因此,通过比较高度、面积等参数,查找出会话窗口中的会话框,从而识别出用户名称。The height and area of the image including the user name, session record, time, and the like are the same or similar, and are difficult to distinguish. The parameters such as the height and area of the image containing the session record of the session frame are larger than the user name, session record, time, etc. The image of the information is easier to distinguish, and the relative position between the user name and the session box and the user's avatar is fixed. Therefore, by comparing parameters such as height and area, the session box in the session window is found, thereby identifying the user. name.
为了表示某个用户发送的某条会话记录,该用户的用户头像通常与该用户的会话记录连同会话框相邻显示,因此,查找至少部分纵坐标相同的用户头像所处的目标区域与会话框所处的候选区域,并计算该用户头像所处的目标区域(可以以顶部为准)与会话框所处的候选区域(可以以顶部为准)之间是纵坐标差值。In order to represent a certain session record sent by a user, the user's avatar of the user is usually displayed adjacent to the session record of the user along with the session box, so that the target area and the session box where at least part of the user avatar with the same ordinate is located are searched. The candidate region is located, and the target region in which the user avatar is located (which may be based on the top) and the candidate region in which the session frame is located (which may be based on the top) are the ordinate difference values.
当用户头像所处的目标区域与会话框所处的候选区域之间的纵坐标差值大于预设的阈值时,则位于用户头像与会话框之间的候选区域为会话窗口中用户名称所处的目标区域。When the ordinate difference between the target area where the user avatar is located and the candidate area where the session box is located is greater than a preset threshold, the candidate area located between the user avatar and the session box is where the user name is located in the session window. Target area.
当用户头像所处的目标区域与会话框所处的候选区域之间的纵坐标 差值小于或等于预设的阈值时,则会话窗口中不显示用户名称。When the ordinate difference between the target area where the user avatar is located and the candidate area where the session box is located is less than or equal to a preset threshold, the user name is not displayed in the session window.
将位于指定区域的候选区域设置为用户头像所处的目标区域,遍历高度、面积等参数最大的候选区域为会话框所在的区域,查找纵坐标至少部分相同的用户头像(候选区域)与会话框(候选区域),若用户头像与会话框两者之间位置差异大于预设的阈值,则将位于该用户头像(候选区域)与会话框(候选区域),之间的候选图像设置为用户名称。将会话窗口顶部的另一指定位置设置为群组名称所在的目标区域。Set the candidate area in the specified area to the target area where the user's avatar is located. The candidate area with the largest parameter such as traversal height and area is the area where the session box is located, and find the user avatar (candidate area) and the session box with at least the same ordinate. (candidate area), if the position difference between the user avatar and the session frame is greater than a preset threshold, the candidate image between the user avatar (candidate area) and the session frame (candidate area) is set as the user name. . Set another specified location at the top of the session window to the target zone where the group name is located.
当然,上述识别用户信息的方式只是作为示例,在实施本公开时,根据实际情况设置其他识别用户信息的方式,例如,将位于会话窗口顶部的另一指定区域的候选区域识别为用户名称或群组名称所处的目标区域,本公开对此不加以限制。另外,除了上述识别用户信息的方式外,本领域技术人员还可以根据实际需要采用其它识别用户信息的方式,本公开对此也不加以限制。Of course, the above manner of identifying user information is only an example. When implementing the present disclosure, other ways of identifying user information are set according to actual conditions, for example, identifying a candidate area of another designated area located at the top of the session window as a user name or group. The target area in which the group name is located is not limited in this disclosure. In addition, in addition to the above manner of identifying user information, those skilled in the art may also adopt other ways of identifying user information according to actual needs, and the disclosure does not limit this.
S103,在图像数据中的目标区域进行隐私保护处理。识别出用户信息所处的目标区域后,在该图像数据中,对该目标区域进行隐私保护处理,使得该用户信息在处理后的图像中无法清楚分辨,从而保护处于该目标区域中的用户信息,此后,用户可以将该图像数据分享到其他地方,而不会泄露其中的用户信息。S103: Perform privacy protection processing on the target area in the image data. After identifying the target area where the user information is located, in the image data, performing privacy protection processing on the target area, so that the user information cannot be clearly distinguished in the processed image, thereby protecting user information in the target area. After that, the user can share the image data to other places without revealing the user information.
在一些隐私保护处理的示例中,在图像数据中的目标区域涂抹指定大小的遮蔽图像(如红色图像、马赛克),获得目标图像数据。In some examples of the privacy protection process, the target area in the image data is smeared with a mask image of a specified size (eg, a red image, a mosaic) to obtain the target image data.
在一些实施例中,相同类型的用户信息采用相同大小的遮蔽图像,不同类型的用户信息采用的遮蔽图像大小也可以相同,也可以不相同。例如,涂抹用户头像的遮蔽图像是正方形,涂抹用户名称的遮蔽图像是长方形。In some embodiments, the same type of user information uses the same size of the occlusion image, and different types of user information may use the same or different occlusion image sizes. For example, the masked image that smears the user's avatar is a square, and the masked image that smears the user's name is a rectangle.
如果用户信息在会话窗口中被遮蔽了部分,则可以根据遮蔽的区域调整遮蔽图像的大小,使得遮蔽图像不涂抹到遮蔽的区域。If the user information is partially obscured in the session window, the size of the shadow image may be adjusted according to the shaded area such that the shadow image is not applied to the shaded area.
在一些实施例中,当用户头像在会话窗口的顶部移出时,用户头像的上面部分被遮蔽而下面部分未遮蔽,此时,调整遮蔽图像的大小,以涂抹露出的下面部分。In some embodiments, when the user avatar is removed at the top of the conversation window, the upper portion of the user avatar is obscured while the lower portion is unmasked, at which point the size of the occlusion image is adjusted to smear the exposed lower portion.
在一些实施例中,当用户头像在会话窗口的底部移入时,其下面部分遮蔽而上面部分未遮蔽,此时,调整遮蔽图像的大小,以涂抹露出的上面部分。In some embodiments, when the user's avatar is moved in at the bottom of the conversation window, the lower portion is shaded and the upper portion is unmasked. At this time, the size of the shadow image is adjusted to smear the exposed upper portion.
在一些实施例中,除了涂抹指定大小的遮蔽图像之外,还采用其他隐私保护处理,例如,覆盖其他遮蔽图像(如对用户头像覆盖卡通图像)、挖空处理等,对此不加以限制。In some embodiments, in addition to smearing a masked image of a specified size, other privacy protection processes are employed, such as overlaying other occlusion images (eg, overlaying a cartoon image on a user avatar), hollowing out, etc., without limitation.
S104,显示所述隐私图像数据。S104. Display the privacy image data.
在隐私图像数据中隐藏了用户信息,则可以显示给用户,待用户进行其他处理。If the user information is hidden in the privacy image data, it can be displayed to the user for other processing.
为使本领域技术人员更好地理解本公开实施例,以下通过具体的示例来说明本公开实施例中的图像处理方法。In order to enable those skilled in the art to better understand the embodiments of the present disclosure, the image processing method in the embodiments of the present disclosure will be described below by way of specific examples.
如图3A所示,本示例应用在移动终端中,监听截图操作,假设用户在即时通讯工具的一个群组中进行会话并截图。As shown in FIG. 3A, the example is applied in a mobile terminal to listen to a screenshot operation, assuming that the user performs a session and screenshots in a group of instant messaging tools.
此时,移动终端监听到截图操作,则获取截图获得的图像数据,检测图像数据中是否包含会话窗口。At this time, if the mobile terminal monitors the screenshot operation, the image data obtained by the screenshot is acquired, and whether the session window is included in the image data is detected.
若该图像数据包含会话窗口,则如图3B所示,生成提示信息,提示用户截图中包含隐私信息,是否对该图像数据进行隐私保护处理。If the image data includes a session window, as shown in FIG. 3B, a prompt message is generated to prompt the user to include privacy information in the screenshot and whether to perform privacy protection processing on the image data.
若用户点击“否”,则不对该图像数据进行隐私保护处理,直接显示该图像数据。If the user clicks "No", the image data is not subjected to privacy protection processing, and the image data is directly displayed.
若用户点击“是”,则对该图像数据进行隐私保护处理。If the user clicks "Yes", the image data is subjected to privacy protection processing.
如图3C所示,截图获得的图像数据为彩色图像数据(图中未示出),对该图像数据进行灰度处理,将彩色图像数据转换为灰度图像数据。As shown in FIG. 3C, the image data obtained by the screenshot is color image data (not shown), and the image data is subjected to gradation processing to convert the color image data into grayscale image data.
如图3D所示,对灰度处理之后的图像数据进行二值化处理,分离前景图像(目标图像)与背景图像。As shown in FIG. 3D, the image data after the gradation processing is binarized to separate the foreground image (target image) from the background image.
其中,前景图像(目标图像)中除了包含了用户头像、用户名称等待进行隐私保护的用户信息之外,还包含了会话框、会话记录等不进行隐私保护的用户信息。The foreground image (target image) includes user information such as a user box and a user name waiting for privacy protection, and includes user information such as a session box and a session record that are not protected by privacy.
如图3E所示,对于位于指定区域的前景图像(目标图像),如用户头像,则进行扩充处理并标定其边界区域,对于其他前景图像(目标图 像),则直接标定其边界区域。As shown in Fig. 3E, for the foreground image (target image) located in the designated area, such as the user's avatar, the expansion process is performed and the boundary area is calibrated, and for other foreground images (target image), the boundary area is directly calibrated.
如图3F所示,计算边界区域的最大外接矩形,将最大外接矩形作为候选区域。As shown in FIG. 3F, the maximum circumscribed rectangle of the boundary region is calculated, and the largest circumscribed rectangle is used as the candidate region.
如图3G所示,在图像数据(图中未示出彩色)中定位群组名称所在的目标区域,对该目标区域涂抹指定大小的遮蔽图像,从而获得隐私图像数据。As shown in FIG. 3G, the target area in which the group name is located is located in the image data (color not shown in the drawing), and the masked image of the specified size is applied to the target area, thereby obtaining the privacy image data.
其中,最上方的用户头像准备移出会话窗口,遮蔽了上面部分、露出下面部分,因此,修改遮蔽图像的大小,遮蔽露出的下面部分,而不对遮蔽的上面部分进行处理。The top user avatar is ready to move out of the session window, obscuring the upper portion and exposing the lower portion. Therefore, the size of the occlusion image is modified to shield the exposed lower portion without processing the upper portion of the occlusion.
如图3H所示,向用户显示隐私图像数据。As shown in FIG. 3H, the privacy image data is displayed to the user.
在本公开的一些实施例中,当检测到截图操作时,检测截图操作对应的截图内容,若截图内容包括会话窗口,则确定针对截图操作获得的图像数据的处理方式,若该处理方式为隐私保护处理,则在图像数据中对用户信息的目标区域进行隐私保护处理,获得隐私图像数据,并显示隐私图像数据,自动保护了会话窗口中用户的隐私信息,避免了启用专门的图像编辑工具进行手动涂抹,大大降低了处理的效率,一次处理一般不超过200毫秒,大大降低了处理的耗时,同时,隐私处理程序严格执行,避免了处理过量或过少的情况,减少了出错的几率,提高了处理的质量,并且,直接在截屏时对图像数据进行了替换,不影响用户正常的浏览。In some embodiments of the present disclosure, when the screenshot operation is detected, the screenshot content corresponding to the screenshot operation is detected, and if the screenshot content includes the session window, determining the processing manner of the image data obtained for the screenshot operation, if the processing method is privacy The protection process performs privacy protection processing on the target area of the user information in the image data, obtains the privacy image data, and displays the privacy image data, automatically protecting the privacy information of the user in the session window, and avoids enabling the special image editing tool to be performed. Manually smearing greatly reduces the efficiency of processing. The processing time is generally less than 200 milliseconds, which greatly reduces the processing time. At the same time, the privacy processing program is strictly executed, avoiding excessive or too little processing, and reducing the chance of error. The quality of the processing is improved, and the image data is directly replaced at the time of screen capture, without affecting the normal browsing of the user.
S105,对所述隐私图像数据生成操作接口。S105. Generate an operation interface for the privacy image data.
对隐私图像数据生成操作接口,包括分享操作、收藏操作、删除操作、编辑操作,当用户点击更多的选项时,显示播放幻灯片、打印、重命名、旋转、显示在地图上等操作接口,供用户选择。需要说明的是,对于方法实施例,为了简单描述,将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本公开实施例并不受所描述的动作顺序的限制,因为依据本公开实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于一些示例性的实施例,所涉及的动作并不一定是本公开实施例所必须的。The operation interface for generating the privacy image data includes a sharing operation, a collecting operation, a deleting operation, and an editing operation, and when the user clicks more options, an operation interface for playing a slide show, printing, renaming, rotating, displaying on the map, etc. is displayed. For the user to choose. It should be noted that, for the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should understand that the embodiments of the present disclosure are not limited by the described action sequence, because In certain embodiments of the present disclosure, certain steps may be performed in other sequences or concurrently. In addition, those skilled in the art should also understand that the embodiments described in the specification belong to some exemplary embodiments, and the actions involved are not necessarily required by the embodiments of the present disclosure.
S106,当所述操作接口被选定时,对所述隐私图像数据执行所述操 作接口对应的图像操作。S106. Perform an image operation corresponding to the operation interface on the privacy image data when the operation interface is selected.
在本公开的一些实施例中,用户浏览了隐私图像数据,可以在隐私图像数据的下方生成针对该隐私图像数据的操作接口。In some embodiments of the present disclosure, the user browses the privacy image data, and an operational interface for the privacy image data can be generated below the privacy image data.
用户可以按照需要点击其中的某个操作接口,选定该操作接口,从而对隐私图像数据执行被选定的操作接口对应的图像操作。The user can click on one of the operation interfaces as needed, and select the operation interface to perform an image operation corresponding to the selected operation interface on the privacy image data.
在具体操作中,图像操作包括如下的至少一种:In a specific operation, the image operation includes at least one of the following:
分享操作、收藏操作、删除操作、编辑操作。Share operations, favorite operations, delete operations, edit operations.
其中,分享操作可以指调用其他应用的接口,将该隐私图像数据分享至该应用。The sharing operation may refer to calling an interface of another application to share the privacy image data to the application.
收藏操作可以指将该隐私图像数据收藏至图库的特定位置。A favorite operation may refer to the collection of the private image data to a specific location of the gallery.
删除操作可以指删除该隐私图像数据。The delete operation may refer to deleting the privacy image data.
编辑操作可以指对该隐私图像数据进行旋转、修剪、滤镜、虚化等额外的编辑处理。The editing operation may refer to additional editing processing such as rotation, trimming, filtering, blurring, and the like of the privacy image data.
当然,上述图像操作只是作为示例,在实施本公开实施例时,可以根据实际情况设置其他图像操作,例如,播放幻灯片、打印、重命名、旋转、显示在地图上,等等,本公开实施例对此不加以限制。另外,除了上述图像操作外,本领域技术人员还可以根据实际需要采用其它图像操作,本公开实施例对此也不加以限制。Of course, the above image operations are only examples. When implementing the embodiments of the present disclosure, other image operations may be set according to actual conditions, for example, playing a slide show, printing, renaming, rotating, displaying on a map, etc., the implementation of the present disclosure This example does not limit this. In addition, other image operations may be employed by those skilled in the art in addition to the above-described image operations, and the embodiments of the present disclosure do not limit this.
作为对图2所示图像处理方法的一些变型,可以不完全按照图2所示的步骤和/或顺序执行所述图像处理方法。在本公开的一些实施例中,可以省略一些操作步骤,或者改变一些步骤的执行顺序。例如,所述图像处理方法可以仅包括S101~S103,或者所述图像处理方法无需包括S105~S106或S100~S100”;再例如,S100”的执行顺序可以位于S101之后(而不是之前)。As some variations on the image processing method shown in FIG. 2, the image processing method may not be completely performed in accordance with the steps and/or sequences shown in FIG. 2. In some embodiments of the present disclosure, some of the operational steps may be omitted, or the order of execution of some of the steps may be changed. For example, the image processing method may include only S101 to S103, or the image processing method need not include S105 to S106 or S100 to S100"; and, for example, the execution order of S100" may be located after S101 (instead of before).
图4为示出了本公开一些实施例提供的一种图像处理的结构框图。所述图像处理装置4包括存储器41、处理器42、以及存储在存储器41中并可在处理器42上运行的计算机程序411。所述处理器42被配置为:FIG. 4 is a structural block diagram showing an image processing provided by some embodiments of the present disclosure. The
(1)获取包含会话窗口的图像数据;(1) acquiring image data including a session window;
(2)在所述图像数据中识别会话窗口中用户信息所处的目标区域; 以及(2) identifying, in the image data, a target area in which the user information is located in the session window;
(3)在所述图像数据中对目标区域进行隐私保护处理。(3) Performing a privacy protection process on the target area in the image data.
其中,用户信息包括如下的至少一种:The user information includes at least one of the following:
群组头像、群组名称、用户名称、用户头像。Group avatar, group name, user name, user avatar.
在一些实施例中,在被配置为(2)在所述图像数据中识别会话窗口中用户信息所处的目标区域时,所述处理器还被配置为:In some embodiments, when configured to (2) identify in the image data the target area in which the user information is located in the session window, the processor is further configured to:
(21)从所述图像数据中划分目标图像;(21) dividing a target image from the image data;
(22)对目标图像标定边界区域;(22) calibrating the boundary area to the target image;
(23)基于边界区域生成候选区域;以及(23) generating a candidate region based on the boundary region;
(24)在候选区域中确定会话窗口中用户信息所处的目标区域。(24) Determining a target area in which the user information is located in the session window in the candidate area.
在一些实施例中,在被配置为(21)从图像数据中划分目标图像时,所述处理器还被配置为:In some embodiments, when configured to (21) divide a target image from image data, the processor is further configured to:
(211)对所述图像数据进行灰度处理;(211) performing grayscale processing on the image data;
(212)对灰度处理之后的图像数据进行二值化处理;以及(212) performing binarization processing on the image data after the gradation processing;
(213)从二值化处理之后的图像数据中划分前景图像,作为目标图像。(213) The foreground image is divided from the image data after the binarization processing as a target image.
在一些实施例中,所述处理器被配置为(22)对目标图像标定边界区域时,所述处理器还被配置为:In some embodiments, when the processor is configured to (22) calibrate a boundary region to a target image, the processor is further configured to:
(221)对位于预设的指定区域中的目标图像进行扩充处理;以及(221) augmenting the target image located in the preset designated area;
(222)对扩充处理之后的目标图像标定边界区域。(222) The boundary area is marked for the target image after the expansion processing.
在一些实施例中,所述处理器被配置为(23)基于边界区域生成候选区域时,所述处理器还被配置为:In some embodiments, the processor is configured to (23) generate a candidate region based on the boundary region, the processor further configured to:
计算外接边界区域的最大矩形,将计算出的最大矩形的区域作为目标区域。Calculate the largest rectangle of the circumscribed boundary area, and use the calculated area of the largest rectangle as the target area.
在一些实施例中,所述处理器被配置为(24)在候选区域中确定会话窗口中用户信息所处的目标区域时,所述处理器还被配置为:In some embodiments, the processor is configured to (24) determine, in the candidate region, a target region in which the user information is located in the session window, the processor further configured to:
(241)确定位于预设的指定区域中的候选区域为会话窗口中用户头像所处的目标区域;(241) determining that the candidate area located in the preset designated area is the target area where the user avatar is located in the session window;
和/或,and / or,
(241’)在位于指定区域之外的区域查找会话窗口中会话框所处的候选区域;(241') finding a candidate area in which the session frame is located in the session window in an area outside the designated area;
(242’)查找至少部分纵坐标相同的用户头像所处的目标区域与会话框所处的候选区域;以及(242') finding a target area in which at least part of the user avatar having the same ordinate is located and a candidate area in which the session box is located;
(243’)当用户头像所处的目标区域与会话框所处的候选区域之间的纵坐标差值大于预设的阈值时,确定位于用户头像与会话框之间的候选区域为会话窗口中用户名称所处的目标区域。(243') determining that the candidate area between the user avatar and the session box is in the session window when the ordinate difference between the target area where the user avatar is located and the candidate area where the session box is located is greater than a preset threshold The target area where the user name is located.
在一些实施例中,所述处理器被配置为(3)在图像数据中对目标区域进行隐私保护处理时,所述处理器还被配置为:In some embodiments, the processor is configured to (3) when performing privacy protection processing on the target area in the image data, the processor is further configured to:
在图像数据中的目标区域涂抹指定大小的遮蔽图像。A masked image of a specified size is applied to the target area in the image data.
在本公开的一些实施例中,所述处理器还被配置为:In some embodiments of the present disclosure, the processor is further configured to:
(4)对所述隐私图像数据生成操作接口;(4) generating an operation interface for the privacy image data;
(5)当所述操作接口被选定时,对所述隐私图像数据执行所述操作接口对应的图像操作;(5) performing an image operation corresponding to the operation interface on the privacy image data when the operation interface is selected;
其中,所述图像操作包括如下的至少一种:Wherein, the image operation comprises at least one of the following:
分享操作、收藏操作、删除操作、编辑操作。Share operations, favorite operations, delete operations, edit operations.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
本公开一些实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,其中,计算机程序被处理器执行时实现所述图像处理方法。Some embodiments of the present disclosure provide a computer readable storage medium storing a computer program, wherein the image processing method is implemented when the computer program is executed by a processor.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments can be referred to each other.
本领域内的技术人员应明白,本公开的实施例可提供为方法、装置、或计算机程序产品。因此,本公开实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算 机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as a method, apparatus, or computer program product. Thus, embodiments of the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, embodiments of the present disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本公开实施例是参照根据本公开实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生被配置为实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present disclosure are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device Means are generated that are configured to implement the functions specified in one or more blocks of the flowchart or in a block or blocks of the flowchart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供被配置为实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device such that a series of operational steps are performed on the computer or other programmable terminal device to produce computer-implemented processing, such that the computer or other programmable terminal device The instructions executed above provide steps that are configured to implement the functions specified in one or more of the flow or processes and/or block diagrams of a block or blocks.
尽管已描述了本公开的一些实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本公开实施例范围的所有变更和修改。Although a few embodiments of the present disclosure have been described, those skilled in the art can make additional changes and modifications to the embodiments once they are aware of the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
在本文中,第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要 素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。以上对本公开所提供的一种图像处理方法和一种图像处理装置,进行了详细介绍,本文中应用了具体个例对本公开的原理及实施方式进行了阐述,以上实施例的说明只是被配置为帮助理解本公开的方法及其核心思想;同时,对于本领域的一般技术人员,依据本公开的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本公开的限制。In this document, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual. Relationship or order. Furthermore, the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, or terminal device that includes a plurality of elements includes not only those elements but also Other elements that are included, or include elements inherent to such a process, method, article, or terminal device. In the absence of further limitations, the elements defined by the phrase "comprising a ..." do not exclude the presence of additional equivalent elements in the process, method, article, or terminal device that comprises the element. An image processing method and an image processing apparatus provided by the present disclosure have been described in detail above. The principles and implementations of the present disclosure have been described using specific examples. The description of the above embodiments is only configured as To help understand the method of the present disclosure and its core idea; at the same time, for those skilled in the art, according to the idea of the present disclosure, there will be changes in the specific embodiments and application scopes. It should not be construed as limiting the disclosure.
Claims (18)
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810215678.XA CN108629200A (en) | 2018-03-15 | 2018-03-15 | A kind of image processing method and device |
| CN201810215678.X | 2018-03-15 | ||
| CN201810215115.0 | 2018-03-15 | ||
| CN201810215115.0A CN108563967A (en) | 2018-03-15 | 2018-03-15 | A kind of screenshot method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019174606A1 true WO2019174606A1 (en) | 2019-09-19 |
Family
ID=67907430
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/078069 Ceased WO2019174606A1 (en) | 2018-03-15 | 2019-03-14 | Image processing method and terminal |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2019174606A1 (en) |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140181697A1 (en) * | 2012-12-20 | 2014-06-26 | Dropbox, Inc. | Systems and methods for facilitating communication between users of a content management service |
| CN104282031A (en) * | 2014-09-19 | 2015-01-14 | 广州三星通信技术研究有限公司 | Method and device for processing picture to be output and terminal |
| CN106775333A (en) * | 2017-02-16 | 2017-05-31 | 深圳市茁壮网络股份有限公司 | A kind of screenshotss method and device |
| WO2017128252A1 (en) * | 2016-01-28 | 2017-08-03 | 吕璇 | Data collection method for picture processing technology and intelligent mobile terminal |
| CN107145800A (en) * | 2017-05-31 | 2017-09-08 | 北京小米移动软件有限公司 | Privacy information protection method and device, terminal and storage medium |
| CN107644172A (en) * | 2016-07-20 | 2018-01-30 | 平安科技(深圳)有限公司 | The guard method of content displaying and device |
| CN108563967A (en) * | 2018-03-15 | 2018-09-21 | 青岛海信移动通信技术股份有限公司 | A kind of screenshot method and device |
| CN108629200A (en) * | 2018-03-15 | 2018-10-09 | 青岛海信移动通信技术股份有限公司 | A kind of image processing method and device |
-
2019
- 2019-03-14 WO PCT/CN2019/078069 patent/WO2019174606A1/en not_active Ceased
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140181697A1 (en) * | 2012-12-20 | 2014-06-26 | Dropbox, Inc. | Systems and methods for facilitating communication between users of a content management service |
| CN104282031A (en) * | 2014-09-19 | 2015-01-14 | 广州三星通信技术研究有限公司 | Method and device for processing picture to be output and terminal |
| WO2017128252A1 (en) * | 2016-01-28 | 2017-08-03 | 吕璇 | Data collection method for picture processing technology and intelligent mobile terminal |
| CN107644172A (en) * | 2016-07-20 | 2018-01-30 | 平安科技(深圳)有限公司 | The guard method of content displaying and device |
| CN106775333A (en) * | 2017-02-16 | 2017-05-31 | 深圳市茁壮网络股份有限公司 | A kind of screenshotss method and device |
| CN107145800A (en) * | 2017-05-31 | 2017-09-08 | 北京小米移动软件有限公司 | Privacy information protection method and device, terminal and storage medium |
| CN108563967A (en) * | 2018-03-15 | 2018-09-21 | 青岛海信移动通信技术股份有限公司 | A kind of screenshot method and device |
| CN108629200A (en) * | 2018-03-15 | 2018-10-09 | 青岛海信移动通信技术股份有限公司 | A kind of image processing method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7058760B2 (en) | Image processing methods and their devices, terminals and computer programs | |
| US9953506B2 (en) | Alarming method and device | |
| EP3179408B1 (en) | Picture processing method and apparatus, computer program and recording medium | |
| JP5734910B2 (en) | Information providing system and information providing method | |
| WO2020134866A1 (en) | Key point detection method and apparatus, electronic device, and storage medium | |
| CN108563967A (en) | A kind of screenshot method and device | |
| EP3038334B1 (en) | Method and device for replying to a call | |
| WO2020181728A1 (en) | Image processing method and apparatus, electronic device, and storage medium | |
| WO2019105457A1 (en) | Image processing method, computer device and computer readable storage medium | |
| CN107707824B (en) | Shooting method, shooting device, storage medium and electronic equipment | |
| CN107566742B (en) | Shooting method, shooting device, storage medium and electronic equipment | |
| WO2022077958A1 (en) | Water-body segmentation method and apparatus, electronic device, and storage medium | |
| CN108093177B (en) | Image acquisition method, device, storage medium and electronic device | |
| CN105809174A (en) | Method and device for identifying image | |
| AU2014271204B2 (en) | Image recognition of vehicle parts | |
| WO2019201197A1 (en) | Image desensitization method, electronic device and storage medium | |
| CN111523346A (en) | Image recognition method and device, electronic equipment and storage medium | |
| CN114299056A (en) | Defect point recognition method of image and defect image recognition model training method | |
| CN107835118A (en) | Information processing method, device, mobile terminal, and computer-readable storage medium | |
| CN111583142A (en) | Image noise reduction method and device, electronic device and storage medium | |
| WO2021068895A1 (en) | Screen capturing method and terminal device thereof | |
| CN114897915B (en) | Image segmentation method, device, electronic device and storage medium | |
| CN112016443A (en) | Method and device for identifying same lines, electronic equipment and storage medium | |
| CN114090803B (en) | Structure reduction method and device of structure diagram | |
| CN111611470A (en) | A data processing method, device and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19767410 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/12/2020) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19767410 Country of ref document: EP Kind code of ref document: A1 |