CN112381719A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN112381719A
CN112381719A CN202011332273.8A CN202011332273A CN112381719A CN 112381719 A CN112381719 A CN 112381719A CN 202011332273 A CN202011332273 A CN 202011332273A CN 112381719 A CN112381719 A CN 112381719A
Authority
CN
China
Prior art keywords
target
triangular mesh
scaling coefficient
scaling
image
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
CN202011332273.8A
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202011332273.8A priority Critical patent/CN112381719A/en
Publication of CN112381719A publication Critical patent/CN112381719A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4023Decimation- or insertion-based scaling, e.g. pixel or line decimation

Abstract

The application discloses an image processing method and device, and belongs to the field of mobile communication. The method comprises the following steps: acquiring an overall scaling coefficient of an original image; determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient; wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target scaling coefficient is obtained by adjusting the overall scaling coefficient according to the significance value of the triangular mesh; and according to the target scaling coefficient group, carrying out scaling processing on the pixel points in each triangular grid to obtain a target image. The image processing method and device solve the problem that in the prior art, image distortion is easily caused in the process of zooming the image.

Description

Image processing method and device
Technical Field
The present application belongs to the field of mobile communications, and in particular, relates to an image processing method and apparatus.
Background
With the rapid development of mobile communication technology, various mobile electronic devices and non-mobile electronic devices have become indispensable tools in various aspects of people's lives. The functions of various Application programs (APPs) of the electronic equipment are gradually improved, and the functions do not only play a role in communication, but also provide various intelligent services for users, so that great convenience is brought to the work and life of the users.
At present, the picture related function has become one of the main functions of the electronic device, and the user can take pictures, browse pictures, and even process pictures through the electronic device. In the process of browsing or processing pictures, the pictures are often zoomed; for example, zooming in during browsing to obtain local details of the picture; in picture processing, picture scaling is achieved by cropping a part of the pixel area, or changing the size of the pixel area, or the like. However, during the picture scaling process, image distortion is easily caused.
Disclosure of Invention
An object of the embodiments of the present application is to provide an image processing method and an image processing apparatus, which can solve the problem in the prior art that image distortion is easily caused in a process of zooming an image.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides an image processing method, where the method includes:
acquiring an overall scaling coefficient of an original image;
determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient;
wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes;
and according to the target scaling coefficient group, carrying out scaling processing on the pixel points in each triangular grid to obtain a target image.
Optionally, the determining a target scaling coefficient set that minimizes a target energy function according to the overall scaling coefficient includes:
carrying out significance detection and triangulation on the original image, and determining the significance value of each triangular mesh in the network topology obtained by triangulation;
determining at least two groups of alternative scaling coefficient groups according to the overall scaling coefficient;
selecting, from the candidate scaling coefficient groups, a coefficient group that minimizes the target energy function as the target scaling coefficient group.
Optionally, the alternative scaling coefficient group includes an alternative scaling coefficient of each triangular mesh;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; the adjustment parameter is a value obtained by dividing the alternative scaling factor by the overall scaling factor.
Optionally, the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are preset values respectively;
es represents a direction change parameter, Ea represents an angle change parameter, and Ee represents a preset constraint item.
Optionally, the direction change parameter is:
Figure BDA0002796149460000021
the angle change parameters are as follows:
Figure BDA0002796149460000022
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; sx represents a scaling factor of the triangular mesh in a first direction, and sy represents a scaling factor of the triangular mesh in a second direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, and d θ 3 represents a variation of a third internal angle of the triangular mesh.
In a second aspect, an embodiment of the present application further provides an image processing apparatus, including:
the coefficient acquisition module is used for acquiring the overall scaling coefficient of the original image;
a target determining module, configured to determine a target scaling coefficient set that minimizes a target energy function according to the overall scaling coefficient;
wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes;
and the zooming processing module is used for zooming the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image.
Optionally, the goal determination module comprises:
the first determining submodule is used for carrying out significance detection and triangulation on the original image and determining a significance value of each triangular mesh in a network topology obtained by triangulation;
a second determining sub-module, configured to determine at least two groups of candidate scaling coefficient groups according to the overall scaling coefficient;
a selection sub-module for selecting, from the candidate scaling coefficient sets, a coefficient set that minimizes the target energy function as the target scaling coefficient set.
Optionally, the alternative scaling coefficient group includes an alternative scaling coefficient of each triangular mesh;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; the adjustment parameter is a value obtained by dividing the alternative scaling factor by the overall scaling factor.
Optionally, the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are preset values respectively;
es represents a direction change parameter, Ea represents an angle change parameter, and Ee represents a preset constraint item.
Optionally, the direction change parameter is:
Figure BDA0002796149460000041
the angle change parameters are as follows:
Figure BDA0002796149460000042
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; sx represents a scaling factor of the triangular mesh in a first direction, and sy represents a scaling factor of the triangular mesh in a second direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, and d θ 3 represents a variation of a third internal angle of the triangular mesh.
In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a program or an instruction stored on the memory and executable on the processor, and when the processor executes the program or the instruction, the steps in the image processing method described above are implemented.
In a fourth aspect, the present application further provides a readable storage medium, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the program or instructions implement the steps in the image processing method as described above.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, the overall scaling coefficient of an original image is obtained; determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient; and zooming the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image, so that the deformation of the area with high significance is small, the deformation of the area with low significance is increased to ensure the whole zooming effect, the effective information of the area with high significance is reserved, and the image distortion is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an image processing method according to an embodiment of the present application;
FIG. 2 shows one of the schematic diagrams of a first example provided by an embodiment of the present application;
fig. 3 shows a second schematic diagram of a first example provided by an embodiment of the present application;
FIG. 4 is a third schematic diagram of a first example provided by an embodiment of the present application;
FIG. 5 shows a flow chart of a second example provided by an embodiment of the present application;
fig. 6 is a block diagram of an image processing apparatus according to an embodiment of the present application;
FIG. 7 shows one of the block diagrams of an electronic device provided by an embodiment of the application;
fig. 8 shows a second block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In various embodiments of the present application, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The image processing method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, an embodiment of the present application provides an image processing method, which is optionally applicable to a first client, which may be an electronic Device including various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, and various forms of Mobile Stations (MSs), Terminal devices (Terminal devices), and the like.
The method comprises the following steps:
step 101, obtaining an overall scaling factor of an original image.
The overall scaling factor is the scaling multiple of the original image subjected to the initial scaling treatment; for example, when a user browses an image, the zoom factor input during manual zoom processing; or a scaling factor entered by the user when modifying the picture size.
And 102, determining a target scaling coefficient group which minimizes the target energy function according to the overall scaling coefficient.
Wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes; specifically, the target scaling factor is obtained by adjusting the overall scaling factor according to the saliency value of the triangular mesh. Triangulation is a topological research method, and for a plane (or a curved surface), the plane is divided into a block of fragments through triangulation to form a plurality of topological networks formed by triangular meshes; wherein each triangular mesh either does not intersect or exactly intersects a common edge, but cannot intersect two or more edges at the same time.
Carrying out Visual Saliency Detection (Visual salience Detection) on an original image, simulating the Visual characteristics of a human by an intelligent algorithm, and extracting a salient region in the image; a salient region is a region of human interest. Objects within the salient region are salient elements. Generally, the human visual system has the ability to quickly search and locate objects of interest when facing natural scenes, and this visual attention mechanism is an important mechanism for people to process visual information in daily life. After the original image is subjected to visual saliency detection, each pixel point in the image corresponds to a saliency value, areas with higher saliency values represent more remarkable human eye impressions, and areas with lower saliency values have less remarkable human eye impressions.
The energy function is a function of positive correlation of the product of the significance value and the deformation quantity of the triangular mesh; and the deformation quantity of the triangular mesh can be related to the scaling multiple and the angle variable before and after deformation according to the area, and the minimum energy function enables the product of the significance value and the deformation quantity of each triangular mesh of the whole image to be minimum, so that the area with high significance is realized, the deformation quantity is small, and the deformation is concentrated in the area with low significance.
After the overall scaling coefficient is determined, setting multiple groups of alternative scaling coefficients aiming at the overall scaling coefficient, wherein the scaling coefficient in each group of alternative scaling coefficients has a certain increase and decrease of the scaling coefficient of at least one triangular mesh relative to the overall scaling coefficient, and the increase and decrease amount is within a preset range so as to ensure the scaling effect; for example, the overall scaling factor is (x0, y0), and the mesh topology after the subdivision includes n triangular meshes, so that the overall scaling factor of each triangular mesh is (x0, y 0); then (x0- Δ a, y0- Δ b), (x0- Δ a, y0- Δ b), … …, (x0, y0) is a set of candidate scaling factors, or (x0, y0- Δ b), (x0- Δ a, y0, … …, (x0, y0) is another set of scaling factors, for each set of candidate scaling factors, the energy function of the image after scaling processing according to the set of scaling factors is determined, and the candidate scaling factor that minimizes the energy function among all candidate scaling factors is determined as the target scaling factor set.
And 103, carrying out zooming processing on the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image.
After a target scaling coefficient group which enables the energy function to be minimum is determined, correspondingly adjusting each triangular grid according to a target scaling coefficient in the target scaling coefficient group to obtain an adjusted target image; the energy function is minimum, namely the sum of products of the significance values and the deformation quantities of all the triangular meshes is minimum, the small deformation quantity of the area with high significance is realized, and the integral zooming effect is ensured by increasing the deformation quantity of the area with low significance.
As a first example, as shown in fig. 2, fig. 2 is a topological network after triangulation is performed on an original image, wherein a region (region S) shown in bold is a region with high significance, i.e., a main region of the original image; after receiving the overall scaling factor, taking the overall scaling factor as an example, and performing amplification processing according to the overall scaling factor, the effect is as shown in fig. 3, in which pixel points in each area and each triangular mesh in the original image are uniformly amplified, and at this time, the pixel points in the main area S are distorted; in the embodiment of the present application, as shown in fig. 4, a scaling factor is determined according to the significance of each triangular mesh, so that the pixel point in the region S has a smaller magnification and is close to the original size, so as to retain the effective information of the original image and avoid image distortion.
In the embodiment of the application, the overall scaling coefficient of an original image is obtained; determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient; and zooming the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image, so that the deformation of the area with high significance is small, the deformation of the area with low significance is increased to ensure the whole zooming effect, the effective information of the area with high significance is reserved, and the image distortion is avoided. The image processing method and device solve the problem that in the prior art, image distortion is easily caused in the process of zooming the image.
In an alternative embodiment, the determining a target scaling factor set that minimizes a target energy function according to the overall scaling factor includes:
firstly, performing significance detection and triangulation on the original image, and determining a significance value of each triangular mesh in a network topology obtained by triangulation;
secondly, determining at least two groups of alternative scaling coefficient groups according to the overall scaling coefficient;
and thirdly, selecting a coefficient group which minimizes the target energy function from the alternative scaling coefficient groups as the target scaling coefficient group.
In the first step, saliency detection and triangulation are respectively carried out on the original image; the saliency detection is visual saliency detection, the salient region in the image is extracted by simulating the visual characteristics of a human through an intelligent algorithm, and the saliency value of each pixel point is determined; then determining the significance value of each triangular mesh according to the significance value of the pixel point in each triangular mesh; optionally, the mean value of the saliency values of all the pixel points in the triangular mesh can be selected as the saliency value of the triangular mesh; and for a pixel point, the pixel point only belongs to one triangular mesh, and the situation that the pixel point belongs to two triangular meshes simultaneously can not occur.
Optionally, after obtaining the saliency value of each triangular mesh, the saliency value may be normalized for post-processing.
In the second step, after the overall scaling coefficient is determined, a plurality of groups of alternative scaling coefficients are set for the overall scaling coefficient, the scaling coefficient in each group of alternative scaling coefficients has a certain increase and decrease relative to the overall scaling coefficient, and the increase and decrease amount is within a preset range, so as to ensure the scaling effect; for example, the overall scaling factor is (x0, y0), and the mesh topology after the subdivision includes n triangular meshes, so that the overall scaling factor of each triangular mesh is (x0, y 0); then (x0- Δ a, y0- Δ b), (x0- Δ a, y0- Δ b), … …, (x0, y0) is a set of alternative scaling factors, or (x0, y0- Δ b), (x0- Δ a, y0, … …, (x0, y0) is yet another set of scaling factors.
In the third step, for each group of alternative scaling coefficients, determining an energy function of the image subjected to scaling processing according to the group of scaling coefficients; and obtaining the candidate scaling coefficient which minimizes the energy function from all the candidate scaling coefficients as the target scaling coefficient group.
In an optional embodiment, the alternative scaling coefficients of each of the triangular meshes are included in the alternative scaling coefficient set;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; that is, the higher the significance, the lower the adjustment parameters;
the adjustment parameter is a value obtained by dividing the alternative scaling coefficient by the overall scaling coefficient, namely, a proportion of the alternative scaling coefficient to the overall scaling coefficient, namely, a scaling adjustment amount; the higher the significance is, the lower the adjustment parameter is, and the lower the adjustment amount is, so that the small deformation amount of the region with high significance is realized, the effective information of the region with high significance is reserved, and the image distortion is avoided; the lower the significance is, the higher the adjustment parameter is, and the higher the adjustment amount is, so as to ensure the overall zooming effect of the image.
In an alternative embodiment, the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are respectively preset numerical values and identify the weight values of the three parameters;
in particular, Es represents a direction change parameter,
Figure BDA0002796149460000101
the single item in Es is the product of the significance value and the area of each triangular grid and the result of multiplication of the product and the square sum of the scaling coefficient;
ea represents an angle change parameter and,
Figure BDA0002796149460000102
Figure BDA0002796149460000103
a single item in Ea is the product of the significance value and the area of each triangular grid and the result of multiplication with the square sum of the angle change;
e represents a preset constraint item, and E can be preset by a user;
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; sx represents a scaling factor of the triangular mesh in a first direction, such as a horizontal direction; sy represents a scaling factor of the triangular mesh in a second direction, such as a vertical direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, d θ 3 represents a variation of a third internal angle of the triangular mesh, and the variation of the internal angle is a variation before and after the scaling processing.
As a second example, referring to fig. 5, fig. 5 shows an application process of the embodiment of the present application, which mainly includes the following steps:
and step 501, detecting the saliency map.
The saliency value of a certain pixel can be calculated by calculating the global contrast of the pixel on the whole image, namely the sum of the distances of the pixel and all other pixels in the image on the color; the visual saliency of the image can be detected, and the result is normalized and expressed, for example, the maximum value is 1.0, and the minimum value is 0.0, so that each pixel point in the image corresponds to a saliency value, the areas with higher saliency values represent more obvious human eye impression, and the areas with lower saliency values have less obvious human eye impression.
Step 502, feature extraction random point scattering and triangulation.
Extracting feature information in the image, reserving a plurality of feature point information in the image, and considering that some areas in the image have no feature information, randomly selecting a certain number of coordinate points in the area.
Triangulation is performed on the image according to the feature point information and the random coordinate points, and a triangular mesh of a region with high significance is marked, as shown in fig. 2, a region with high significance is in an S region (a three-level mesh region shown in bold), and other regions fall into a region with low significance.
Step 503, energy function construction.
The energy function E is composed of three terms, namely Es, Ea and Ee.
Es describes the sum of the degree difference of the triangular mesh in the x direction and the y direction before and after deformation, the mesh deformation quantity with high significance before and after deformation is few, the area mesh deformation quantity with low significance can be more than a little appropriately, and finally the effect that the area deformation quantity with high significance of the correction result is few is achieved.
Figure BDA0002796149460000111
Ea describes three angle variation of the triangle after the triangle mesh is deformed, and the deformation of the triangle before and after the deformation is a little less through the angle variation.
Figure BDA0002796149460000112
Ee is the other constraint term.
Step 504, the user sets the overall scaling factor of the image.
After the user edits the image on the terminal equipment and enters the method, the x direction and the y direction of the image are manually adjusted, and scaling coefficients S0x and S0y are generated in the x direction and the y direction respectively.
And 505, minimizing the energy function to determine the corrected grid points.
And calculating the grid with the minimum grid cost after deformation, namely the target scaling coefficient group with the minimum energy function according to the energy function and S0x and S0y set by a user. The energy function is an overall value, and is that the salient main body in the mesh is substantially consistent with that in the original image, and the deformation of the image is distributed in the non-salient region, as shown in fig. 4, the deformation of the region with high saliency is small.
Step 506, the triangular mesh is deformed.
And carrying out scaling processing on the triangular meshes according to the target scaling coefficient of each triangular mesh in the target scaling coefficient group.
In addition, judging the next adjustment operation of the user after the current frame image is zoomed, if detecting new S0x, S0y, repeating the steps 505, 506; if no new S0x, S0y is detected and the user selects the save result, the result is saved and output as the target image.
In the embodiment of the application, the overall scaling coefficient of an original image is obtained; determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient; and zooming the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image, so that the deformation of the area with high significance is small, the deformation of the area with low significance is increased to ensure the whole zooming effect, the effective information of the area with high significance is reserved, and the image distortion is avoided.
Having described the image processing method according to the embodiment of the present application, an image processing apparatus according to the embodiment of the present application will be described with reference to the drawings.
It should be noted that, in the image processing method provided in the embodiment of the present application, the execution subject may be an image processing apparatus, or a control module in the image processing apparatus for executing the image processing method. In the embodiment of the present application, an image processing method executed by an image processing apparatus is taken as an example, and the image processing method provided in the embodiment of the present application is described.
Referring to fig. 6, an embodiment of the present application further provides an image processing apparatus 600, including:
a coefficient obtaining module 601, configured to obtain an overall scaling coefficient of the original image.
The overall scaling factor is the scaling multiple of the original image subjected to the initial scaling treatment; for example, when a user browses an image, the zoom factor input during manual zoom processing; or a scaling factor entered by the user when modifying the picture size.
A target determining module 602, configured to determine a target scaling coefficient set that minimizes a target energy function according to the overall scaling coefficient;
wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes.
Triangulation is a topological research method, and for a plane (or a curved surface), the plane is divided into a block of fragments through triangulation to form a plurality of topological networks formed by triangular meshes; wherein each triangular mesh either does not intersect or exactly intersects a common edge, but cannot intersect two or more edges at the same time.
Carrying out Visual Saliency Detection (Visual salience Detection) on an original image, simulating the Visual characteristics of a human by an intelligent algorithm, and extracting a salient region in the image; a salient region is a region of human interest. Objects within the salient region are salient elements. Generally, the human visual system has the ability to quickly search and locate objects of interest when facing natural scenes, and this visual attention mechanism is an important mechanism for people to process visual information in daily life. After the original image is subjected to visual saliency detection, each pixel point in the image corresponds to a saliency value, areas with higher saliency values represent more remarkable human eye impressions, and areas with lower saliency values have less remarkable human eye impressions.
The energy function is a function of positive correlation of the product of the significance value and the deformation quantity of the triangular mesh; and the deformation quantity of the triangular mesh can be related to the scaling multiple and the angle variable before and after deformation according to the area, and the minimum energy function enables the product of the significance value and the deformation quantity of each triangular mesh of the whole image to be minimum, so that the area with high significance is realized, the deformation quantity is small, and the deformation is concentrated in the area with low significance.
After the overall scaling coefficient is determined, setting multiple groups of alternative scaling coefficients aiming at the overall scaling coefficient, wherein the scaling coefficient in each group of alternative scaling coefficients has a certain increase and decrease of the scaling coefficient of at least one triangular mesh relative to the overall scaling coefficient, and the increase and decrease amount is within a preset range so as to ensure the scaling effect; for example, the overall scaling factor is (x0, y0), and the mesh topology after the subdivision includes n triangular meshes, so that the overall scaling factor of each triangular mesh is (x0, y 0); then (x0- Δ a, y0- Δ b), (x0- Δ a, y0- Δ b), … …, (x0, y0) is a set of candidate scaling factors, or (x0, y0- Δ b), (x0- Δ a, y0, … …, (x0, y0) is another set of scaling factors, for each set of candidate scaling factors, the energy function of the image after scaling processing according to the set of scaling factors is determined, and the candidate scaling factor that minimizes the energy function among all candidate scaling factors is determined as the target scaling factor set.
And the scaling module 603 is configured to perform scaling on the pixel points in each triangular mesh according to the target scaling coefficient group to obtain a target image.
After a target scaling coefficient group which enables the energy function to be minimum is determined, correspondingly adjusting each triangular grid according to a target scaling coefficient in the target scaling coefficient group to obtain an adjusted target image; the energy function is minimum, namely the sum of products of the significance values and the deformation quantities of all the triangular meshes is minimum, the small deformation quantity of the area with high significance is realized, and the integral zooming effect is ensured by increasing the deformation quantity of the area with low significance.
As a first example, as shown in fig. 2, fig. 2 is a topological network after triangulation is performed on an original image, wherein a region (region S) shown in bold is a region with high significance, i.e., a main region of the original image; after receiving the overall scaling factor, taking the overall scaling factor as an example, and performing amplification processing according to the overall scaling factor, the effect is as shown in fig. 3, in which pixel points in each area and each triangular mesh in the original image are uniformly amplified, and at this time, the pixel points in the main area S are distorted; in the embodiment of the present application, as shown in fig. 4, a scaling factor is determined according to the significance of each triangular mesh, so that the pixel point in the region S has a smaller magnification and is close to the original size, so as to retain the effective information of the original image and avoid image distortion.
Optionally, in this embodiment of the present application, the target determining module 602 includes:
the first determining submodule is used for carrying out significance detection and triangulation on the original image and determining a significance value of each triangular mesh in a network topology obtained by triangulation;
a second determining sub-module, configured to determine at least two groups of candidate scaling coefficient groups according to the overall scaling coefficient;
a selection sub-module for selecting, from the candidate scaling coefficient sets, a coefficient set that minimizes the target energy function as the target scaling coefficient set.
Optionally, in this embodiment of the present application, the alternative scaling coefficient group includes an alternative scaling coefficient of each triangular mesh;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; the adjustment parameter is a value obtained by dividing the alternative scaling factor by the overall scaling factor.
Optionally, in this embodiment of the application, the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are preset values respectively;
es represents a direction change parameter, Ea represents an angle change parameter, and Ee represents a preset constraint item.
Optionally, in an embodiment of the present application, the direction change parameter is:
Figure BDA0002796149460000151
the angle change parameters are as follows:
Figure BDA0002796149460000152
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; sx represents a scaling factor of the triangular mesh in a first direction, and sy represents a scaling factor of the triangular mesh in a second direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, and d θ 3 represents a variation of a third internal angle of the triangular mesh.
In the embodiment of the present application, the coefficient obtaining module 601 obtains an overall scaling coefficient of an original image; the target determination module 602 determines a target scaling coefficient set that minimizes a target energy function according to the overall scaling coefficient; the zooming processing module 603 performs zooming processing on the pixel points in each triangular mesh according to the target zooming coefficient group to obtain a target image, so that the deformation of the area with high significance is small, the deformation of the area with low significance is increased to ensure the whole zooming effect, the effective information of the area with high significance is reserved, and image distortion is avoided.
The image processing apparatus in the embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The image processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The image processing apparatus provided in the embodiment of the present application can implement each process implemented by the image processing apparatus in the method embodiments of fig. 1 to fig. 6, and for avoiding repetition, details are not repeated here.
Optionally, as shown in fig. 7, an electronic device 700 is further provided in this embodiment of the present application, and includes a processor 701, a memory 702, and a program or an instruction stored in the memory 702 and executable on the processor 701, where the program or the instruction is executed by the processor 701 to implement each process of the above-mentioned embodiment of the image processing method, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 8 is a hardware configuration diagram of an electronic device 800 implementing various embodiments of the present application;
the electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and a power supply 811. Those skilled in the art will appreciate that the electronic device 800 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 810 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 810 is configured to obtain an overall scaling factor of the original image;
determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient;
wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes;
and according to the target scaling coefficient group, carrying out scaling processing on the pixel points in each triangular grid to obtain a target image.
Optionally, a processor 810 for:
carrying out significance detection and triangulation on the original image, and determining the significance value of each triangular mesh in the network topology obtained by triangulation;
determining at least two groups of alternative scaling coefficient groups according to the overall scaling coefficient;
selecting, from the candidate scaling coefficient groups, a coefficient group that minimizes the target energy function as the target scaling coefficient group.
Optionally, the alternative scaling coefficient group includes an alternative scaling coefficient of each triangular mesh;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; the adjustment parameter is a value obtained by dividing the alternative scaling factor by the overall scaling factor.
Optionally, the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are preset values respectively;
es represents a direction change parameter, Ea represents an angle change parameter, and Ee represents a preset constraint item.
Optionally, the direction change parameter is:
Figure BDA0002796149460000181
the angle change parameters are as follows:
Figure BDA0002796149460000182
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; s8 represents the scaling factor of the triangular mesh in the first direction, sy represents the scaling factor of the triangular mesh in the second direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, and d θ 3 represents a variation of a third internal angle of the triangular mesh.
In the embodiment of the application, the overall scaling coefficient of an original image is obtained; determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient; and zooming the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image, so that the deformation of the area with high significance is small, the deformation of the area with low significance is increased to ensure the whole zooming effect, the effective information of the area with high significance is reserved, and the image distortion is avoided.
It should be understood that in the embodiment of the present application, the input Unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042, and the Graphics Processing Unit 8041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes a touch panel 8071 and other input devices 8072. A touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two portions of a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 809 may be used to store software programs as well as various data including, but not limited to, application programs and operating systems. The processor 810 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 810.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the embodiment of the image processing method, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. An image processing method, characterized in that the method comprises:
acquiring an overall scaling coefficient of an original image;
determining a target scaling coefficient group which minimizes a target energy function according to the overall scaling coefficient;
wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes;
and according to the target scaling coefficient group, carrying out scaling processing on the pixel points in each triangular grid to obtain a target image.
2. The method according to claim 1, wherein determining the target scaling factor set that minimizes the target energy function according to the overall scaling factor comprises:
carrying out significance detection and triangulation on the original image, and determining the significance value of each triangular mesh in the network topology obtained by triangulation;
determining at least two groups of alternative scaling coefficient groups according to the overall scaling coefficient;
selecting, from the candidate scaling coefficient groups, a coefficient group that minimizes the target energy function as the target scaling coefficient group.
3. The image processing method according to claim 2, wherein the alternative scaling coefficient group includes an alternative scaling coefficient for each of the triangular meshes;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; the adjustment parameter is a value obtained by dividing the alternative scaling factor by the overall scaling factor.
4. The image processing method of claim 1, wherein the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are preset values respectively;
es represents a direction change parameter, Ea represents an angle change parameter, and Ee represents a preset constraint item.
5. The image processing method according to claim 4, wherein the direction change parameter is:
Figure FDA0002796149450000021
the angle change parameters are as follows:
Figure FDA0002796149450000022
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; sx represents a scaling factor of the triangular mesh in a first direction, and sy represents a scaling factor of the triangular mesh in a second direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, and d θ 3 represents a variation of a third internal angle of the triangular mesh.
6. An image processing apparatus, characterized in that the apparatus comprises:
the coefficient acquisition module is used for acquiring the overall scaling coefficient of the original image;
a target determining module, configured to determine a target scaling coefficient set that minimizes a target energy function according to the overall scaling coefficient;
wherein the target energy function is used for representing the difference amount between the adjusted image and the original image; the target scaling coefficient group comprises a target scaling coefficient of each triangular mesh of the original image, and the triangular mesh is obtained by triangulating the original image; the target energy function is associated with a saliency value of each of the triangular meshes;
and the zooming processing module is used for zooming the pixel points in each triangular grid according to the target zooming coefficient group to obtain a target image.
7. The image processing apparatus according to claim 6, wherein the target determination module comprises:
the first determining submodule is used for carrying out significance detection and triangulation on the original image and determining a significance value of each triangular mesh in a network topology obtained by triangulation;
a second determining sub-module, configured to determine at least two groups of candidate scaling coefficient groups according to the overall scaling coefficient;
a selection sub-module for selecting, from the candidate scaling coefficient sets, a coefficient set that minimizes the target energy function as the target scaling coefficient set.
8. The apparatus according to claim 7, wherein the candidate scaling coefficients of each of the triangular meshes are included in the candidate scaling coefficient group;
wherein the adjustment parameter of each triangular mesh is in inverse proportional relation with the significance value of the triangular mesh; the adjustment parameter is a value obtained by dividing the alternative scaling factor by the overall scaling factor.
9. The image processing apparatus according to claim 6, wherein the target energy function is:
E=k1*Es+k2*Ea+k3*Ee
wherein E represents a value of the target energy function; k1, k2 and k3 are preset values respectively;
es represents a direction change parameter, Ea represents an angle change parameter, and Ee represents a preset constraint item.
10. The image processing apparatus according to claim 9, wherein the direction change parameter is:
Figure FDA0002796149450000031
the angle change parameters are as follows:
Figure FDA0002796149450000032
wherein n is the number of the triangular meshes; sai represents the saliency value of the ith triangular mesh; area represents the area of the ith triangular mesh; sx represents a scaling factor of the triangular mesh in a first direction, and sy represents a scaling factor of the triangular mesh in a second direction; d θ 1 represents a variation of a first internal angle of the triangular mesh, d θ 2 represents a variation of a second internal angle of the triangular mesh, and d θ 3 represents a variation of a third internal angle of the triangular mesh.
CN202011332273.8A 2020-11-24 2020-11-24 Image processing method and device Pending CN112381719A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011332273.8A CN112381719A (en) 2020-11-24 2020-11-24 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011332273.8A CN112381719A (en) 2020-11-24 2020-11-24 Image processing method and device

Publications (1)

Publication Number Publication Date
CN112381719A true CN112381719A (en) 2021-02-19

Family

ID=74588286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011332273.8A Pending CN112381719A (en) 2020-11-24 2020-11-24 Image processing method and device

Country Status (1)

Country Link
CN (1) CN112381719A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103578077A (en) * 2013-12-02 2014-02-12 广东威创视讯科技股份有限公司 Image zooming method and related device
US20150131924A1 (en) * 2013-11-13 2015-05-14 Microsoft Corporation Creation of Rectangular Images from Input Images
CN104915921A (en) * 2015-05-25 2015-09-16 浙江大学 Triangular-mesh-deformation-based geometrical boundary image mapping method with kept content
CN105721816A (en) * 2014-12-05 2016-06-29 青岛海信电器股份有限公司 Processing method of display data, and display equipment
CN107895346A (en) * 2017-12-13 2018-04-10 山东财经大学 The image-scaling method and system of a kind of perception of content
US20200020075A1 (en) * 2017-08-11 2020-01-16 Samsung Electronics Company, Ltd. Seamless image stitching
US20200065974A1 (en) * 2017-05-05 2020-02-27 Shanghai United Imaging Healthcare Co., Ltd. Systems and methods for image segmentation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150131924A1 (en) * 2013-11-13 2015-05-14 Microsoft Corporation Creation of Rectangular Images from Input Images
CN103578077A (en) * 2013-12-02 2014-02-12 广东威创视讯科技股份有限公司 Image zooming method and related device
CN105721816A (en) * 2014-12-05 2016-06-29 青岛海信电器股份有限公司 Processing method of display data, and display equipment
CN104915921A (en) * 2015-05-25 2015-09-16 浙江大学 Triangular-mesh-deformation-based geometrical boundary image mapping method with kept content
US20200065974A1 (en) * 2017-05-05 2020-02-27 Shanghai United Imaging Healthcare Co., Ltd. Systems and methods for image segmentation
US20200020075A1 (en) * 2017-08-11 2020-01-16 Samsung Electronics Company, Ltd. Seamless image stitching
CN107895346A (en) * 2017-12-13 2018-04-10 山东财经大学 The image-scaling method and system of a kind of perception of content

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张永梅;邢阔;吴攀;: "三角网格与鱼眼变换相结合的图像缩放方法", 微电子学与计算机, no. 10 *

Similar Documents

Publication Publication Date Title
CN109087239B (en) Face image processing method and device and storage medium
CN107589963B (en) A kind of image processing method, mobile terminal and computer readable storage medium
CN112532882B (en) Image display method and device
CN112333385B (en) Electronic anti-shake control method and device
WO2022001648A1 (en) Image processing method and apparatus, and device and medium
CN112492201B (en) Photographing method and device and electronic equipment
CN112269522A (en) Image processing method, image processing device, electronic equipment and readable storage medium
CN112037160A (en) Image processing method, device and equipment
CN111835937A (en) Image processing method and device and electronic equipment
CN112330728A (en) Image processing method, image processing device, electronic equipment and readable storage medium
CN112381719A (en) Image processing method and device
CN112286430B (en) Image processing method, apparatus, device and medium
CN110991050B (en) CAD (computer-aided design) image stacking method and related product
CN112150486A (en) Image processing method and device
CN113473012A (en) Virtualization processing method and device and electronic equipment
CN112529766A (en) Image processing method and device and electronic equipment
CN112333389A (en) Image display control method and device and electronic equipment
CN113034611A (en) Operation evaluation method, operation evaluation device, electronic apparatus, and medium
CN112887621B (en) Control method and electronic device
CN112637504B (en) Focusing method and device
CN112367468B (en) Image processing method and device and electronic equipment
CN111382752B (en) Labeling method and related device
CN112381740B (en) Image processing method and device and electronic equipment
CN113837195A (en) Image processing method, device, equipment and storage medium
CN113850739A (en) Image processing method and device

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