CN112261241B - Image processing method and device and electronic equipment - Google Patents
Image processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN112261241B CN112261241B CN202011155876.5A CN202011155876A CN112261241B CN 112261241 B CN112261241 B CN 112261241B CN 202011155876 A CN202011155876 A CN 202011155876A CN 112261241 B CN112261241 B CN 112261241B
- Authority
- CN
- China
- Prior art keywords
- image
- background
- pixel area
- main
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 238000000034 method Methods 0.000 claims description 27
- 230000000694 effects Effects 0.000 abstract description 8
- 238000004458 analytical method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000003296 saliva Anatomy 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000004441 surface measurement Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/40—Picture signal circuits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/40—Picture signal circuits
- H04N1/40093—Modification of content of picture, e.g. retouching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/40—Picture signal circuits
- H04N1/409—Edge or detail enhancement; Noise or error suppression
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
The invention discloses an image processing method, an image processing device and electronic equipment, wherein an image of a target object on a first surface is obtained; obtaining an image of the target object on the second surface; obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface; according to the relation between the image of the main surface and the image of the background surface, the image of the main surface and/or the image of the background surface are/is adjusted to remove interference information of the image of the background surface existing in the image of the main surface to the image of the main surface, so that the influence of the image of the background surface to the image of the main surface on the shooting effect is eliminated.
Description
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, and an electronic device.
Background
Under the condition that images exist on two sides of a certain paper document, the image content in any one side of the paper document usually transmits to the other side, and after the image on one side of the paper document is shot by using a camera, the obtained shot image also comprises the image content transmitted from the other side, namely, the image content transmitted from the other side can influence the image shooting effect on one side of the paper document.
Disclosure of Invention
In view of the above, the present application provides an image processing method, an image processing apparatus, and an electronic device, so as to eliminate an influence of an image of a background plane on an image of a main plane in terms of a shooting effect.
The application provides the following technical scheme:
a method of image processing, the method comprising:
obtaining an image of the object on the first surface;
obtaining an image of the target object on a second surface;
obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface;
and adjusting the image of the main surface and/or the image of the background surface according to the relation between the image of the main surface and the image of the background surface so as to remove interference information existing in the image of the main surface, wherein the interference information is the interference information of the image of the background surface on the image of the main surface.
Preferably, the obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface includes:
determining a main surface and a background surface in the first surface and the second surface according to identification information of a user on the image of the first surface and/or the image of the second surface;
or, according to the identification information contained in the first surface and/or the second surface, determining a main surface and a background surface in the first surface and the second surface;
or the like, or a combination thereof,
and analyzing the image of the first surface and/or the image of the second surface according to a preset main/back surface determination rule to determine a main surface and a background surface of the first surface and the second surface.
Preferably, the adjusting the image of the main surface and/or the image of the background surface according to the relationship between the image of the main surface and the image of the background surface includes:
and adjusting at least part of pixel areas in the image of the main surface according to the relation between the image of the main surface and the image of the background surface, wherein the at least part of pixel areas are related to the image corresponding to the background surface.
Preferably, the adjusting at least a part of the pixel area in the image of the main surface according to the relationship between the image of the main surface and the image of the background surface includes:
respectively carrying out binarization processing on the image of the main surface and the image of the background surface to obtain a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface;
determining a target pixel area from the main pixel area based on a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface, wherein the binarization result of the target pixel area and the binarization result of the background pixel area corresponding to the target pixel area in the background pixel area are the same target value, and the target value represents that the target pixel area has pixel content;
and adjusting the binarization result of the target pixel area according to the size relation between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the original pixel value.
Preferably, the adjusting the binarization result of the target pixel area according to the magnitude relationship between the original pixel value of each target pixel area and the original pixel value of each corresponding background pixel area comprises:
obtaining the difference value between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the target pixel area;
and adjusting the binarization result of the target pixel area with the difference value smaller than the first preset threshold value from the target value to a non-target value.
Preferably, in a case that a difference between an original pixel value of the target pixel region and an original pixel value of the corresponding background pixel region is greater than or equal to a first preset threshold, the method further includes:
judging whether the difference value between the original pixel value of the target pixel area and the original pixel value of the corresponding background pixel area is larger than a second preset threshold value, wherein the second preset threshold value is larger than the first preset threshold value;
and adjusting the binarization result of the background pixel area corresponding to the target pixel area with the difference value not greater than the second preset threshold value from the target value to a non-target value.
Preferably, after the adjusting the image of the main surface and/or the image of the background surface according to the relationship between the image of the main surface and the image of the background surface, the method further includes:
and denoising the adjusted image of the main surface and/or the adjusted image of the background surface.
An image processing apparatus, the apparatus comprising:
a first surface image acquisition unit for acquiring an image of the target object on a first surface;
a second surface image acquisition unit, configured to acquire an image of the target object on a second surface;
a main/back surface recognition unit configured to obtain a main surface and a background surface of the first surface and the second surface from the image of the first surface and the image of the second surface;
and the image adjusting unit is used for adjusting the image of the main surface and/or the image of the background surface according to the relation between the image of the main surface and the image of the background surface so as to remove interference information existing in the image of the main surface, wherein the interference information is interference information of the image of the background surface on the image of the main surface.
An electronic device, the electronic device comprising: a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is used for storing the program for executing at least the image processing method as described above.
Compared with the prior art, the image processing method, the image processing device and the electronic equipment are provided, and the image of the target object on the first surface is obtained; obtaining an image of the target object on a second surface; obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface; according to the relation between the image of the main surface and the image of the background surface, the image of the main surface and/or the image of the background surface are/is adjusted to remove interference information of the image of the background surface on the image of the main surface, wherein the interference information exists in the image of the main surface, so that the influence of the image of the background surface on the image of the main surface on the shooting effect is eliminated.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a flowchart of a method for adjusting at least a part of pixel areas in an image of the main surface according to a relationship between the image of the main surface and an image of the background surface according to an embodiment of the present application;
fig. 3 is a block diagram of an image processing apparatus 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 only a part of the embodiments of the present application, and not all of 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.
In the case that images exist on both sides of a certain paper document, if the paper of the paper document is thin, the image content in any side of the paper document usually transmits to the other side, and after the image on one side of the paper document is captured by the camera, the captured image obtained also includes the image content transmitted from the other side, such as: the image content transmitted from the other side is overlapped with the image content of the shooting surface, or the image content transmitted from the other side is directly displayed in a blank area in the shooting surface, that is, the image content transmitted from the other side can influence the image shooting effect of one side of the paper document.
In order to solve the technical problem, the embodiment of the invention discloses an image processing method, an image processing device and electronic equipment, wherein an image of a target object on a first surface is obtained; obtaining an image of the target object on a second surface; obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface; according to the relation between the image of the main surface and the image of the background surface, the image of the main surface and/or the image of the background surface are/is adjusted to remove interference information of the image of the background surface on the image of the main surface, wherein the interference information exists in the image of the main surface, so that the influence of the image of the background surface on the image of the main surface on the shooting effect is eliminated.
The following describes an image processing method provided in an embodiment of the present invention, and fig. 1 is a flowchart of the image processing method provided in the embodiment of the present invention, and referring to fig. 1, the method may include:
s100, obtaining an image of a target object on a first surface;
it should be noted that the target object in the present invention refers to a paper document, or a document in which image content in one side of other material is transmitted to the other side.
The first side may refer to any side of the object, and the embodiment of the present invention is not particularly limited.
Optionally, the present invention may obtain the image of the target object on the first surface by using an image acquisition mode, such as camera acquisition.
Step S110, obtaining an image of the target object on a second surface;
the second surface refers to a surface of the object having a front-back relationship with the first surface.
Optionally, the present invention may obtain an image of the target object on the second surface by using an image acquisition mode, such as camera acquisition.
Step S120, obtaining a main surface and a background surface in the first surface and the second surface according to the image of the first surface and the image of the second surface;
the main surface is a surface of the object on which main image content exists, or a surface on which the user pays attention, and the other surface of the object is a background surface after the main surface is specified.
The following gives the way to obtain the main and background faces of the first and second faces from the image of the first and second faces as follows:
the first method is as follows: and determining a main surface and a background surface in the first surface and the second surface according to identification information of the image of the first surface and/or the image of the second surface by a user.
In some cases, the user may add a mark to the image of the first side and/or the image of the second side of the target object to identify the main side and the background side of the first side and the second side.
Optionally, the identifier added by the user may be specifically a symbol, an icon, an image, and the like, and the embodiment of the present invention is not specifically limited, and the user may select to add the identifier in both the first surface and the second surface, and may also select to add the identifier in only one of the surfaces.
The second method comprises the following steps: and determining a main surface and a background surface in the first surface and the second surface according to the identification information contained in the first surface and/or the second surface.
It should be noted that, in some cases, the main surface and the background surface may be identified in the first surface and/or the second surface of the object by a marking method, for example, a title mark, a page number mark, a specific image mark, and the like, and the embodiment of the present invention is not limited in particular.
By identifying the identification information contained in the first side and/or the second side, the main side and the background side of the first side and the second side can be determined.
The third method comprises the following steps: and analyzing the image of the first surface and/or the image of the second surface according to a preset main/back surface determining rule to determine a main surface and a background surface of the first surface and the second surface.
The embodiment of the invention can also determine the main surface and the background surface in the first surface and the second surface by analyzing and identifying the image of the first surface and/or the image of the second surface.
The main surface and the background surface of the first surface and the second surface can be determined in a specific manner of identifying whether the image of the first surface and/or the image of the second surface contains preset content.
The preset content may refer to preset image content, or image content with a preset color, or may refer to preset text content, or text content with a preset font, and the like, which is not specifically limited in the embodiment of the present invention.
Step S130, according to a relationship between the image of the main surface and the image of the background surface, adjusting the image of the main surface and/or the image of the background surface to remove interference information existing in the image of the main surface, where the interference information is interference information of the image of the background surface with the image of the main surface.
It should be noted that, in the embodiment of the present invention, a manner of adjusting pixels in an image may be adopted to remove interference information existing in the image of the principal surface, and specifically, at least a part of pixel areas in the image of the principal surface may be adjusted according to a relationship between the image of the principal surface and the image of the background surface to remove interference information existing in the image of the principal surface, where the at least a part of pixel areas are related to the image corresponding to the background surface.
Optionally, in the embodiment of the present invention, an image of the target object on the first surface is obtained; obtaining an image of the target object on a second surface; obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface; according to the relation between the image of the main surface and the image of the background surface, the image of the main surface and/or the image of the background surface are/is adjusted to remove interference information of the image of the background surface on the image of the main surface, wherein the interference information exists in the image of the main surface, so that the influence of the image of the background surface on the image of the main surface on the shooting effect is eliminated.
It should be noted that, in some cases, after the image in the target object is captured, the captured image may be subjected to a subsequent processing analysis (such as a binarization processing) to obtain some information from the captured image, and if there is interference information in the image of the principal plane, the subsequent processing analysis result on the image of the principal plane may be affected.
In the embodiment of the present invention, the image of the main surface and/or the image of the background surface are adjusted in the above manner, and after the interference information of the image of the background surface to the image of the main surface, which is present in the image of the main surface, is removed, the influence of the image of the background surface to the image of the main surface in the aspect of the shooting effect is eliminated, so that the accuracy of the subsequent processing and analysis of the image of the main surface can be further improved, for example, the accuracy of the result of the binarization processing to the image of the main surface is improved.
A specific embodiment of the present invention will be described in detail below with reference to a specific embodiment, where a specific manner of adjusting at least a part of pixel regions in the image of the main surface according to a relationship between the image of the main surface and the image of the background surface is disclosed in the present invention, and fig. 2 is a flowchart of a method for adjusting at least a part of pixel regions in the image of the main surface according to a relationship between the image of the main surface and the image of the background surface, where, with reference to fig. 2, the method may include:
step S200, performing binarization processing on the image of the main surface and the image of the background surface respectively to obtain a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface;
optionally, the binarization processing manner at least includes: the embodiments of the present invention are not specifically limited, for example, by the saliva threshold method, the Sauvol method, and the binarization method based on any neural network, such as a segmentation network and a confrontation network.
The main pixel area and the background pixel area may be the size of one pixel unit, or may be the sizes of several pixel units.
If the pixel point set corresponding to a main pixel area is A _ (i, j) and the pixel point set corresponding to the background pixel area corresponding to the main pixel area is B _ (i, j), the binarization result corresponding to the main pixel area is F (A _ (i, j)), and the binarization result corresponding to the background pixel area is F (B _ (i, j)).
Both of the values of F (A _ (i, j)) and F (B _ (i, j)) may be 1 and 0, where 1 indicates that the gray-level value of the pixel region is greater than or equal to the predetermined gray-level value, and 0 indicates that the gray-level value of the pixel region is less than the predetermined gray-level value.
Step S210, determining a target pixel area from the main pixel area based on a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface, wherein the binarization result of the target pixel area and the binarization result of the background pixel area corresponding to the target pixel area in the background pixel area are the same target value, and the target value represents that the target pixel area has pixel content;
in the image of the main surface, if a certain main pixel area has pixel content, but the background pixel area in the image of the background surface at the position in the positive and negative plane symmetrical relation with the main pixel area having the pixel content does not have the pixel content, the image of the background surface does not influence the image of the main surface, and subsequent adjustment is not needed; if a certain main pixel area does not have pixel content, but has pixel content in the background pixel area at the position in the image of the background surface in front-back plane symmetrical relation with the main pixel area having pixel content, it indicates that the main pixel area does not actually have an image, and the image of the background surface does not affect the image of the main surface, and subsequent adjustment is not needed.
In the image of the main surface, if a certain main pixel region has pixel contents and also has pixel contents in the background pixel region at a position in front-to-back plane symmetry relationship with the main pixel region having pixel contents in the image of the background surface, the main pixel region having pixel contents is determined as a target pixel region. In this case, it is possible to actually have an image at both the position of the target pixel region and the position of the background pixel region corresponding thereto; it is also possible to have an image only at the position of the target pixel area and not actually at the position of the background pixel area corresponding thereto; it is also possible that there is actually no image at the position of the target pixel area and there is actually an image at the position of the background pixel area corresponding thereto.
In the case where an image is actually present only at the position of the target pixel region and an image is not actually present at the position of the corresponding background pixel region, the content of the pixel recognized in the background pixel region is erroneously recognized as the image at the position of the target pixel region.
However, when there is no image at the position of the target pixel area and there is an image at the position of the corresponding background pixel area, the content of the pixel recognized in the target pixel area is erroneously recognized from the image at the position of the background pixel area.
For example, in the image of the main surface, if the binarization result of a certain main pixel area is 1, and the binarization result of the background pixel area at the position in the image of the background surface in a front-back plane symmetric relationship with the main pixel area having the pixel content is also 1, the main pixel area having the pixel content is determined as the target pixel area.
The target value characterizes the target pixel region as having pixel content, the target value may be 1.
Step S220, adjusting the binarization result of the target pixel region according to the size relationship between the original pixel value of each target pixel region and the original pixel value of each corresponding background pixel region.
In the embodiment of the present invention, the process of adjusting the binarization result of the target pixel area according to the size relationship between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the original pixel value of each target pixel area may include: obtaining the difference value between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the target pixel area; and adjusting the binarization result of the target pixel area with the difference value smaller than the first preset threshold value from the target value to a non-target value.
Specifically, in the present application, a value obtained by comparing an original pixel value of a target pixel region with an original pixel value of a background pixel region corresponding to the target pixel region is used as a difference value between the original pixel value of the target pixel region and the original pixel value of the background pixel region corresponding to the target pixel region.
If the difference value between the original pixel value of a target pixel region and the original pixel value of the background pixel region corresponding to the target pixel region is smaller than a first preset threshold value, it is proved that the pixel points identified in the target pixel region are actually pixel points in the background pixel region corresponding to the target pixel region, that is, no image actually exists in the target pixel region, and the pixel points identified in the target pixel region are actually pixel points obtained by misrecognizing the image in the background pixel region corresponding to the target pixel region.
In this case, the binarization result of the target pixel region having the difference smaller than the first preset threshold is adjusted from the target value to a non-target value, i.e., the binarization result of the target pixel region having the difference smaller than the first preset threshold is corrected.
It should be noted that the first preset threshold may be set by a person skilled in the art, and the embodiment of the present invention is not limited in particular.
Since the target value characterizes the target pixel region as having pixel content therein, correspondingly, the non-target value characterizes the target pixel region as having no pixel content therein, and in the case of a target value of 1, the non-target value may be 0.
In addition, it should be noted that, if the difference between the original pixel value of a target pixel region and the original pixel value of the background pixel region corresponding to the target pixel region is greater than or equal to the first preset threshold, further determining whether the difference between the original pixel value of the target pixel region and the original pixel value of the background pixel region corresponding to the target pixel region is greater than a second preset threshold, and in case that the difference between the original pixel value of the target pixel region and the original pixel value of the background pixel region corresponding to the target pixel region is greater than the second preset threshold, it indicates that the pixel point identified in the target pixel region is the pixel point of the image actually existing in the target pixel region, and the pixel point identified in the background pixel region corresponding to the target pixel region is obtained by misrecognizing the pixel point of the image actually existing in the target pixel region, so as to prove that the image actually exists in the target pixel region, in the case where there is no image in the background pixel region, the binarization result of the target pixel region does not need to be adjusted.
It should be noted that the size of the second preset threshold is larger than that of the first preset threshold.
If the difference between the original pixel value of the target pixel region and the original pixel value of the corresponding background pixel region is not greater than the second preset threshold, that is, the difference between the original pixel value of the target pixel region and the original pixel value of the corresponding background pixel region is greater than or equal to the first preset threshold, and when the pixel value is less than or equal to a second preset threshold value, indicating that the pixel point identified in the target pixel region is the superposition of the pixel point of the image actually existing in the target pixel region and the pixel point of the image actually existing in the background pixel region corresponding to the target pixel region, proving that the image actually existing in the target pixel region and the image actually also exist in the background pixel region, in this case, the binarization result of the background pixel region corresponding to the target pixel region is adjusted from the target value to a non-target value.
Optionally, after the adjusting the image of the main surface and/or the image of the background surface according to the relationship between the image of the main surface and the image of the background surface, the embodiment of the present invention further includes:
and denoising the adjusted image of the main surface and/or the image of the background surface, so as to avoid false identification caused by reasons such as threshold critical points and the like.
After the target pixel area is determined from the main pixel area by the method, the binarization result of the target pixel area is adjusted according to the size relation between the original pixel value of each target pixel area and the original pixel value of each corresponding background pixel area, so that the interference information of the binarization result of the image of the background surface on the binarization result of the image of the main surface, which exists in the binarization result of the image of the main surface, can be removed, and the influence of the binarization result of the image of the background surface on the binarization result of the image of the main surface can be eliminated.
The following describes an image processing apparatus according to an embodiment of the present invention, and the image processing apparatus described below may be referred to in correspondence with the above image processing method.
Fig. 3 is a block diagram of an image processing apparatus according to an embodiment of the present invention, and referring to fig. 3, the image processing apparatus includes:
a first surface image acquiring unit 300 for acquiring an image of the object on a first surface;
a second surface image obtaining unit 310, configured to obtain an image of the target object on a second surface;
a main/back surface recognition unit 320 for obtaining a main surface and a background surface of the first surface and the second surface from the image of the first surface and the image of the second surface;
an image adjusting unit 330, configured to adjust the image of the main surface and/or the image of the background surface according to a relationship between the image of the main surface and the image of the background surface, so as to remove interference information existing in the image of the main surface, where the interference information is interference information of the image of the background surface with the image of the main surface.
The main/rear surface recognition unit includes:
the first main/back determining unit is used for determining a main surface and a background surface in the first surface and the second surface according to identification information of a user on the image of the first surface and/or the image of the second surface;
or, a second main/back determining unit, configured to determine a main surface and a background surface of the first surface and the second surface according to identification information included in the first surface and/or the second surface;
or the like, or, alternatively,
a third main/back surface determining unit, configured to analyze the image of the first surface and/or the image of the second surface according to a preset main/back surface determining rule, and determine a main surface and a background surface of the first surface and the second surface.
The image adjusting unit includes:
and the pixel area adjusting unit is used for adjusting at least part of pixel areas in the image of the main surface according to the relation between the image of the main surface and the image of the background surface, and the at least part of pixel areas are related to the image corresponding to the background surface.
The pixel region adjusting unit includes:
a binarization processing unit, configured to perform binarization processing on the image of the main surface and the image of the background surface respectively to obtain a binarization result corresponding to at least one main pixel region in the image of the main surface and a binarization result corresponding to at least one background pixel region in the image of the background surface;
a target pixel area determination unit configured to determine a target pixel area from the main pixel area based on a binarization result corresponding to each of at least one main pixel area in the image of the main surface and a binarization result corresponding to each of at least one background pixel area in the image of the background surface, the binarization result of the target pixel area being a same target value as a binarization result of a background pixel area corresponding to the target pixel area in the background pixel area, the target value representing that the target pixel area has pixel content therein;
and the binarization result adjusting unit is used for adjusting the binarization result of the target pixel area according to the size relation between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the original pixel value.
The binarization result adjusting unit is specifically configured to:
obtaining the difference value between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the target pixel area;
and adjusting the binarization result of the target pixel area of which the difference value is smaller than a first preset threshold value from a target value to a non-target value.
When the difference between the original pixel value of the target pixel region and the original pixel value of the background pixel region corresponding to the target pixel region is greater than or equal to a first preset threshold, the binarization result adjusting unit is further configured to:
judging whether the difference value between the original pixel value of the target pixel area and the original pixel value of the corresponding background pixel area is larger than a second preset threshold value, wherein the second preset threshold value is larger than the first preset threshold value;
and adjusting the binarization result of the background pixel area corresponding to the target pixel area with the difference value not greater than the second preset threshold value from the target value to a non-target value.
The device further comprises: a denoising processing unit to: and denoising the adjusted image of the main surface and/or the image of the background surface.
Optionally, an embodiment of the present invention further discloses an electronic device, where the electronic device includes: a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is used for storing the program for executing at least the image processing method as described above.
Technical features described in the embodiments in the present specification may be replaced or combined with each other, and each embodiment is mainly described as being different from other embodiments, and the same and similar portions among the embodiments may be referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (7)
1. A method of image processing, the method comprising:
obtaining an image of the object on the first surface;
obtaining an image of the target object on a second surface;
obtaining a main surface and a background surface of the first surface and the second surface according to the image of the first surface and the image of the second surface;
according to the relation between the image of the main surface and the image of the background surface, adjusting the image of the main surface and/or the image of the background surface to remove interference information existing in the image of the main surface, wherein the interference information is interference information of the image of the background surface on the image of the main surface;
the adjusting the image of the main surface and/or the image of the background surface according to the relationship between the image of the main surface and the image of the background surface comprises:
respectively carrying out binarization processing on the image of the main surface and the image of the background surface to obtain a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface;
determining a target pixel area from the main pixel area based on a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface, wherein the binarization result of the target pixel area and the binarization result of the background pixel area corresponding to the target pixel area in the background pixel area are the same target value, and the target value is used for representing that the target pixel area has pixel content;
and adjusting the binarization result of the target pixel area according to the size relation between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the original pixel value.
2. The method of claim 1, the obtaining a primary facet and a background facet of the first and second facets from the image of the first facet and the image of the second facet comprising:
determining a main surface and a background surface in the first surface and the second surface according to identification information of a user on the image of the first surface and/or the image of the second surface;
or, according to the identification information contained in the first surface and/or the second surface, determining a main surface and a background surface in the first surface and the second surface;
or the like, or, alternatively,
and analyzing the image of the first surface and/or the image of the second surface according to a preset main/back surface determining rule to determine a main surface and a background surface of the first surface and the second surface.
3. The method according to claim 1, wherein the adjusting the binarization result of the target pixel region according to the magnitude relationship between the original pixel value of each target pixel region and the original pixel value of each background pixel region corresponding to the target pixel region comprises:
obtaining the difference value between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the target pixel area;
and adjusting the binarization result of the target pixel area with the difference value smaller than the first preset threshold value from the target value to a non-target value.
4. The method according to claim 3, in case that the difference between the original pixel value of the target pixel region and the original pixel value of the background pixel region corresponding thereto is greater than or equal to a first preset threshold, the method further comprising:
judging whether the difference value between the original pixel value of the target pixel area and the original pixel value of the corresponding background pixel area is larger than a second preset threshold value, wherein the second preset threshold value is larger than the first preset threshold value;
and adjusting the binarization result of the background pixel area corresponding to the target pixel area of which the difference value is not greater than the second preset threshold value from the target value to a non-target value.
5. The method according to any one of claims 1 to 4, further comprising, after adjusting the image of the main face and/or the image of the background face according to a relationship between the image of the main face and the image of the background face:
and denoising the adjusted image of the main surface and/or the adjusted image of the background surface.
6. An image processing apparatus, the apparatus comprising:
a first surface image acquisition unit for acquiring an image of the target object on a first surface;
a second surface image acquisition unit, configured to acquire an image of the target object on a second surface;
a main/back surface recognition unit configured to obtain a main surface and a background surface of the first surface and the second surface from the image of the first surface and the image of the second surface;
an image adjusting unit, configured to adjust the image of the main surface and/or the image of the background surface according to a relationship between the image of the main surface and the image of the background surface, so as to remove interference information existing in the image of the main surface, where the interference information is interference information of the image of the background surface with the image of the main surface;
the image adjusting unit is specifically configured to:
respectively carrying out binarization processing on the image of the main surface and the image of the background surface to obtain a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface;
determining a target pixel area from the main pixel area based on a binarization result corresponding to at least one main pixel area in the image of the main surface and a binarization result corresponding to at least one background pixel area in the image of the background surface, wherein the binarization result of the target pixel area and the binarization result of the background pixel area corresponding to the target pixel area in the background pixel area are the same target value, and the target value is used for representing that the target pixel area has pixel content;
and adjusting the binarization result of the target pixel area according to the size relation between the original pixel value of each target pixel area and the original pixel value of each background pixel area corresponding to the original pixel value.
7. An electronic device, the electronic device comprising: a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is used for storing the program at least for executing the image processing method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011155876.5A CN112261241B (en) | 2020-10-26 | 2020-10-26 | Image processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011155876.5A CN112261241B (en) | 2020-10-26 | 2020-10-26 | Image processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112261241A CN112261241A (en) | 2021-01-22 |
CN112261241B true CN112261241B (en) | 2022-07-26 |
Family
ID=74262946
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011155876.5A Active CN112261241B (en) | 2020-10-26 | 2020-10-26 | Image processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112261241B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1893514A (en) * | 2005-07-08 | 2007-01-10 | 虹光精密工业(苏州)有限公司 | Method for scanning double-side file and method for generating corresponding image |
JP5847210B2 (en) * | 2014-01-28 | 2016-01-20 | 株式会社Pfu | Image processing apparatus, image processing method, and computer program |
CN104036469B (en) * | 2014-06-27 | 2017-02-15 | 天津大学 | Method for eliminating word seen-through effect of image during document scanning |
JP7204402B2 (en) * | 2018-09-28 | 2023-01-16 | キヤノン株式会社 | IMAGE PROCESSING DEVICE, CONTROL METHOD THEREOF, AND PROGRAM |
US10999465B2 (en) * | 2018-11-12 | 2021-05-04 | Xerox Corporation | Systems and methods for retaining duplex scanning information in a scanned output file |
-
2020
- 2020-10-26 CN CN202011155876.5A patent/CN112261241B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112261241A (en) | 2021-01-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9596378B2 (en) | Method and apparatus for authenticating printed documents that contains both dark and halftone text | |
US10275677B2 (en) | Image processing apparatus, image processing method and program | |
US20050249429A1 (en) | Method, apparatus, and program for image processing | |
CN110298353B (en) | Character recognition method and system | |
CN110390643A (en) | A kind of license plate Enhancement Method, device and electronic equipment | |
CN111222506A (en) | Color recognition method, apparatus and computer-readable storage medium | |
CN116129195A (en) | Image quality evaluation device, image quality evaluation method, electronic device, and storage medium | |
CN114240925A (en) | Method and system for detecting document image definition | |
CN112530079B (en) | Method, device, terminal equipment and storage medium for detecting bill factors | |
CN110210467B (en) | Formula positioning method of text image, image processing device and storage medium | |
CN112261241B (en) | Image processing method and device and electronic equipment | |
CN116228644A (en) | Image detection method, electronic device and storage medium | |
JP2016072706A (en) | Strength setting method for watermark embedding and computer program | |
CN108647570B (en) | Zebra crossing detection method and device and computer readable storage medium | |
CN110532993B (en) | Face anti-counterfeiting method and device, electronic equipment and medium | |
CN116912181B (en) | Screen uniformity detection method, system and readable storage medium | |
CN114820418A (en) | Image exception handling method and device, terminal equipment and readable storage medium | |
JPH10285399A (en) | Image binarization method | |
CN112215784B (en) | Image decontamination method, image decontamination device, readable storage medium and computer equipment | |
CN115984178A (en) | Counterfeit image detection method, electronic device, and computer-readable storage medium | |
JP2005341493A (en) | Information embedding apparatus, information detecting apparatus, information embedding/detecting system, information embedding method, information detecting method, information embedding/detecting method, information embedding program, information detecting program, information embedding/detecting program and recording medium | |
CN110991451B (en) | Correction method and device for card area image of scanned image | |
CN115880300B (en) | Image blurring detection method, device, electronic equipment and storage medium | |
CN114841896B (en) | Image processing method, apparatus, and computer-readable storage medium | |
US20240312246A1 (en) | Method for estimating an inter-ridge distance relating to a fingerprint |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |