CN114979589A - Image processing method, image processing apparatus, electronic device, and medium - Google Patents

Image processing method, image processing apparatus, electronic device, and medium Download PDF

Info

Publication number
CN114979589A
CN114979589A CN202110218049.4A CN202110218049A CN114979589A CN 114979589 A CN114979589 A CN 114979589A CN 202110218049 A CN202110218049 A CN 202110218049A CN 114979589 A CN114979589 A CN 114979589A
Authority
CN
China
Prior art keywords
image
medium
rgb
pixel
light source
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.)
Granted
Application number
CN202110218049.4A
Other languages
Chinese (zh)
Other versions
CN114979589B (en
Inventor
彭彤
杨晓聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yihua Computer Technology Co ltd
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Original Assignee
Shenzhen Yihua Computer Technology Co ltd
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yihua Computer Technology Co ltd, Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd filed Critical Shenzhen Yihua Computer Technology Co ltd
Priority to CN202110218049.4A priority Critical patent/CN114979589B/en
Publication of CN114979589A publication Critical patent/CN114979589A/en
Application granted granted Critical
Publication of CN114979589B publication Critical patent/CN114979589B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals

Abstract

The embodiment of the invention provides an image processing method, an image processing device, an electronic device and a medium, which are applied to an image processing device, wherein the image processing device comprises CIS sensors positioned on two sides of the medium, and the method comprises the following steps: respectively acquiring an RGB image and an IR image for the medium through the CIS sensors positioned on the two sides of the medium; the RGB image and the IR image comprise RGB image pixels and IR image pixels, respectively; and if the RGB image pixels meet the preset pixel condition, processing the RGB image according to the IR image pixels to obtain a processed target image. By combining the mode of determining the cutting boundary by using the RGB light source and the mode of determining the cutting boundary by using the IR light source, the image with black or dark color of the collected foreground is cut, and the success rate of image extraction is improved.

Description

Image processing method, image processing apparatus, electronic device, and medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a machine-readable medium.
Background
An Image area acquired by a CIS (Contact Image Sensor) may include a background Image area and a foreground Image area, and in a general case, an extracted target Image only needs an Image foreground RGB (RGB color mode) Image, and the extracted Image is favorable for processing an algorithm and correcting Image tilt and the like.
In the prior art, the adopted image cropping extraction is mainly to determine the cropping boundary by using RGB light sources, because a black medium can almost absorb the RGB light sources, the acquired medium image is black, and when the background of the image acquired by a common light source is also black, the cropping boundary cannot be accurately determined by this way.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed to provide an image processing method, a corresponding image processing apparatus, a corresponding electronic device, and a corresponding machine-readable medium that overcome or at least partially solve the above-mentioned problems.
In order to solve the above problem, an embodiment of the present invention discloses an image processing method applied to an image processing apparatus including CIS sensors on both sides of a medium, the method including:
respectively acquiring RGB (red, green and blue) images and IR (infrared) images for the medium by the CIS sensors positioned on two sides of the medium; the RGB image and the IR image comprise RGB image pixels and IR image pixels, respectively;
and if the RGB image pixels meet the preset pixel condition, processing the RGB image according to the IR image pixels to obtain a processed target image.
Optionally, the RGB image pixels comprise RGB image foreground pixels and RGB image background pixels; the IR image pixels comprise IR image foreground pixels and IR image background pixels;
if the RGB image pixel meets the preset pixel condition, processing the RGB image according to the IR image pixel, including:
determining a first pixel difference value of the RGB image foreground pixel and the RGB image background pixel;
if the first pixel difference value does not reach a preset threshold value, determining a second pixel difference value of the IR image background pixel and the IR image foreground pixel;
and if the second pixel difference value reaches a preset threshold value, cutting the RGB image according to the IR image.
Optionally, the IR image comprises an IR transmission image; the IR image cropping the RGB image, comprising:
acquiring a vertex position of the IR transmission image;
determining a clipping area formed by connecting the vertex positions, and clipping the RGB image according to the clipping area.
Optionally, the method further comprises:
if the first pixel difference value reaches a preset threshold value, determining a cutting boundary according to the RGB image foreground pixel and the RGB image background pixel, and cutting the RGB image by adopting the cutting boundary.
Optionally, the CIS sensor on both sides of the medium has an IR light source and a light source emitting part; acquiring IR images for the medium by the CIS sensors on both sides of the medium, comprising:
and controlling the light source emitting component to emit the IR light source to the medium, and controlling the CIS sensors positioned on two sides of the medium to acquire an IR transmission image obtained by the IR light source passing through the medium.
Optionally, the acquiring, by the CIS sensors located on both sides of the medium, an IR transmission image obtained by the IR light source passing through the medium includes:
receiving IR light sources emitted by CIS sensors positioned on one side of a medium by the CIS sensors positioned on the other side of the medium;
an IR transmission image is formed as a direct IR light source obtained by said IR light source through said medium and as a transmitted IR light source obtained by said IR light source through said medium.
Alternatively, the CIS sensors on both sides of the medium include an upper CIS sensor on an upper side of the medium and a lower CIS sensor on a lower side of the medium.
The embodiment of the invention also discloses an image processing device, which is applied to image processing equipment, wherein the image processing equipment comprises CIS sensors positioned on two sides of a medium, and the device comprises:
the image acquisition module is used for respectively acquiring an RGB (red, green and blue) image and an IR (infrared) image aiming at the medium through the CIS (contact image sensor) sensors positioned on the two sides of the medium; the RGB image and the IR image comprise RGB image pixels and IR image pixels, respectively;
and the image processing module is used for processing the RGB image according to the IR image pixel to obtain a processed target image if the RGB image pixel meets a preset pixel condition.
Optionally, the RGB image pixels comprise RGB image foreground pixels and RGB image background pixels; the IR image pixels comprise IR image foreground pixels and IR image background pixels;
the image processing module includes:
a first pixel difference determination submodule, configured to determine a first pixel difference between a foreground pixel of the RGB image and a background pixel of the RGB image;
a first pixel difference value judgment sub-module, configured to determine a second pixel difference value between the IR image background pixel and the IR image foreground pixel if the first pixel difference value does not reach a preset threshold;
and the first image cutting sub-module is used for cutting the RGB image according to the IR image if the second pixel difference value reaches a preset threshold value.
Optionally, the IR image comprises an IR transmission image; the image cropping sub-module comprises:
a vertex position acquisition unit for acquiring a vertex position of the IR transmission image;
and the image clipping unit is used for determining a clipping area formed by connecting the vertex positions and clipping the RGB image according to the clipping area.
Optionally, the image processing module further comprises:
and the second image cutting submodule is used for determining a cutting boundary according to the RGB image foreground pixel and the RGB image background pixel if the first pixel difference value reaches a preset threshold value, and cutting the RGB image by adopting the cutting boundary.
Optionally, the sensors on both sides of the medium have an IR light source and a light source emitting part; the image acquisition module includes:
and the IR image acquisition sub-module is used for controlling the light source emission part to emit the IR light source to the medium and controlling the CIS sensors positioned on two sides of the medium to acquire an IR transmission image obtained by the IR light source passing through the medium.
Optionally, the IR image acquisition sub-module comprises:
an IR light source receiving unit for receiving an IR light source emitted from a CIS sensor located on one side of the medium by the CIS sensor located on the other side of the medium;
and the IR image acquisition unit is used for forming an IR transmission image according to an IR direct light source obtained by the IR light source through the medium and an IR transmission light source obtained by the IR light source through the medium.
Alternatively, the CIS sensors on both sides of the medium include an upper CIS sensor on an upper side of the medium and a lower CIS sensor on a lower side of the medium.
The embodiment of the invention also discloses an electronic device, which comprises: one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the electronic device to perform any of the image processing methods.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform any of the image processing methods described herein.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the CIS sensors positioned at two sides of the medium can be used for respectively acquiring the RGB image and the IR image of the medium, and when the RGB image pixels of the RGB image meet the preset pixel condition, the RGB image can be processed according to the IR image pixels of the IR image to obtain the processed target image. By combining the mode of determining the cutting boundary by using the RGB light source and the mode of determining the cutting boundary by using the IR light source, the image with black or dark color of the collected foreground is cut, and the success rate of image extraction is improved.
Drawings
FIG. 1 is a schematic diagram of the operating principle of a CIS sensor in an embodiment of the present invention;
FIG. 2 is a schematic diagram of an image processing module according to an embodiment of the present invention;
FIG. 3 is a flow chart of the steps of an embodiment of an image processing method of the present invention;
FIG. 4 is a schematic diagram of an RGB image captured for a dark medium in an embodiment of the present invention;
FIG. 5 is a schematic illustration of an IR image captured for a dark medium in an embodiment of the invention;
fig. 6 is a block diagram of an embodiment of an image processing apparatus according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The CIS sensor may capture an original image of the medium and may perform correlation processing on the captured original image.
Since the CIS sensor has a large acquisition range, an acquired image region may include a background image region and a foreground image region, the foreground image region may refer to an effective image region, and when an image is used for subsequent application, generally, only the effective image region (i.e., an image foreground RGB image) is used for algorithm processing such as identification and counterfeit detection and display, performing the related processing on the acquired original image may refer to extracting an image foreground RGB image included in the original image, so as to perform subsequent algorithm processing and image tilt correction using the processed image.
Specifically, referring to fig. 1, a schematic diagram of a CIS sensor according to an embodiment of the present invention is shown, where the CIS sensor is used to collect an image of a medium, and the collecting may be represented as that red, green, and blue light (may be referred to as RGB light sources) are respectively emitted by the CIS sensor during a scanning process of the medium, and then light reflected by the scanned medium is collected by a lenticular lens, where the collected image may be a color image composed of three colors of RGB, that is, an RGB image.
Wherein, the pixel point value of each pixel may range from 0 to 255, 0 represents the darkest color, and 255 represents the brightest color, so that for the above-mentioned three colors of R (Red), G (Green ), and B (Blue ), when the pixel value of the image is 0, the color of the current image may be pure black; when the value of an image pixel is 255, the color of its current image may be pure white.
In the prior art, a method for extracting an image foreground RGB image included in an acquired RGB image, that is, an existing method for extracting an image by clipping mainly determines an image boundary by using a difference value between a foreground pixel and a background pixel in the RGB image, and then performs clipping extraction according to four determined boundaries, i.e., an upper boundary, a lower boundary, a left boundary, and a right boundary.
Then, in the prior art, a manner of determining a cutting boundary by comparing pixel point difference values with an RGB light source is used, when a scanned medium is a black or dark medium and a background of an image acquired by the light source is also black, a difference between values of foreground pixels and background pixels in the RGB image is small, and the manner is not favorable for determining the cutting boundary, so that the image foreground RGB image cannot be extracted, or the cut image is incomplete.
One of the core ideas of the embodiment of the invention is to acquire an IR (Infrared) transmission image by adopting an IR transmission mode according to the characteristics of a CIS sensor, extract a black or dark image foreground to be cut by boundary calculation, and cut the image with the acquired foreground being black or dark by combining the mode of determining the cutting boundary by using an RGB light source and the mode of determining the cutting boundary by using an IR light source, thereby improving the success rate of image extraction.
Referring to fig. 2, which shows a schematic structural diagram of an image processing module according to an embodiment of the present invention, the image processing module may be composed of CIS sensors located at both sides of a medium, and the CIS sensors located at both sides of the medium may refer to an upper CIS sensor located at an upper side of the medium and a lower CIS sensor located at a lower side of the medium.
The upper CIS sensor and the lower CIS sensor are basically the same in structure and respectively comprise a light source (1), a sensor (2), a cylindrical lens array (3) and a flat glass (5), and the upper CIS sensor and the lower CIS sensor can also respectively comprise an upper CIS (7) and a lower CIS (8). In an embodiment of the present invention, the upper CIS (7) may be used to scan a front image of the medium, and the lower CIS (8) may be used to scan a rear image of the medium.
Note that the upper CIS (7) and the lower CIS (8) are merely distinguished by using different names, and they are substantially the same structure.
In the embodiment of the present invention, in the process of acquiring an image by using the image processing apparatus, the light source (1) may be used to provide a light source with a specific color, such as R, G, B, IR light source; the sensor (2) can be used for collecting light reflected by the medium (4); the lenticular lens array (3) may be used to limit the direction of the light source; the medium (4) may refer to any medium to be scanned, such as a4 paper, bank card, etc., and embodiments of the present invention are not limited thereto.
In practical application, when the upper CIS sensor and the lower CIS sensor are used to collect an image of a medium by using an RGB light source, the operating principle of the CIS sensor may be as shown in fig. 1, taking the upper CIS sensor to collect an RGB image as an example, the CIS sensor may include a light source emitting component, which is mainly used to control the RGB light source to emit light toward the medium through a flat glass by controlling the light source emitting component, and at this time, the light emitted to the medium surface may change the light propagation direction, i.e., generate reflection, and the lenticular lens array may control the light reflected by the medium to emit along the direction of the sensor, so as to ensure that the light reflected by the medium can be collected by the sensor. Similarly, the process of acquiring RGB images by the lower CIS sensor may be as described in the process of acquiring the upper CIS sensor, and is not described herein again to avoid repetition.
In a preferred embodiment, in order to obtain IR transmission images by IR transmission, the light sources included in the upper CIS sensor and the lower CIS sensor may provide IR light sources, and the upper CIS sensor and the lower CIS sensor may have light source emitting components, in a specific implementation, the upper CIS sensor and the lower CIS sensor may be respectively located at relative positions for a medium to be scanned, so that when the upper CIS sensor emits the IR light sources in a direction of the medium to be scanned, the light source emitting components may be controlled to emit the IR light sources, and the lower CIS sensor may receive the IR light sources emitted by the upper CIS sensor (which may be referred to as "up-sending and down-receiving"); when the lower CIS sensor emits the IR light source to the medium to be scanned, the light source emitting part can be controlled to emit the IR light source, and the upper CIS sensor can receive the IR light source emitted by the lower CIS sensor (which may be referred to as lower-sending-up-receiving).
In practical application, taking the above sending and receiving as an example, the provided IR light source can comprise IR direct light (6) and IR transmission light (9), the light of the IR direct light (6) is stronger, and the infrared light source emitted by the light source (1) of the upper CIS (7) can be received at the lower CIS (8); the light of the IR transmitted light (9) is weak, and the IR light source emitted by the light source (1) with which the upper CIS (7) has, after passing through the medium, the weak light can be received at the lower CIS (8). Similarly, the process of sending down and receiving up can be the same as the process of sending down and receiving up, and is not described herein again to avoid repetition.
It should be noted that the image processing apparatus including the upper CIS sensor and the lower CIS sensor and providing the RGB light source and the IR light source may be applied to a module apparatus equipped with a CIS image sensor supporting infrared light, such as a bill, an a4 scanner, a second generation certificate, and the like, and the embodiment of the present invention is not limited thereto.
Referring to fig. 3, a flowchart illustrating steps of an embodiment of an image processing method according to the present invention is applied to an image processing apparatus, where the image processing apparatus may include CIS sensors located on both sides of a (dark color) medium, and specifically may include the following steps:
step 301, acquiring an RGB image and an IR image for a medium respectively by the CIS sensors located at both sides of the medium;
in one embodiment of the present invention, an image processing module as shown in fig. 2 may be used to scan a medium and obtain an RGB image and an IR image for the medium, wherein the obtained RGB image may have RGB image pixels and the obtained IR image may have IR image pixels, so as to process the RGB image by values of the RGB image pixels and the IR image pixels.
The CIS sensor on both sides of the medium may have an RGB light source and an IR light source, and the RGB image may be obtained by using RGB light source emission, and the IR image may be obtained by using IR transmission.
In one aspect, the CIS sensors located on both sides of the medium are used to acquire RGB images of the medium, which can be obtained by emitting RGB light sources to the medium by using a light source emitting component inside the CIS sensors, and collecting the RGB light sources by the CIS sensors located on both sides of the medium and reflecting the RGB light sources by the medium.
On the other hand, the CIS sensors located on both sides of the medium acquire IR images for the medium, which can be obtained by emitting IR light sources to the medium by using a light source emitting part provided inside the CIS sensors, and collecting the IR light sources passing through the medium by the CIS sensors located on both sides of the medium.
In practical applications, the captured IR image may be an IR transmission image, and specifically, an IR light source emitted from a CIS sensor located on one side of the medium may be received by a CIS sensor located on the other side of the medium, and the IR transmission image may be formed according to an IR direct light source obtained by the IR light source through the medium and an IR transmission light source obtained by the IR light source through the medium.
In a specific implementation, the CIS sensor located at one side of the medium may refer to an upper CIS sensor located at an upper side of the medium, and the CIS sensor located at the other side of the medium may refer to a lower CIS sensor located at a lower side of the medium. It should be noted that the upper CIS sensor and the lower CIS sensor may be respectively located at relative positions to a desired scanning medium, and the IR light source may be issued not only by the above-mentioned down-sending and up-receiving manner, but also by the above-mentioned up-sending manner, which is not limited in the embodiments of the present invention.
Step 302, if the RGB image pixels meet a preset pixel condition, processing the RGB image according to the IR image pixels to obtain a processed target image.
In the embodiment of the present invention, the medium scanned by the image processing module may be a dark color medium or a black medium, and the obtained RGB image may be an RGB image for the dark color medium or the black medium, and if the image background acquired by the RGB light source is also black at this time, the difference between the pixel point values of the RGB foreground image and the RGB background image is small, and the RGB image for the dark color medium or the black medium cannot be processed by comparing the pixel point difference values with the RGB light source.
As an example, when the medium is illuminated by RGB light source, since the medium with black or dark color can almost completely absorb the red, green and blue light sources, so that the normal light is not reflected, when the collected medium image is black (for example, black bank card), and the background of the image collected by the normal light source is also black, the difference between the foreground pixel value and the background pixel value is small, and the image cannot be extracted by this method (as shown in fig. 4), or the clipped image is incomplete.
The RGB image of the dark color or black medium is processed, and the foreground image of the RGB image is essentially cut and extracted, so that the target image obtained after the processing may be an image only including the foreground image (i.e., an effective image area).
In an embodiment of the present invention, when the above situation occurs, the acquired RGB image is processed not by using the RGB image pixels to determine the cropping boundary, but by using the IR image pixels to process the RGB image of the dark color or black medium, so as to crop the image whose acquired foreground is black or dark color, thereby improving the success rate of image extraction.
The RGB image pixels may include RGB image foreground pixels and RGB image background pixels, and the IR image pixels may include IR image foreground pixels and IR image background pixels.
In practical application, when the RGB image pixels satisfy the preset pixel condition, that is, the difference between the RGB image foreground pixels and the RGB image background pixels is small, the RGB image can be processed by using the IR image pixels.
Specifically, in order to determine whether the RGB image pixels meet the preset pixel condition, first pixel difference values of the RGB image foreground pixels and the RGB image background pixels may be determined, and whether the first pixel difference values reach a preset threshold may be determined, where the following two cases may occur:
(1) if the first pixel difference value reaches a preset threshold value, it can be shown that the current RGB image foreground pixel is larger than the RGB image background pixel, and the difference between the current RGB image foreground pixel and the RGB image background pixel is smaller, the RGB image pixel meets the above-mentioned preset pixel condition, and at this time, the RGB image can be processed by the IR image pixel; (2) if the first pixel difference value reaches the preset threshold value, it may be indicated that the difference between the current RGB image foreground pixel and the RGB image background pixel is large, and the RGB image pixel does not satisfy the preset pixel condition, at this time, the RGB image may be processed by the RGB image pixel.
In the first case, that is, if the first pixel difference does not reach the preset threshold, the second pixel difference between the background pixel of the IR image and the foreground pixel of the IR image may be determined, and the RGB image may be cropped according to the IR image when the second pixel difference reaches the preset threshold.
In a specific implementation, because the IR light source has a long wavelength and is not easy to scatter, in a process of adopting an up-and-down-and-up mode, in a region which is not blocked by a dark color or a black medium, a background image acquired by the CIS sensor can be close to white (as shown in fig. 5), which is essentially to determine a boundary through the strength of the IR light source received by the CIS (i.e. the above-mentioned strong IR direct light and weak IR transmitted light), so that it is beneficial to distinguish an IR image foreground image and an IR image background image of the IR image.
In practical applications, the clipping boundary for RGB can be determined by the IR image background pixels and the IR image foreground pixels.
Specifically, the acquired IR transmission image is an image in which the foreground image and the background image are clearly distinguished, so that the vertex position of the IR transmission image can be acquired, and a clipping region formed by connecting the vertex positions is determined; since the position of the medium is not changed in the process of scanning the dark color or black medium by adopting the IR light source and the RGB light source, the formed clipping area can be used as a clipping boundary for RGB, and then the RGB image is clipped by adopting the clipping area to extract the RGB foreground image in the RGB image.
The shape of the formed cutting area may be the same as the shape of the scanned medium, such as a rectangle.
In the second case, that is, if the first pixel difference value reaches the preset threshold, because the difference between the RGB image foreground pixel and the RGB image background pixel is large at this time, the clipping boundary may be directly determined according to the RGB image foreground pixel and the RGB image background pixel, and the RGB image is clipped by using the clipping boundary.
In order to make the above image processing method better understood by those skilled in the art, the following embodiments are described:
assuming that the captured image, whether an RGB image or an IR image, contains a foreground pixel value of P1 and a background pixel value of P2, the preset threshold set for the difference between the foreground and background pixels is K (which may be a typical range of 30-100, as the case may be).
In the process of acquiring an image, initializing the image acquisition equipment shown in fig. 2, detecting the state of the equipment, and preparing to start scanning when a black or dark medium reaches a scanning initial position; when the medium is scanned, R, G, B light sources can be respectively irradiated on the medium through the light sources of the upper CIS and the lower CIS, RGB images are collected through the CIS, the upper CIS can be controlled to turn on the IR light source, so that the lower CIS can receive the direct IR light source and the IR transmission light source passing through the medium, or the lower CIS can be controlled to turn on the IR light source, so that the upper CIS can receive the direct IR light source and the IR transmission light source passing through the medium.
After the RGB image and the IR image are acquired by the CIS sensor, the image may be processed to obtain a target image, specifically, the image foreground RGB image is cut and extracted, and the cut foreground RGB image is acquired.
In the process of processing an image, firstly, a cutting boundary can be determined by adopting an RGB light source comparison pixel difference mode, wherein the image boundary can be judged by the foreground and background difference value of any light source image in the RGB light source, and when P2-P1> K in the RGB image is regarded as the boundary, the cutting extraction is carried out according to the upper, lower, left and right boundaries; if P2-P1< K in the RGB image, as an example, it is assumed that P1 is (19,20,28), P2 is (23,21,23), and P2-P1< the preset threshold minimum value 30, it indicates that the extraction has failed according to the aforementioned method, and at this time, the boundary can be determined by P2-P1> K in the IR image, and as an example, it is assumed that P1 is (58,52,56), P2 is (255 ), and P2-P1> is the preset threshold maximum value 100, and at this time, the RGB image can be clipped by the clipped rectangle four-vertex position of the IR transmission map.
In the embodiment of the invention, the CIS sensors positioned on the two sides of the medium can be used for respectively acquiring the RGB image and the IR image of the medium, and when the RGB image pixels of the RGB image meet the preset pixel conditions, the RGB image can be processed according to the IR image pixels of the IR image, so as to obtain the processed target image. By combining the mode of determining the cutting boundary by using the RGB light source and the mode of determining the cutting boundary by using the IR light source, the image with black or dark color of the acquired foreground is cut, and the success rate of image extraction is improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 6, a block diagram of an embodiment of an image processing apparatus according to the present invention is shown, and is applied to an image processing device, where the image processing device includes CIS sensors located on both sides of a medium, and specifically may include the following modules:
an image acquisition module 601, configured to acquire an RGB image and an IR image of the medium through the CIS sensors located on two sides of the medium respectively; the RGB image and the IR image comprise RGB image pixels and IR image pixels, respectively;
an image processing module 602, configured to process the RGB image according to the IR image pixel if the RGB image pixel meets a preset pixel condition, so as to obtain a processed target image.
In an embodiment of the present invention, the RGB image pixels include RGB image foreground pixels and RGB image background pixels; the IR image pixels comprise IR image foreground pixels and IR image background pixels;
the image processing module 602 may include the following sub-modules:
a first pixel difference determining sub-module, configured to determine a first pixel difference between a foreground pixel of the RGB image and a background pixel of the RGB image;
a first pixel difference value judgment sub-module, configured to determine a second pixel difference value between the IR image background pixel and the IR image foreground pixel if the first pixel difference value does not reach a preset threshold;
and the first image cutting sub-module is used for cutting the RGB image according to the IR image if the second pixel difference value reaches a preset threshold value.
In one embodiment of the invention, the IR image comprises an IR transmission image; the image cropping sub-module may include the following elements:
a vertex position acquisition unit for acquiring a vertex position of the IR transmission image;
and the image clipping unit is used for determining a clipping area formed by connecting the vertex positions and clipping the RGB image according to the clipping area.
In an embodiment of the present invention, the image processing module 602 may further include the following sub-modules:
and the second image cutting submodule is used for determining a cutting boundary according to the RGB image foreground pixel and the RGB image background pixel if the first pixel difference value reaches a preset threshold value, and cutting the RGB image by adopting the cutting boundary.
In one embodiment of the invention, the CIS sensor on both sides of the medium has an IR light source and a light source emitting part; the image acquisition module 601 may include the following sub-modules:
and the IR image acquisition sub-module is used for controlling the light source emission part to emit the IR light source to the medium and controlling the CIS sensors positioned on two sides of the medium to acquire an IR transmission image obtained by the IR light source passing through the medium.
In one embodiment of the present invention, the IR image acquisition sub-module may include the following units:
an IR light source receiving unit for receiving an IR light source emitted from a CIS sensor located on one side of the medium by the CIS sensor located on the other side of the medium;
and the IR image acquisition unit is used for forming an IR transmission image according to an IR direct light source obtained by the IR light source through the medium and an IR transmission light source obtained by the IR light source through the medium.
In one embodiment of the present invention, the CIS sensors on both sides of the medium include an upper CIS sensor on an upper side of the medium and a lower CIS sensor on a lower side of the medium.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
An embodiment of the present invention further provides an electronic device, including:
one or more processors; and
one or more machine-readable media storing instructions thereon, which when executed by the one or more processors, enable the electronic device to implement the processes of the above-described embodiments of the image processing method, and achieve the same technical effects, which are not described herein again to avoid repetition.
The embodiment of the present invention further provides one or more machine-readable media, where instructions are stored on the one or more machine-readable media, and when the instructions are executed by one or more processors, the processors are enabled to implement the processes of the embodiment of the image processing method, and achieve the same technical effects, and in order to avoid repetition, the descriptions are omitted here.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The image processing method, the image processing apparatus, the electronic device and the medium provided by the present invention are described in detail above, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. An image processing method applied to an image processing apparatus including CIS sensors on both sides of a medium, the method comprising:
respectively acquiring an RGB image and an IR image for the medium through the CIS sensors positioned on the two sides of the medium; the RGB image and the IR image comprise RGB image pixels and IR image pixels, respectively;
and if the RGB image pixels meet the preset pixel condition, processing the RGB image according to the IR image pixels to obtain a processed target image.
2. The method of claim 1, wherein the RGB image pixels comprise RGB image foreground pixels and RGB image background pixels; the IR image pixels comprise IR image foreground pixels and IR image background pixels;
if the RGB image pixel meets a preset pixel condition, processing the RGB image according to the IR image pixel, including:
determining a first pixel difference value of the RGB image foreground pixel and the RGB image background pixel;
if the first pixel difference value does not reach a preset threshold value, determining a second pixel difference value of the IR image background pixel and the IR image foreground pixel;
and if the second pixel difference value reaches a preset threshold value, cutting the RGB image according to the IR image.
3. The method of claim 2, wherein the IR image comprises an IR transmission image; the IR image cropping the RGB image, comprising:
acquiring a vertex position of the IR transmission image;
determining a clipping area formed by connecting the vertex positions, and clipping the RGB image according to the clipping area.
4. The method of claim 2, further comprising:
if the first pixel difference value reaches a preset threshold value, determining a cutting boundary according to the RGB image foreground pixel and the RGB image background pixel, and cutting the RGB image by adopting the cutting boundary.
5. The method according to claim 1, wherein the CIS sensor on both sides of the medium has an IR light source and a light source emitting part; acquiring IR images for the medium by the CIS sensors on both sides of the medium, comprising:
and controlling the light source emitting component to emit the IR light source to the medium, and controlling the CIS sensors positioned on two sides of the medium to acquire an IR transmission image obtained by the IR light source passing through the medium.
6. The method of claim 5, wherein the capturing of the IR transmission image of the IR light source through the media by the CIS sensors on both sides of the media comprises:
receiving IR light sources emitted by CIS sensors positioned on one side of a medium by the CIS sensors positioned on the other side of the medium;
an IR transmission image is formed as a direct IR light source obtained by said IR light source through said medium and as a transmitted IR light source obtained by said IR light source through said medium.
7. The method according to claim 1, 5 or 6, wherein the CIS sensors on both sides of the medium comprise an upper CIS sensor on an upper side of the medium and a lower CIS sensor on a lower side of the medium.
8. An image processing apparatus applied to an image processing device including CIS sensors on both sides of a medium, the apparatus comprising:
the image acquisition module is used for respectively acquiring an RGB image and an IR image aiming at the medium through the CIS sensors positioned on the two sides of the medium; the RGB image and the IR image comprise RGB image pixels and IR image pixels, respectively;
and the image processing module is used for processing the RGB image according to the IR image pixel to obtain a processed target image if the RGB image pixel meets a preset pixel condition.
9. An electronic device, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the electronic device to perform the image processing method of any of claims 1-7.
10. One or more machine readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the image processing method of any one of claims 1-7.
CN202110218049.4A 2021-02-26 2021-02-26 Image processing method, device, electronic equipment and medium Active CN114979589B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110218049.4A CN114979589B (en) 2021-02-26 2021-02-26 Image processing method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110218049.4A CN114979589B (en) 2021-02-26 2021-02-26 Image processing method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114979589A true CN114979589A (en) 2022-08-30
CN114979589B CN114979589B (en) 2024-02-06

Family

ID=82973588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110218049.4A Active CN114979589B (en) 2021-02-26 2021-02-26 Image processing method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114979589B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004310662A (en) * 2003-04-10 2004-11-04 Canon Inc Image reader
CN101753812A (en) * 2008-12-05 2010-06-23 索尼株式会社 Imaging apparatus and imaging method
US20120127492A1 (en) * 2010-11-19 2012-05-24 Canon Kabushiki Kaisha Image processing apparatus and control method thereof
KR20150137169A (en) * 2014-05-28 2015-12-09 재단법인 다차원 스마트 아이티 융합시스템 연구단 Dual aperture camera for including pin hole located in altered position
CN105741282A (en) * 2016-01-27 2016-07-06 深圳辰通智能股份有限公司 Method and system for automatically detecting filling color of bill image elements
CN108933879A (en) * 2017-05-22 2018-12-04 深圳市安普盛科技有限公司 A kind of CIS scanning means, system and scan method
CN109410215A (en) * 2018-08-02 2019-03-01 北京三快在线科技有限公司 Image processing method, device, electronic equipment and computer-readable medium
CN110533049A (en) * 2018-05-23 2019-12-03 富士通株式会社 The method and apparatus for extracting seal image
CN110751862A (en) * 2019-10-25 2020-02-04 汉王科技股份有限公司 Handheld reader and data processing method thereof
CN111275696A (en) * 2020-02-10 2020-06-12 腾讯科技(深圳)有限公司 Medical image processing method, image processing method and device
CN111432099A (en) * 2020-03-30 2020-07-17 Oppo广东移动通信有限公司 Image sensor, processing system and method, electronic device, and storage medium
CN112307824A (en) * 2019-07-30 2021-02-02 深圳怡化电脑股份有限公司 Method, device, system and readable medium for identifying tampering of bill number area

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004310662A (en) * 2003-04-10 2004-11-04 Canon Inc Image reader
CN101753812A (en) * 2008-12-05 2010-06-23 索尼株式会社 Imaging apparatus and imaging method
US20120127492A1 (en) * 2010-11-19 2012-05-24 Canon Kabushiki Kaisha Image processing apparatus and control method thereof
KR20150137169A (en) * 2014-05-28 2015-12-09 재단법인 다차원 스마트 아이티 융합시스템 연구단 Dual aperture camera for including pin hole located in altered position
CN105741282A (en) * 2016-01-27 2016-07-06 深圳辰通智能股份有限公司 Method and system for automatically detecting filling color of bill image elements
CN108933879A (en) * 2017-05-22 2018-12-04 深圳市安普盛科技有限公司 A kind of CIS scanning means, system and scan method
CN110533049A (en) * 2018-05-23 2019-12-03 富士通株式会社 The method and apparatus for extracting seal image
CN109410215A (en) * 2018-08-02 2019-03-01 北京三快在线科技有限公司 Image processing method, device, electronic equipment and computer-readable medium
CN112307824A (en) * 2019-07-30 2021-02-02 深圳怡化电脑股份有限公司 Method, device, system and readable medium for identifying tampering of bill number area
CN110751862A (en) * 2019-10-25 2020-02-04 汉王科技股份有限公司 Handheld reader and data processing method thereof
CN111275696A (en) * 2020-02-10 2020-06-12 腾讯科技(深圳)有限公司 Medical image processing method, image processing method and device
CN111432099A (en) * 2020-03-30 2020-07-17 Oppo广东移动通信有限公司 Image sensor, processing system and method, electronic device, and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ARAZ YACOUBIAN; DANNY D. YANG: "Contact Image Sensor Automated Resolution Testing Using Stationary Test Objects", 《IEEE SENSORS JOURNAL》, vol. 17, no. 13, XP011652580, DOI: 10.1109/JSEN.2017.2704914 *
刘梦涛 等: "接触式图像传感器在金融电子装备中的应用研究", 《科技传播》, vol. 7, no. 3 *
谢欣: "基于CIS的证件信息采集仪硬件设计与实现", 《硕士论文》 *

Also Published As

Publication number Publication date
CN114979589B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
US8416314B2 (en) Method and system for processing images
US8582862B2 (en) Mobile image quality assurance in mobile document image processing applications
CN107358593B (en) Image forming method and apparatus
US10356269B2 (en) Image reading apparatus and original size detection method
CN111862195A (en) Light spot detection method and device, terminal and storage medium
US9807269B2 (en) System and method for low light document capture and binarization with multiple flash images
US10354352B2 (en) Image processing apparatus, image processing method, and storage medium
JP6435661B2 (en) Object identification system, information processing apparatus, information processing method, and program
US9485407B2 (en) Method of capturing images and obtaining information of the images
JP2010064531A (en) White line detection device
US8488213B2 (en) Methods and systems for no-touch scanning
KR20150059302A (en) Method for recognizing character by fitting image shot, and information processing device for executing it
JP2012088785A (en) Object identification device and program
JP2010026992A (en) Coin identification method and coin identification device
JP5018652B2 (en) Object presence determination device
CN114979589B (en) Image processing method, device, electronic equipment and medium
KR20230107255A (en) Foldable electronic device for multi-view image capture
KR101490909B1 (en) Apparatus and method for image processing of vehicle
CN112997217A (en) Document detection from video images
JP5282461B2 (en) Imaging device
JP2014230117A (en) Document reader and document reading method
JP2014170173A (en) Image processor
US20160275345A1 (en) Camera systems with enhanced document capture
KR102501461B1 (en) Method and Apparatus for distinguishing forgery of identification card
WO2023195403A1 (en) Image processing device and image processing method

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