CN111107264A - Image processing method, image processing device, storage medium and terminal - Google Patents

Image processing method, image processing device, storage medium and terminal Download PDF

Info

Publication number
CN111107264A
CN111107264A CN201911093931.XA CN201911093931A CN111107264A CN 111107264 A CN111107264 A CN 111107264A CN 201911093931 A CN201911093931 A CN 201911093931A CN 111107264 A CN111107264 A CN 111107264A
Authority
CN
China
Prior art keywords
pattern
scene
image
original image
information
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.)
Pending
Application number
CN201911093931.XA
Other languages
Chinese (zh)
Inventor
崔龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201911093931.XA priority Critical patent/CN111107264A/en
Publication of CN111107264A publication Critical patent/CN111107264A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/20Scenes; Scene-specific elements in augmented reality scenes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Abstract

The embodiment of the application discloses an image processing method, an image processing device, a storage medium and a terminal, wherein the method comprises the following steps: collecting an original image through a camera; recognizing a scene comprising a preset type in the original image, and detecting shape parameter information of the scene; wherein the shape parameter information comprises contour information and texture information; if a pattern matched with the shape information parameters is inquired in a database, superposing the pattern on the scenery; and displaying the superposed original image through a display unit. The pattern is stored in the database and manually drawn by a user, so that the accuracy of drawing the pattern by photographing and identifying is improved, and the pattern data of the database is enriched.

Description

Image processing method, image processing device, storage medium and terminal
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an image processing method, an image processing apparatus, a storage medium, and a terminal.
Background
With the increase of the computing power of the terminal, especially with the increase of the image processing power of the image processing unit (GPU), the terminal has more and more abundant image processing functions, such as: the method comprises the following steps of beautifying, image correction, image restoration and the like, because the image processing functions are homogeneous, the attraction degree to a user is not high, the viscosity of the user is obviously reduced, and how to develop a new image processing function for a terminal so as to improve the viscosity of the user is a hotspot of current research.
Disclosure of Invention
The embodiment of the application provides an image processing method, an image processing device, a computer storage medium and a terminal, and aims to solve the technical problem of insufficient user viscosity caused by homogenization of image processing functions in the prior art. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides an image processing method, where the method includes:
collecting an original image through a camera;
recognizing a scene comprising a preset type in the original image, and detecting shape parameter information of the scene; wherein the shape parameter information comprises contour information and texture information;
if a pattern matched with the shape information parameters is inquired in a database, superposing the pattern on the scenery;
and displaying the superposed original image through a display unit.
In a second aspect, an embodiment of the present application provides an image processing apparatus, including:
the image acquisition module is used for acquiring an original image through a camera;
the scene recognition module is used for recognizing scenes which comprise preset types in the original image and detecting shape parameter information of the scenes; wherein the shape parameter information comprises contour information and texture information;
the automatic pattern superposition module is used for superposing the patterns on the scenery when the patterns matched with the shape information parameters are inquired in a database;
and the image display module is used for displaying the superposed original images through the display unit.
In a third aspect, embodiments of the present application provide a computer storage medium having a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides a terminal, which may include: a memory and a processor; wherein the memory stores a computer program adapted to be loaded by the memory and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
when the scheme of the embodiment of the application is executed, the original image is obtained by utilizing the camera application program carried by the terminal, the scenery in the original image is identified, the type and the shape information parameters of the scenery are included, the pattern matched with the scenery is searched in the database according to the type and the shape information parameters of the scenery, the pattern is superposed to the original image, and the superposed image is displayed. And if the pattern matched with the scenery is not found in the database, guiding the user to manually draw the pattern, superposing the pattern drawn by the user on the original image, storing the pattern drawn by the user in the database, and displaying the pattern which is completely superposed by the user. The problem that the storage pattern in the database is incomplete is considered, the manual drawing pattern of the guide user is added, the richness of the pattern data of the database is increased, the accuracy of drawing the pattern in a superposition mode is improved, and meanwhile the viscosity of the user is also improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an operating system and a user space provided in an embodiment of the present application;
FIG. 3 is an architectural diagram of the android operating system of FIG. 1;
FIG. 4 is an architecture diagram of the IOS operating system of FIG. 1;
fig. 5 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 7 is a schematic diagram illustrating an effect of an image processing method according to an embodiment of the present application;
fig. 8 is a schematic effect diagram of an image processing method according to an embodiment of the present application;
fig. 9 is a schematic effect diagram of an image processing method according to an embodiment of the present application;
FIG. 10 is a schematic diagram illustrating an effect of an image processing method according to an embodiment of the present application;
fig. 11 is a schematic effect diagram of an image processing method according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
The first embodiment is as follows:
referring to fig. 1, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. A terminal in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal using various interfaces and lines, performs various functions of the terminal and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like, and the operating system may be an Android (Android) system (including a system based on Android system depth development), an IOS system developed by apple inc (including a system based on IOS system depth development), or other systems. The storage data area may also store data created by the terminal in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 2, the memory 120 may be divided into an operating system space, in which an operating system runs, and a user space, in which native and third-party applications run. In order to ensure that different third-party application programs can achieve a better operation effect, the operating system allocates corresponding system resources for the different third-party application programs. However, the requirements of different application scenarios in the same third-party application program on system resources are different, for example, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third-party application program.
In order to enable the operating system to distinguish a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.
Taking an operating system as an Android system as an example, programs and data stored in the memory 120 are as shown in fig. 3, and a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360, and an application layer 380 may be stored in the memory 120, where the Linux kernel layer 320, the system runtime library layer 340, and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides underlying drivers for various hardware of the terminal, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, a power management, and the like. The system runtime library layer 340 provides a main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system runtime library layer 340 is an Android runtime library (Android runtime), which mainly provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building an application, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 380, and the application programs may be native application programs carried by the operating system, such as a contact program, a short message program, a clock program, a camera application, and the like; or a third-party application developed by a third-party developer, such as a game-like application, an instant messaging program, a photo beautification program, a shopping program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 4, and the IOS system includes: a Core operating system Layer 420(Core OS Layer), a Core Services Layer 440(Core Services Layer), a Media Layer 460(Media Layer), and a touchable Layer 480(Cocoa Touch Layer). The kernel operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the core services layer 440. The core services layer 440 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, as required by the application. The media layer 460 provides audiovisual related interfaces for applications, such as graphics image related interfaces, audio technology related interfaces, video technology related interfaces, audio video transmission technology wireless playback (AirPlay) interfaces, and the like. Touchable layer 480 provides various common interface-related frameworks for application development, and touchable layer 480 is responsible for user touch interaction operations on the terminal. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework shown in FIG. 4, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 440 and a UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
The Android system can be referred to as a mode and a principle for realizing data communication between the third-party application program and the operating system in the IOS system, and details are not repeated herein.
The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens for receiving touch operations of a user on or near the touch display screens by using any suitable object such as a finger, a touch pen, and the like, and displaying user interfaces of various applications. The touch display screen is generally provided at a front panel of the terminal. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.
The terminal of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink panel, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. The user can view information such as displayed text, images, video, etc. using the display device on the terminal 101. The terminal may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
In the terminal shown in fig. 1, the processor 110 may be configured to call an application program stored in the memory 120 and specifically execute the image processing method according to the embodiment of the present application.
When the scheme of the embodiment of the application is executed, the original image is obtained by using a camera application program carried by the terminal, the scenery in the original image is identified through algorithm processing of an AI intelligent chip, the type and the shape information parameters of the scenery are included, the pattern matched with the scenery is searched in the database according to the type and the shape information parameters of the scenery, the pattern is superposed to the original image, and the superposed image is displayed. And if the pattern matched with the scenery is not found in the database, guiding the user to manually draw the pattern, superposing the pattern drawn by the user on the original image, storing the pattern drawn by the user in the database, and displaying the pattern drawn by the user. The problem that the storage pattern in the database is incomplete is considered, the manual drawing pattern of the guide user is added, the richness of the pattern data of the database is increased, the accuracy of drawing the pattern in a superposition mode is improved, and meanwhile the viscosity of the user is also improved.
In the following method embodiments, for convenience of description, only the main execution body of each step is described as a terminal.
Example two:
fig. 5 is a schematic flow chart of an image processing method according to an embodiment of the present disclosure. As shown in fig. 5, the method of the embodiment of the present application may include the steps of:
s501, collecting an original image through a camera.
Generally, a terminal recognizes a trigger event executed by a user to generate a photographing instruction, where the photographing instruction is used to start a camera application program to perform a photographing operation and collect an original image, and the type of the trigger event may be a touch event, a key event, or a voice control event.
For example: the terminal display screen displays various application icons, the touch event is that a user touches a camera application icon of the display screen with a finger, and the terminal receives a touch response to start a camera application program; the key event is that a user presses a certain key of the terminal by a finger, and the terminal receives a key response to start a camera application program; the voice control event is that a user speaks a command of 'taking a picture' or 'eggplant', and the terminal receives a voice command to start a camera application program.
S502, recognizing the scenery comprising the preset type in the original image, and detecting the shape parameter information of the scenery.
In general, the shape parameter information indicates the shape characteristics of the scene, including the outline, size, and position in the original image of the scene. Recognizing a scene including a preset type in an original image, including: extracting image characteristic information of an original image, inputting the image characteristic information into a preset scenery type identification model to obtain the scenery type of the scenery included in the original image, simultaneously marking the scenery, and detecting the shape parameter information of the scenery after the scenery is marked.
Wherein, the preset type scenery comprises natural scenery with remarkable outlines such as clouds, mountains and the like; the image characteristic information refers to color characteristics, texture characteristics, shape characteristics and spatial relationship characteristics of an image, the color characteristics and the texture characteristics of the image are surface properties of scenes, the shape characteristics mainly refer to outlines and shapes of the scenes, and the spatial relationship characteristics refer to the mutual spatial position or relative direction relationship among the scenes; the scene type recognition model is an image recognition model which mainly comprises a template matching model, a prototype matching model and the like; the shape parameter information of the scene contains contour information and texture information of the scene.
And S503, if the pattern matched with the shape information parameters is inquired in the database, superposing the pattern on the scenery.
Generally, the mapping relationship between the shape parameter information and the pattern is pre-stored or pre-configured in a database of the terminal, and the database may be disposed on the terminal or on the server, which is not limited in the embodiment of the present application. The terminal queries in the database based on the shape parameter information of the preset type of scenery recognized in S502, and if a pattern matching the shape parameter information of the scenery is queried in the database, superimposes the queried pattern on the corresponding scenery, for example: the pattern in the database may be a line pattern of unfilled colors that may be superimposed on top of the scene or superimposed on the scene below. The pattern superposition means that the scenery and the pattern matched with the scenery are aligned by using an alignment algorithm, the geometric center of the pattern matched with the scenery is overlapped with the geometric center of the scenery, and the layer where the pattern matched with the scenery is located on the layer where the scenery is located.
And S504, displaying the superposed original image through a display unit.
In general, based on the original image of the superimposed pattern obtained in S503, the camera stores the superimposed original image, and displays the superimposed scene on the touch display screen of the terminal. The display unit refers to a touch display screen of the terminal.
When the scheme of the embodiment of the application is executed, the original image is obtained by using a camera application program carried by the terminal, the scenery in the original image is identified through algorithm processing of an AI intelligent chip, the type and the shape information parameters of the scenery are included, the pattern matched with the scenery is searched in the database according to the type and the shape information parameters of the scenery, the pattern is superposed to the original image, and the superposed image is displayed. And if the pattern matched with the scenery is not found in the database, guiding the user to manually draw the pattern, superposing the pattern drawn by the user on the original image, storing the pattern drawn by the user in the database, and displaying the pattern which is completely superposed by the user. The problem that the storage pattern in the database is incomplete is considered, the manual drawing pattern of the guide user is added, the richness of the pattern data of the database is increased, the accuracy of drawing the pattern in a superposition mode is improved, and meanwhile the viscosity of the user is also improved.
Example three:
fig. 6 is a schematic flow chart of an image processing method according to an embodiment of the present disclosure. As shown in fig. 6, the method of the embodiment of the present application may include the steps of:
s601, collecting an original image through a camera.
See S501 for details in general.
S602, extracting image characteristic information of the original image.
Generally, the feature information of the image includes: color features, texture features, shape features, and spatial relationship features. Extracting the image feature information of the original image refers to acquiring the above feature information of the image. Optionally, before extracting the image feature information of the image, a preprocessing operation may be performed on the image.
The preprocessing operation refers to operations of eliminating noise of an image, removing blur, enhancing contrast and the like. The pre-processing operation on the image generally includes three steps, namely firstly performing graying processing on the image, secondly performing geometric transformation, and finally performing image enhancement.
Graying processing means that each pixel point in the pixel point matrix satisfies the following relationship: r (red), G (green), B (blue), where a color represents a gray-scale color, where the value of R (G) is a gray-scale value. Therefore, each pixel of the gray image only needs one byte to store the gray value (also called intensity value and brightness value), and the gray range is 0-255. The color image is grayed by four methods, namely a component method, a maximum value method, an average value method and a weighted average method.
The geometric transformation processing of the image, also called image space transformation, is to process the acquired original image through geometric transformation such as translation, transposition, mirroring, rotation, scaling and the like, and is used for correcting the system error of the image acquisition system and the random error of the instrument position (imaging angle, perspective relation and lens self-reason).
The image enhancement means to enhance useful information in an image, and generally means to remove noise in the image, make edges of the image clearer, highlight certain properties in the image and the like, so that the image quality is improved, the information content is enriched, and the image interpretation and recognition effects are enhanced. Image enhancement algorithms can generally be divided into two broad categories: a spatial domain method and a frequency domain method.
A color feature is a global feature, which refers to the surface property of a scene corresponding to an image or a certain image area. Generally, a color feature is a feature based on pixels, and all pixels in an image or a certain image region have their own contribution. The common feature extraction and matching method for color features comprises the following steps: color histograms, color sets, color moments, color aggregate vectors, and the like. The color histogram is used for simply describing the global distribution of colors in an image, namely the proportion of different colors in the whole image, and is suitable for describing images which are difficult to automatically segment and images which do not need to consider the space position of an object. The color set is to firstly convert an image from a three-primary-color (red, green, blue, RGB for short) color space into a visually balanced color space, such as a Hue (Hue, Saturation, Value, HSV for short) space, and quantize the color space into a plurality of handles; second, the image is divided into several regions by using an automatic color segmentation technique, and each region is indexed by a certain color component of the quantized color space, so that the image is expressed as a binary color index set. The color moments are used to represent any distribution of color in the image. Since the color distribution information is mainly concentrated in the low order moments, it is sufficient to express the color distribution of the image using only the first order moment (mean), the second order moment (variance), and the third order moment (skewness) of the color. And the color aggregation vector is used for dividing pixels belonging to each handle of the color histogram into two parts, wherein if the area of a continuous region occupied by some pixels in the handle is larger than a given threshold value, the pixels in the region are aggregated pixels, and otherwise, the pixels are non-aggregated pixels.
Texture features, also a global feature, refer to surface properties of a scene corresponding to an image or an image region. Unlike color features, texture features are not pixel-based features, which are statistical features that require statistical calculations in regions containing multiple pixels. The common feature extraction and matching method for the textural features comprises the following steps: statistical methods, geometric methods, modeling methods, and signal processing methods. A typical method of the statistical method is to extract texture features from an autocorrelation function of an image (i.e., an energy spectrum function of the image), that is, to extract feature parameters such as thickness and directionality of the texture by calculating the energy spectrum function of the image.
Shape features are retrieved by efficiently using objects of interest in the image, and a commonly used feature extraction and matching method includes: a boundary feature method, a Fourier shape descriptor method, a geometric parameter method, a shape invariant moment method and a shape feature extraction and matching method based on wavelets and relative moments.
The spatial relationship characteristic refers to the mutual spatial position or relative direction relationship among a plurality of targets segmented from the image, and these relationships can be also divided into a connection/adjacency relationship, an overlapping/overlapping relationship, an inclusion/containment relationship, and the like. Two common methods are used for extracting spatial relationship features, one method is that firstly, an image is automatically segmented, object or color regions contained in the image are divided, then image features are extracted according to the regions, and an index is established; another approach simply divides the image evenly into regular sub-blocks, then extracts features for each image sub-block and builds an index.
For example: as shown in fig. 7, a pair of original images acquired by the terminal through the camera includes a blue sky white cloud, and the terminal performs a preprocessing operation on the original images, where the preprocessing operation includes noise removal, image enhancement, and the like. And then the terminal extracts the image characteristic information of the original image, including color characteristics, texture characteristics, shape characteristics and spatial relationship characteristics. Firstly, color features are adopted, the image comprises blue and white, the color of each pixel point in the image is extracted by utilizing a color feature extraction method, the image is divided into a plurality of areas by utilizing a color automatic segmentation technology, each area is indexed by using a certain color component of a quantized color space, for example, the blue is used for indexing in the area with blue sky, the white is used for indexing in the area with white cloud, and therefore the image is expressed into a binary color index set. And identifying texture information of the scenery in the image by using the texture characteristics, and extracting characteristic parameters such as the thickness, the directionality and the like of the texture by calculating an energy spectrum function of the image. As shown in fig. 7, the texture thickness of the blue sky white cloud and the directionality of the blue sky white cloud are extracted by the above method. And identifying shape information of the scene in the image by using the shape characteristics, such as the shape and the outline of a blue sky area and the shape and the outline of a white cloud. The spatial relationship feature is used for identifying spatial relationship information of a scene in an image, such as: in fig. 7, spatial position information between white jade and blue sky represents: the white clouds are inlaid in blue sky.
S603, inputting the image characteristic information into a preset scene type identification model to obtain the scene type of the scene included in the original image.
In general, the feature information of the original image identified according to S602 includes: color features, texture features, shape features, and spatial relationship features. And inputting the characteristic information into a preset scene type identification model, thereby obtaining the scene type of the scene included in the original image.
The scene type recognition model is a machine learning model, and is trained by using a machine learning algorithm on a sample set, and the types of the scene type recognition model may include: template matching models and prototype matching models. Optionally, the application of the scene type recognition model to the terminal includes three steps, including extracting feature information of the image, establishing an index, and querying. The terminal inputs the recognized image characteristic information of the original image into a preset scenery type recognition model for matching, the scenery type of the scenery included in the original image is obtained after model query and matching, and the scenery type of one or more scenery included in the original image is recognized by the terminal.
For example: the image feature information about the original image of fig. 7 extracted in S602 includes color features, texture features, shape features, and spatial relationship features, and is input into a preset scene recognition model, so that the scene type of fig. 7 is a natural scene, specifically including blue sky and white cloud.
And S604, marking the scene.
In general, marking a scene means that one or more scenes recognized by a scene recognition model are highlighted in a salient manner in an original image, for example: the outline of the scene is marked by using a rectangular frame, or the scene is cut from the original image and displayed in the upper layer of the original image or marked by adopting other modes, which is not limited in the embodiment of the application.
For example: as shown in fig. 7, the terminal recognizes that there is a scene in the original image as a white cloud, and marks the white cloud with a rectangular frame 700.
S605, it is queried in the database whether a pattern matching the shape information parameter exists.
Generally, based on the scene type identified by the scene identification type model of S604, the scene corresponding to the scene type in the original image is marked, and whether a pattern having the same shape information parameter as the marked scene exists is queried in the database.
For example: as shown in fig. 7, the marked scene is a white cloud, the shape of the scene is preliminarily determined to be goldfish according to the shape parameter information of the scene, and the terminal queries whether pattern goldfish with the same shape parameter as the white cloud exists in the database according to the shape parameter of the white cloud.
And S606, if the pattern exists, acquiring the geometric center of the pattern and the geometric center of the scene.
In general, if a pattern identical to the shape information parameter of the scene is searched in the data based on the query operation of S605, the pattern and the scene are respectively placed in a two-dimensional coordinate system, and the geometric center of the pattern and the geometric center of the scene are found.
For example: as shown in fig. 7, the marked scenery is determined to be a white cloud 700, and the corresponding pattern goldfish is found in the database, and the geometric center of the pattern goldfish and the geometric center of the scenery white cloud 700 in fig. 7 are determined according to the two-dimensional coordinate system.
And S607, the geometric center of the pattern and the geometric center of the scene are superposed.
Generally, the geometric center of the pattern and the geometric center of the scene are determined based on S606, and the terminal performs a coincidence process on the pattern and the geometric center of the scene, that is, superimposes the pattern on the scene, where the layer of the pattern is located on the layer where the scene is located.
For example, as shown in fig. 7, the pattern goldfish in the data is superimposed on the white cloud 700, that is, the layer on which the pattern goldfish is located on the layer on which the scene white cloud 700 is located, and the original image after the pattern goldfish is superimposed is shown as 8.
And S608, if the scene does not exist, displaying prompt information for prompting the user to draw according to the outline of the scene.
In general, based on the query operation of S605, if a pattern identical to the shape information parameter of the scene is not queried in the data, the terminal displays a prompt message for prompting the user to manually draw the pattern according to the outline of the scene on the display screen.
For example: as shown in fig. 9, the identified scene is a cloud 900, the shape information parameter of the cloud 900 is obtained according to S602, and if no pattern identical to the shape information parameter of the cloud 900 is found in the database, the display screen displays a prompt message to prompt the user that there is no matching pattern in the database, and the user needs to manually draw the pattern.
And S609, acquiring a pattern which is drawn by the user, associating the pattern with the scene, and storing the association relation.
Generally, after a user manually draws a pattern, a mapping relationship between the drawn pattern and a scene is determined, and the terminal uploads the mapping relationship, the pattern drawn by the user and the scene to a database for storage.
For example: the user draws the pattern as the love 1000 shown in fig. 10, uploads the love 1000 to the database and stores, sets a correlation parameter, adds the correlation parameter to the shape parameter information of the love 1000 for correlating the love 1000 with the original image in fig. 10, and when a scene identical to the shape parameter of the cloud 900 in fig. 9 is identified later, the user does not need to be guided to manually draw the pattern, and the terminal can automatically superimpose the love 1000 on the scene.
And S610, superposing the pattern which is drawn by the user on the scene.
Generally, a pattern drawn by a user is superimposed on a scene, that is, a layer where the pattern drawn by the user is located on a layer where the scene is located.
For example: as shown in fig. 10, the user is manually drawn a pattern love 1000 and the love 100 is superimposed on the image of the scene cloud 900.
S611, obtaining the name of the pattern, and displaying the name of the pattern at the first preset position of the original image after the superimposition is completed.
Generally, before an original image of a pattern is output, a terminal acquires a name of the pattern, and displays the name of the pattern at a first preset position of the original image of the pattern. The first preset position is a certain fixed position of the lower right corner of the output image.
For example: as shown in fig. 11, in the image displayed on the display screen of the terminal, the name of the pattern love 1000 is displayed at a position in the lower right corner of the image.
And S612, displaying the watermark at a second preset position of the original image which is completely overlapped.
Generally, before the original image with the superimposed pattern is output, a watermark is displayed at a second preset position of the original image with the superimposed pattern, where the watermark includes: one or more of a terminal manufacturer identification, a geographic location identification, a date identification, and a time identification. The second preset position is another fixed position on the output image except for the display pattern name.
For example: as shown in fig. 11, the image displayed on the display screen of the terminal displays the watermark at a position in the lower right corner of the image.
When the scheme of the embodiment of the application is executed, the original image is obtained by using a camera application program carried by the terminal, the scenery in the original image is identified through algorithm processing of an AI intelligent chip, the type and the shape information parameters of the scenery are included, the pattern matched with the scenery is searched in the database according to the type and the shape information parameters of the scenery, the pattern is superposed to the original image, and the superposed image is displayed. And if the pattern matched with the scenery is not found in the database, guiding the user to manually draw the pattern, superposing the pattern drawn by the user on the original image, storing the pattern drawn by the user in the database, and displaying the pattern which is completely superposed by the user. The problem that the storage pattern in the database is incomplete is considered, the manual drawing pattern of the guide user is added, the richness of the pattern data of the database is increased, the accuracy of drawing the pattern in a superposition mode is improved, and meanwhile the viscosity of the user is also improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Example four:
fig. 12 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure. The image processing apparatus may be implemented as all or a part of the terminal by software, hardware, or a combination of both. The device includes:
an image collecting module 1200, configured to collect an original image through a camera;
the scene recognition module 1300, connected to the image acquisition module 1200, is configured to recognize a scene including a preset type in the original image, and detect shape parameter information of the scene; wherein the shape parameter information comprises contour information and texture information;
the automatic pattern overlaying module 1400 is connected with the image collecting module 1200 and the scene identifying module 1300, and is used for overlaying the pattern on the scene when the pattern matched with the shape information parameters is inquired in the database;
and the manual pattern overlapping module 1500 is connected with the image collecting module 1200, the scenery recognizing module 1300 and the automatic pattern overlapping module 1400, and is used for displaying prompt information for prompting a user to draw according to the outline of the scenery when a pattern matched with the shape parameter information is not inquired in the database.
And an image display module 1600 connected to the image acquisition module 1200, the scene recognition module 1300, the automatic overlay pattern module 1400, and the manual overlay pattern module 1500, for displaying the overlaid original image.
Optionally, the scene recognition module 1300 comprises:
an image feature information extraction unit for extracting image feature information of the original image;
the scene type identification unit is used for inputting the image characteristic information into a preset scene type identification model to obtain the scene type of a scene included in the original image;
and the scene marking unit is used for marking the scene.
Optionally, the manual overlay pattern module 1500 includes:
the manual drawing pattern reminding unit is used for displaying prompt information for prompting a user to draw according to the outline of the scenery when a pattern matched with the shape parameter information is not inquired in the database;
the pattern acquisition unit is used for acquiring a pattern which is drawn by a user;
the association unit is used for associating the pattern with the scene and storing an association relation; and
and the pattern overlapping unit is used for overlapping the pattern which is drawn by the user on the scenery.
Optionally, the automatic overlay pattern module 1400 comprises:
a geometric center acquisition unit for acquiring a geometric center of the pattern and a geometric center of the subject;
the pattern superposition unit is used for superposing the geometric center of the pattern and the geometric center of the scenery; and the layer where the pattern is located is positioned on the layer where the scenery is located.
Optionally, the image display module 1600 includes:
the pattern name display unit is used for displaying the name at a first preset position of the superposed original image;
the watermark display unit is used for displaying a watermark at a second preset position of the superposed original image; wherein the watermark comprises: one or more of a terminal manufacturer identification, a geographic location identification, a date identification, and a time identification.
When the scheme of the embodiment of the application is executed, the original image is obtained by using a camera application program carried by the terminal, the scenery in the original image is identified through algorithm processing of an AI intelligent chip, the type and the shape information parameters of the scenery are included, the pattern matched with the scenery is searched in the database according to the type and the shape information parameters of the scenery, the pattern is superposed to the original image, and the superposed image is displayed. And if the pattern matched with the scenery is not found in the database, guiding the user to manually draw the pattern, superposing the pattern drawn by the user on the original image, storing the pattern drawn by the user in the database, and displaying the pattern which is completely superposed by the user. The problem that the storage pattern in the database is incomplete is considered, the manual drawing pattern of the guide user is added, the richness of the pattern data of the database is increased, the accuracy of drawing the pattern in a superposition mode is improved, and meanwhile the viscosity of the user is also improved.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the above method steps, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 5 and fig. 6, which are not described herein again.
The application also provides a terminal, which comprises a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (10)

1. An image processing method, characterized in that the method comprises:
collecting an original image through a camera;
recognizing a scene comprising a preset type in the original image, and detecting shape parameter information of the scene; wherein the shape parameter information comprises contour information and texture information;
if a pattern matched with the shape information parameters is inquired in a database, superposing the pattern on the scenery;
and displaying the superposed original image through a display unit.
2. The method of claim 1, wherein the recognizing that the scene of the preset type is included in the original image comprises:
extracting image characteristic information of the original image;
inputting the image characteristic information into a preset scene type identification model to obtain the scene type of the scene included in the original image;
the scene is marked.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
if the pattern matched with the shape parameter information is not inquired in the database, displaying prompt information for prompting a user to draw according to the outline of the scenery;
acquiring a pattern which is drawn by a user;
associating the pattern with the scene, and storing an association relation; and
and superposing the patterns which are drawn by the user on the scenery.
4. The method of claim 1 or 2, wherein said superimposing said pattern on said scene comprises:
acquiring the geometric center of the pattern and the geometric center of the scene;
coinciding a geometric center of the pattern with a geometric center of the scene; and the layer where the pattern is located is positioned on the layer where the scenery is located.
5. The method according to claim 1, wherein the displaying the superimposed original image through a display unit comprises:
acquiring the name of the pattern;
and displaying the name at a first preset position of the superposed original image.
6. The method of claim 5, wherein the completing the superimposed original image by a display unit further comprises:
displaying a watermark at a second preset position of the original image which is completely overlapped; wherein the watermark comprises: one or more of a terminal manufacturer identification, a geographic location identification, a date identification, and a time identification.
7. An image processing apparatus, characterized in that the apparatus comprises:
the image acquisition module is used for acquiring an original image through a camera;
the scene recognition module is used for recognizing scenes which comprise preset types in the original image and detecting shape parameter information of the scenes; wherein the shape parameter information comprises contour information and texture information;
the automatic pattern superposition module is used for superposing the patterns on the scenery when the patterns matched with the shape information parameters are inquired in a database;
and the image display module is used for displaying the superposed original images through the display unit.
8. The apparatus of claim 7, further comprising:
and the manual pattern superposition module is used for displaying prompt information for prompting a user to draw according to the outline of the scenery when the pattern matched with the shape parameter information is not inquired in the database.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to perform the method steps according to any of claims 1 to 6.
10. A terminal, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 6.
CN201911093931.XA 2019-11-11 2019-11-11 Image processing method, image processing device, storage medium and terminal Pending CN111107264A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911093931.XA CN111107264A (en) 2019-11-11 2019-11-11 Image processing method, image processing device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911093931.XA CN111107264A (en) 2019-11-11 2019-11-11 Image processing method, image processing device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN111107264A true CN111107264A (en) 2020-05-05

Family

ID=70420392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911093931.XA Pending CN111107264A (en) 2019-11-11 2019-11-11 Image processing method, image processing device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN111107264A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115167735A (en) * 2020-09-24 2022-10-11 Oppo广东移动通信有限公司 Image generation method and device, terminal and readable storage medium
CN116883223A (en) * 2023-05-29 2023-10-13 广州欢聚马克网络信息有限公司 Image watermark synthesis method and device, equipment, medium and product thereof
CN116883223B (en) * 2023-05-29 2024-04-16 广州欢聚马克网络信息有限公司 Image watermark synthesis method and device, equipment, medium and product thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105704383A (en) * 2016-03-24 2016-06-22 徐亚红 Interesting image shooting method
CN106203286A (en) * 2016-06-28 2016-12-07 广东欧珀移动通信有限公司 The content acquisition method of a kind of augmented reality, device and mobile terminal
CN107105310A (en) * 2017-05-05 2017-08-29 广州盈可视电子科技有限公司 Figure image replacement method, device and a kind of recording and broadcasting system in a kind of net cast
US20180107896A1 (en) * 2016-10-16 2018-04-19 Samsung Electronics Co., Ltd. Method and apparatus to perform material recognition and training for material recognition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105704383A (en) * 2016-03-24 2016-06-22 徐亚红 Interesting image shooting method
CN106203286A (en) * 2016-06-28 2016-12-07 广东欧珀移动通信有限公司 The content acquisition method of a kind of augmented reality, device and mobile terminal
US20180107896A1 (en) * 2016-10-16 2018-04-19 Samsung Electronics Co., Ltd. Method and apparatus to perform material recognition and training for material recognition
CN107105310A (en) * 2017-05-05 2017-08-29 广州盈可视电子科技有限公司 Figure image replacement method, device and a kind of recording and broadcasting system in a kind of net cast

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115167735A (en) * 2020-09-24 2022-10-11 Oppo广东移动通信有限公司 Image generation method and device, terminal and readable storage medium
CN116883223A (en) * 2023-05-29 2023-10-13 广州欢聚马克网络信息有限公司 Image watermark synthesis method and device, equipment, medium and product thereof
CN116883223B (en) * 2023-05-29 2024-04-16 广州欢聚马克网络信息有限公司 Image watermark synthesis method and device, equipment, medium and product thereof

Similar Documents

Publication Publication Date Title
US10599914B2 (en) Method and apparatus for human face image processing
KR102304674B1 (en) Facial expression synthesis method and apparatus, electronic device, and storage medium
CN108492363B (en) Augmented reality-based combination method and device, storage medium and electronic equipment
US20180114363A1 (en) Augmented scanning of 3d models
CN112839223B (en) Image compression method, image compression device, storage medium and electronic equipment
CN110796721A (en) Color rendering method and device of virtual image, terminal and storage medium
CN113570052B (en) Image processing method, device, electronic equipment and storage medium
EP4276754A1 (en) Image processing method and apparatus, device, storage medium, and computer program product
WO2016107229A1 (en) Icon displaying method and device, and computer storage medium
CN106447756B (en) Method and system for generating user-customized computer-generated animations
WO2023056835A1 (en) Video cover generation method and apparatus, and electronic device and readable medium
CN108494996A (en) Image processing method, device, storage medium and mobile terminal
CN113822798B (en) Method and device for training generation countermeasure network, electronic equipment and storage medium
CN111127469A (en) Thumbnail display method, device, storage medium and terminal
CN111866372A (en) Self-photographing method, device, storage medium and terminal
CN111176533A (en) Wallpaper switching method, device, storage medium and terminal
CN110267079B (en) Method and device for replacing human face in video to be played
CN110533020A (en) A kind of recognition methods of text information, device and storage medium
CN111107264A (en) Image processing method, image processing device, storage medium and terminal
CN110059739B (en) Image synthesis method, image synthesis device, electronic equipment and computer-readable storage medium
WO2020155984A1 (en) Facial expression image processing method and apparatus, and electronic device
CN113223128B (en) Method and apparatus for generating image
CN111507143B (en) Expression image effect generation method and device and electronic equipment
CN113780047A (en) Virtual makeup trying method and device, electronic equipment and storage medium
CN115714888B (en) Video generation method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200505

RJ01 Rejection of invention patent application after publication