CN114979589B - Image processing method, device, electronic equipment and medium - Google Patents

Image processing method, device, electronic equipment and medium Download PDF

Info

Publication number
CN114979589B
CN114979589B CN202110218049.4A CN202110218049A CN114979589B CN 114979589 B CN114979589 B CN 114979589B CN 202110218049 A CN202110218049 A CN 202110218049A CN 114979589 B CN114979589 B CN 114979589B
Authority
CN
China
Prior art keywords
image
medium
pixel
rgb
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.)
Active
Application number
CN202110218049.4A
Other languages
Chinese (zh)
Other versions
CN114979589A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

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 the image processing device, wherein the image processing device comprises CIS sensors positioned at two sides of the medium, and the method comprises the following steps: respectively acquiring RGB images and IR images aiming at the medium through the CIS sensors positioned on two sides of the medium; the RGB image and the IR image include RGB image pixels and IR image pixels, respectively; and if the RGB image pixels meet the preset pixel conditions, processing the RGB image according to the IR image pixels to obtain a processed target image. By combining the mode of determining the clipping boundary by utilizing the RGB light source and the mode of determining the clipping boundary by utilizing the IR light source, clipping of the image with black or dark acquired foreground is realized, and the success rate of image extraction is improved.

Description

Image processing method, device, electronic equipment and medium
Technical Field
The present invention relates to the field of image processing technology, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a machine readable medium.
Background
The image area acquired by the CIS (Contact Image Sensor ) may include a background image area and a foreground image area, and in a normal case, the extracted target image only needs an image foreground RGB (RGB color mode) image, and the extracted image is beneficial to algorithm processing and correcting image tilt.
In the prior art, the adopted image cropping extraction mainly uses an RGB light source to determine the cropping boundary, and the cropping boundary cannot be accurately determined in the manner that the acquired medium image is black because the black medium can almost absorb the RGB light source and the image background acquired by the common light source is also black.
Disclosure of Invention
In view of the above, embodiments of the present invention have been made 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 problems.
In order to solve the above-described problems, an embodiment of the present invention discloses an image processing method applied to an image processing apparatus including CIS sensors located on both sides of a medium, the method including:
respectively acquiring RGB images and IR images aiming at the medium through the CIS sensors positioned on two sides of the medium; the RGB image and the IR image include RGB image pixels and IR image pixels, respectively;
and if the RGB image pixels meet the preset pixel conditions, processing the RGB image according to the IR image pixels to obtain a processed target image.
Optionally, the RGB image pixels include RGB image foreground pixels and RGB image background pixels; the IR image pixels include IR image foreground pixels and IR image background pixels;
and if the RGB image pixels meet a preset pixel condition, processing the RGB image according to the IR image pixels, 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 between the IR image background pixel and the IR image foreground pixel;
and if the second pixel difference value reaches a preset threshold value, clipping 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 the vertex position of the IR transmission image;
and determining a clipping region formed by connecting the vertex positions, and clipping the RGB image according to the clipping region.
Optionally, the method further comprises:
and if the first pixel difference value reaches a preset threshold value, determining a clipping boundary according to the RGB image foreground pixel and the RGB image background pixel, and clipping the RGB image by adopting the clipping boundary.
Optionally, the CIS sensor located on both sides of the medium has an IR light source and a light source emitting part; acquiring an IR image for a medium by the CIS sensors located on both sides of the medium, comprising:
and controlling the light source emitting part to emit the IR light source to the medium, and controlling the CIS sensors positioned at 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 at two sides of the medium, an IR transmission image obtained by the IR light source passing through the medium includes:
receiving an IR light source emitted by a CIS sensor located on one side of the medium by a CIS sensor located on the other side of the medium;
an IR transmission image is formed from an IR direct light source obtained by passing the IR light source through the medium and an IR transmission light source obtained by passing the IR light source through the medium.
Alternatively, the CIS sensors located at both sides of the medium include 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 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 at two sides of a medium, and the device comprises:
the image acquisition module is used for respectively acquiring RGB images and IR images aiming at the medium through the CIS sensors positioned at the two sides of the medium; the RGB image and the IR image include 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 if the RGB image pixel meets the preset pixel condition, so as to obtain a processed target image.
Optionally, the RGB image pixels include RGB image foreground pixels and RGB image background pixels; the IR image pixels include IR image foreground pixels and IR image background pixels;
the image processing module includes:
a first pixel difference determining sub-module, configured to determine a first pixel difference between the RGB image foreground pixel and the RGB image background pixel;
a first pixel difference value judging 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 value;
and the first image clipping sub-module is used for clipping 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 submodule comprises:
a vertex position acquisition unit configured to acquire a vertex position of the IR transmission image;
and the image clipping unit is used for determining clipping areas formed by connecting the vertex positions and clipping the RGB image according to the clipping areas.
Optionally, the image processing module further includes:
and the second image clipping sub-module is used for determining clipping boundaries according to the RGB image foreground pixels and the RGB image background pixels if the first pixel difference value reaches a preset threshold value, and clipping the RGB image by adopting the clipping boundaries.
Optionally, the sensor on both sides of the medium has an IR light source and a light source emitting means; the image acquisition module includes:
and the IR image acquisition submodule is used for controlling the light source emitting part to emit the IR light source to the medium and controlling the CIS sensors positioned at 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 submodule includes:
an IR light source receiving unit for receiving an IR light source emitted from a CIS sensor located at one side of the medium through the CIS sensor located at the other side of the medium;
and the IR image acquisition unit is used for forming an IR transmission image according to the IR direct light source obtained by the IR light source through the medium and the IR transmission light source obtained by the IR light source through the medium.
Alternatively, the CIS sensors located at both sides of the medium include 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 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, which when executed by the one or more processors, cause the electronic device to perform any of the image processing methods of the claims.
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 RGB image and the IR image aiming at the medium can be respectively acquired through the CIS sensors positioned at the two sides 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 clipping boundary by utilizing the RGB light source and the mode of determining the clipping boundary by utilizing the IR light source, clipping of the image with black or dark acquired foreground is realized, and the success rate of image extraction is improved.
Drawings
Fig. 1 is a schematic diagram illustrating an operation principle of a CIS sensor according to 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 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 dark media in an embodiment of the present invention;
FIG. 5 is a schematic representation of an IR image captured for a dark medium according to an embodiment of the invention;
fig. 6 is a block diagram of an embodiment of an image processing apparatus of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
The CIS sensor can collect original images of the medium and can perform related processing on the collected original images.
Because the collection range of the CIS sensor is larger, the collected image area may include a background image area and a foreground image area, the foreground image area may refer to an effective image area, and when the image is used for subsequent application, generally, only an effective image area (i.e., an image foreground RGB image) used for identification, pseudo-identification and other algorithm processing and display is needed, then performing related processing on the collected original image may refer to extracting the image foreground RGB image included in the original image, so as to perform subsequent algorithm processing and image inclination correction by adopting the processed image.
Specifically, referring to fig. 1, a schematic diagram illustrating a working principle of a CIS sensor in an embodiment of the present invention is shown, where an image of a medium is collected by using the CIS sensor, which may be expressed as that in a process of scanning the medium, red, green and blue light (may be simply referred to as an RGB light source) is emitted by the CIS sensor, and then light reflected by the scanned medium is collected by a cylindrical lens, where the collected image may be a color image composed of three colors of RGB, that is, an RGB image.
Wherein, the range of each pixel point value can be 0-255,0 represents the darkest color, 255 represents the brightest color, and then for the images of three colors of R (Red), G (Green), B (Blue), when the value of the image pixel is 0, the color of the current image can 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, the foreground RGB image of the image contained in the acquired RGB image is extracted, that is, the existing image clipping and extracting method mainly uses the difference between the foreground pixel and the background pixel in the RGB image to determine the image boundary, and then clipping and extracting are performed according to the determined four boundaries.
In the prior art, when the scanned medium is black or dark medium and the image background collected by the light source is black, the difference between the foreground pixel and the background pixel in the RGB image is small, which is unfavorable for determining the clipping boundary, and therefore the foreground RGB image of the image cannot be extracted or the clipped image is incomplete.
One of the core ideas of the embodiment of the invention is to acquire an IR (Infrared) transmission image in an IR transmission mode according to the characteristics of a module CIS sensor, extract black or dark image prospects needing to be cut through boundary calculation, and cut the image with the acquired black or dark image prospects by combining a mode of determining a cutting boundary by utilizing an RGB light source and a mode of determining the cutting boundary by utilizing an IR light source, thereby improving the success rate of image extraction.
Referring to fig. 2, which illustrates a schematic structure of an image processing module in 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 substantially identical in structure and can respectively comprise a light source (1), a sensor (2), a lenticular lens array (3) and a plate glass (5), and the upper CIS sensor and the lower CIS sensor can respectively comprise an upper CIS (7) and a lower CIS (8). In an embodiment of the invention, the upper CIS (7) may be used to scan a front image of the media and the lower CIS (8) may be used to scan a back image of the media.
The upper CIS (7) and the lower CIS (8) are distinguished by only using different designations, and are actually identical in structure.
In the embodiment of the invention, in the process of acquiring the image by adopting the image processing device, the light source (1) can be used for providing a light source with a specific color, such as a R, G, B, IR light source and the like; the sensor (2) may be used to collect 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 scanned medium, such as A4 paper, a bank card, etc., and the embodiment of the present invention is not limited.
In practical application, when the upper CIS sensor and the lower CIS sensor are used to collect images of a medium by using RGB light sources, the working principle of the CIS sensor may be as shown in fig. 1, where the upper CIS sensor collects RGB images, the CIS sensor may include a light source emitting component, and the light source emitting component may be controlled to emit RGB light source to a medium direction through a sheet glass, so that emitted light may change a propagation direction of the light when the emitted light reaches a surface of the medium, that is, reflection is generated, and the lenticular lens array may control light reflected by the medium to be emitted along a direction where the sensor is located, so as to ensure that the light reflected by the medium can be collected by the sensor. Similarly, the process of capturing RGB images by the lower CIS sensor may be as described in the above process of capturing RGB images by the upper CIS sensor, and in order to avoid repetition, the description is omitted here.
In a preferred embodiment, in order to acquire an IR transmission image by using an IR transmission manner, the upper CIS sensor and the lower CIS sensor may each include a light source that provides an IR light source, and each of the upper CIS sensor and the lower CIS sensor may have a light source emitting part, and in a specific implementation, the upper CIS sensor and the lower CIS sensor may be respectively located at a relative position with respect to a desired scanning medium, then when the upper CIS sensor emits the IR light source in a direction of the desired scanning medium, the light source emitting part may be controlled to emit the IR light source, and the lower CIS sensor may receive the IR light source emitted by the upper CIS sensor (may be simply referred to as up-down-); when the lower CIS sensor emits an IR light source in the direction of the medium to be scanned, the light source emitting means may be controlled to emit the IR light source as well, and the upper CIS sensor may receive the IR light source emitted from the lower CIS sensor as well (may be simply referred to as down-send up-receive).
In practical application, taking the above sending and receiving as an example, the provided IR light source may include IR direct light (6) and IR transmission light (9), the light of the IR direct light (6) is stronger, and at this time, the infrared light source emitted by the light source (1) of the upper CIS (7) may be received by the lower CIS (8); the light of the IR transmitted light (9) is weaker, and the IR light source emitted by the light source (1) of the upper CIS (7) can be received by the lower CIS (8) after passing through the medium. Similarly, the process of transmitting and receiving may be described in the above-mentioned process of transmitting and receiving, and in order to avoid repetition, the description is omitted here.
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 described above is applicable 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, to which the embodiments of the present invention are not limited.
Referring to fig. 3, which shows a flowchart of steps of an embodiment of an image processing method of the present invention, the image processing apparatus may include CIS sensors located on both sides of a (dark) medium, and may include the steps of:
step 301, respectively acquiring an RGB image and an IR image aiming at a medium through the CIS sensors positioned at two sides of the medium;
in one embodiment of the invention, an image processing module as shown in FIG. 2 may be employed to scan the 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 to process the RGB image by the values of the RGB image pixels and the IR image pixels.
The CIS sensors positioned on two sides of the medium can be provided with RGB light sources and IR light sources, the RGB images can be obtained by adopting an emission mode of the RGB light sources, and the IR images can be obtained by adopting an IR transmission mode.
In one aspect, RGB images for a medium are acquired by CIS sensors located on both sides of the medium, which may be obtained by emitting RGB light sources to the medium using light source emitting parts provided inside the CIS sensors, and collecting RGB light sources by the CIS sensors located on both sides of the medium, through reflection of the medium.
On the other hand, an IR image for a medium is acquired by CIS sensors located on both sides of the medium, which can be obtained by emitting an IR light source to the medium using a light source emitting part provided inside the CIS sensors, and collecting the IR light source through the medium by CIS sensors located on both sides of the medium.
In practical applications, the IR image collected may be an IR transmission image, specifically, the IR light source emitted by the CIS sensor located on one side of the medium may be received by the CIS sensor located on the other side of the medium, and the IR direct light source obtained by passing the IR light source through the medium, and the IR transmission light source obtained by passing the IR light source through the medium may form the IR transmission image.
In a specific implementation, a CIS sensor located on one side of the media may refer to an upper CIS sensor located on an upper side of the media, and a CIS sensor located on the other side of the media may refer to a lower CIS sensor located on a lower side of the media. It should be noted that, the upper CIS sensor and the lower CIS sensor may be located at the relative positions with respect to the required scanning medium, and the IR light source may be not only configured in the foregoing manner of sending out and up and receiving, but also configured in the manner of sending out and down, which is not limited in this embodiment of the present invention.
Step 302, 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.
In the embodiment of the invention, the medium scanned by the image processing module may be a dark or black medium, and the obtained RGB image may be an RGB image for the dark or black medium, if the image background collected by the RGB light source is also black, the difference between pixel values of the RGB foreground image and the RGB background image is smaller, and the RGB image of the dark or black medium cannot be processed by comparing the pixel difference values by using the RGB light source.
As an example, when an RGB light source is used to illuminate a medium, since the black or dark medium can almost fully absorb the red, green, and blue light sources, so that normal light is not reflected, when an image of the medium is black (e.g., a black bank card), and the background of the image collected by the normal light source is also black, the foreground pixel value and the background pixel value are slightly different, so that the image cannot be extracted by this method (as shown in fig. 4), or the cropped image is incomplete.
The RGB image of the dark or black medium is processed, which is essentially a clipping and extracting of the foreground image of the RGB image, and then the processed target image may be an image only including the foreground image (i.e., the effective image area).
In one embodiment of the present invention, when the above situation occurs, the acquired RGB image is not processed by determining the clipping boundary by using the RGB image pixels, but the RGB image of the dark or black medium is processed by using the IR image pixels, so as to clip the image with the acquired foreground of black or dark color, thereby improving the success rate of image extraction.
Wherein 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 applications, when the RGB image pixels meet the preset pixel condition, that is, the difference between the RGB image foreground pixels and the RGB image background pixels is small, the IR image pixels can be used to process the RGB image.
Specifically, in order to determine whether the RGB image pixel satisfies the above-mentioned preset pixel condition, first, a first pixel difference value between the RGB image foreground pixel and the RGB image background pixel may be determined, and whether the first pixel difference value reaches a preset threshold value may be determined, where the following two cases may occur:
(1) If the first pixel difference value reaches the preset threshold value, the current RGB image foreground pixel is larger than the RGB image background pixel, the current RGB image foreground pixel and the RGB image background pixel have smaller phase difference, the RGB image pixel meets the preset pixel condition, and at the moment, the RGB image can be processed through the IR image pixel; (2) If the first pixel difference value reaches the preset threshold value, the current foreground pixel of the RGB image and the background pixel of the RGB image can be indicated to have larger differences, and the pixels of the RGB image do not meet the preset pixel condition, and at this time, the RGB image can be processed through the pixels of the RGB image.
In the first case, that is, if the first pixel difference value does not reach the preset threshold value, a second pixel difference value between the background pixel of the IR image and the foreground pixel of the IR image may be determined, and in the case that the second pixel difference value reaches the preset threshold value, the RGB image is cropped according to the IR image.
In a specific implementation, since the wavelength of the IR light source is long and is not easy to scatter, in the process of adopting the up-down or down-up mode, in the area not blocked by the dark or black medium, the background image collected by the CIS sensor may be close to white (as shown in fig. 5), which is essentially determined by the intensity of the IR light source received by the CIS (i.e. the above-mentioned stronger IR direct light and weaker IR transmitted light), so that it is beneficial to distinguish the IR image foreground image from the IR image background image of the IR image.
In practical applications, clipping boundaries for RGB may be determined by IR image background pixels and IR image foreground pixels.
Specifically, the acquired IR transmission image is an image with obvious difference between the foreground image and the background image, so that the vertex position of the IR transmission image can be acquired, and a clipping region formed by connecting the vertex positions can be determined; because the position of the medium is not changed in the process of scanning the dark or black medium by adopting the IR light source and the RGB light source, the formed clipping region can be used as a clipping boundary for RGB at the moment, and then the clipping region is adopted to clip the RGB image so as to extract the RGB foreground image in the RGB image.
The shape of the cut region may be the same as the shape of the medium to be scanned, for example, a rectangle.
In the second case, that is, if the difference value of the first pixel reaches the preset threshold, since the difference between the foreground pixel of the RGB image and the background pixel of the RGB image is larger at this time, the clipping boundary may be determined directly according to the foreground pixel of the RGB image and the background pixel of the RGB image, and the RGB image may be clipped by adopting the clipping boundary.
In order to make the above image processing means better understood by a person 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, a background pixel value of P2, and a preset threshold value set for the difference between the foreground pixel and the background pixel is K (which may be in the general range of 30-100 as the case may be).
In the process of acquiring the image, initializing the image acquisition device shown in fig. 2, detecting the state of the device, 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 applied to the medium through light sources of an upper CIS and a lower CIS, RGB images can be acquired through the CIS, the upper CIS can be controlled to start the IR light sources, so that the lower CIS can receive the IR direct light sources and the IR transmission light sources after the medium passes through the lower CIS, or the lower CIS can be controlled to start the IR light sources, so that the upper CIS can receive the IR direct light sources and the IR transmission light sources after the medium passes through the upper CIS.
After the RGB image and the IR image are obtained by the CIS sensor, the image may be processed to obtain a target image, specifically, a foreground RGB image of the clipping extraction image, and the foreground RGB image after clipping is obtained.
In the process of processing the image, firstly, a RGB light source comparison pixel difference mode can be adopted to determine a cutting boundary, wherein the image boundary can be judged by the foreground background difference value of any light source image in the RGB light source, and when P2-P1> K in the RGB image is considered as the boundary, the cutting boundary is cut and extracted according to the four boundaries of the upper, lower, left and right sides; if P2-P1< K in the RGB image, as an example, assuming that P1 is (19,20,28), P2 is (23,21,23), and P2-P1< preset threshold minimum value 30, this indicates that the extraction fails according to the foregoing method, the boundary may be determined by P2-P1> K in the IR image, and as an example, assuming that P1 is (58,52,56), P2 is (255 ), and P2-P1> preset threshold maximum value 100, the RGB image may be cut by the cut rectangular four-vertex position of the IR transmission map.
In the embodiment of the invention, the RGB image and the IR image aiming at the medium can be respectively acquired through the CIS sensors positioned at the two sides 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 clipping boundary by utilizing the RGB light source and the mode of determining the clipping boundary by utilizing the IR light source, clipping of the image with black or dark acquired foreground is realized, and the success rate of image extraction is improved.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 6, there is shown a block diagram of an embodiment of an image processing apparatus of the present invention, applied to an image processing device including CIS sensors located on both sides of a medium, which may include the following modules in particular:
an image acquisition module 601, configured to acquire an RGB image and an IR image for a medium respectively by the CIS sensors located on two sides of the medium; the RGB image and the IR image include RGB image pixels and IR image pixels, respectively;
the image processing module 602 is 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 one embodiment of the invention, the RGB image pixels include RGB image foreground pixels and RGB image background pixels; the IR image pixels include 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 the RGB image foreground pixel and the RGB image background pixel;
a first pixel difference value judging 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 value;
and the first image clipping sub-module is used for clipping 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 units:
a vertex position acquisition unit configured to acquire a vertex position of the IR transmission image;
and the image clipping unit is used for determining clipping areas formed by connecting the vertex positions and clipping the RGB image according to the clipping areas.
In one embodiment of the present invention, the image processing module 602 may further include the following sub-modules:
and the second image clipping sub-module is used for determining clipping boundaries according to the RGB image foreground pixels and the RGB image background pixels if the first pixel difference value reaches a preset threshold value, and clipping the RGB image by adopting the clipping boundaries.
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 submodule is used for controlling the light source emitting part to emit the IR light source to the medium and controlling the CIS sensors positioned at 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 invention, the IR image acquisition sub-module may include the following elements:
an IR light source receiving unit for receiving an IR light source emitted from a CIS sensor located at one side of the medium through the CIS sensor located at the other side of the medium;
and the IR image acquisition unit is used for forming an IR transmission image according to the IR direct light source obtained by the IR light source through the medium and the IR transmission light source obtained by the IR light source through the medium.
In one embodiment of the present invention, the CIS sensors located at both sides of the medium include 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.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides electronic equipment, which comprises:
one or more processors; and
the one or more machine-readable media, on which the instructions are stored, when executed by the one or more processors, cause the electronic device to perform the processes of the image processing method embodiments described above, and achieve the same technical effects, and are not described herein in detail to avoid repetition.
The embodiments of the present invention further provide one or more machine-readable media, on which instructions are stored, which when executed by one or more processors, cause the processors to implement the processes of the embodiments of the image processing method described above when executed, and achieve the same technical effects, and in order to avoid repetition, a description is omitted herein.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that 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 invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, 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 apparatus 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 apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus 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 in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The image processing method, device, electronic equipment and medium provided by the invention are described in detail, and specific examples are applied to illustrate the principle and implementation of the invention, and the description of the above examples is only used for helping to understand the method and core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (9)

1. An image processing method, characterized by being applied to an image processing apparatus including CIS sensors located on both sides of a medium, comprising:
respectively acquiring RGB images and IR images aiming at the medium through the CIS sensors positioned on two sides of the medium; the RGB image and the IR image include RGB image pixels and IR image pixels, respectively;
if the RGB image pixels meet the preset pixel conditions, the RGB image is processed according to the IR image pixels, and a processed target image is obtained; the preset pixel condition is a condition that a first pixel difference value between an RGB image foreground pixel and an RGB image background pixel of the RGB image pixel does not reach a preset threshold value, and a second pixel difference value between an IR image background pixel and an IR image foreground pixel of the IR image pixel reaches the preset threshold value; the processing of the RGB image includes cropping the RGB image based on a cropping area, wherein the cropping area is formed based on a vertex position of an IR projection image included in the IR image.
2. The method of claim 1, wherein processing the RGB image from the IR image pixels if the RGB image pixels meet a preset pixel condition comprises:
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 between the IR image background pixel and the IR image foreground pixel;
and if the second pixel difference value reaches a preset threshold value, clipping the RGB image according to the IR image.
3. The method as recited in claim 2, further comprising:
and if the first pixel difference value reaches a preset threshold value, determining a clipping boundary according to the RGB image foreground pixel and the RGB image background pixel, and clipping the RGB image by adopting the clipping boundary.
4. The method of claim 1, wherein the CIS sensors on both sides of the medium have an IR light source and a light source emitting means; acquiring an IR image for a medium by the CIS sensors located on both sides of the medium, comprising:
and controlling the light source emitting part to emit the IR light source to the medium, and controlling the CIS sensors positioned at two sides of the medium to acquire an IR transmission image obtained by the IR light source passing through the medium.
5. The method of claim 4, wherein the capturing of the IR transmission image of the IR light source through the medium by the CIS sensors located on both sides of the medium comprises:
receiving an IR light source emitted by a CIS sensor located on one side of the medium by a CIS sensor located on the other side of the medium;
an IR transmission image is formed from an IR direct light source obtained by passing the IR light source through the medium and an IR transmission light source obtained by passing the IR light source through the medium.
6. The method of claim 1, 4 or 5, wherein 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.
7. An image processing apparatus, characterized by being applied to an image processing device including CIS sensors located on both sides of a medium, comprising:
the image acquisition module is used for respectively acquiring RGB images and IR images aiming at the medium through the CIS sensors positioned at the two sides of the medium; the RGB image and the IR image include RGB image pixels and IR image pixels, respectively;
the image processing module is used for processing the RGB image according to the IR image pixel if the RGB image pixel meets the preset pixel condition to obtain a processed target image; the preset pixel condition is a condition that a first pixel difference value between an RGB image foreground pixel and an RGB image background pixel of the RGB image pixel does not reach a preset threshold value, and a second pixel difference value between an IR image background pixel and an IR image foreground pixel of the IR image pixel reaches the preset threshold value; the processing of the RGB image includes cropping the RGB image based on a cropping area, wherein the cropping area is formed based on a vertex position of an IR projection image included in the IR image.
8. An electronic device, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform the image processing method of any of claims 1-6.
9. 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 of claims 1-6.
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 CN114979589A (en) 2022-08-30
CN114979589B true 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 (11)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5715386B2 (en) * 2010-11-19 2015-05-07 キヤノン株式会社 Image processing apparatus, control method therefor, program, and storage medium

Patent Citations (11)

* 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
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
Contact Image Sensor Automated Resolution Testing Using Stationary Test Objects;Araz Yacoubian; Danny D. Yang;《IEEE Sensors Journal》;第17卷(第13期);全文 *
基于CIS的证件信息采集仪硬件设计与实现;谢欣;《硕士论文》;全文 *
接触式图像传感器在金融电子装备中的应用研究;刘梦涛 等;《科技传播》;第7卷(第3期);全文 *

Also Published As

Publication number Publication date
CN114979589A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN115174877B (en) Projection device and focusing method thereof
CN106210698B (en) The control method of depth camera
US20100315512A1 (en) Method and System for Processing Images
US10356269B2 (en) Image reading apparatus and original size detection method
US10354352B2 (en) Image processing apparatus, image processing method, and storage medium
KR20120068655A (en) Method and camera device for capturing iris or subject of good quality with one bandpass filter passing both visible ray and near infra red ray
US20130222643A1 (en) Image Capture Method and image Capture system thereof
US9485407B2 (en) Method of capturing images and obtaining information of the images
US20230336877A1 (en) Illumination control for imaging systems with multiple image sensors
US8488213B2 (en) Methods and systems for no-touch scanning
CN110572583A (en) method for shooting image and camera
CN114979589B (en) Image processing method, device, electronic equipment and medium
CN105991889B (en) Scanning device with overhead reflector
US11330177B2 (en) Image processing apparatus and image processing method
US20130222632A1 (en) Electronic camera
US20190073558A1 (en) Information processing apparatus, information processing method, and computer program
JP2014170173A (en) Image processor
US20160275345A1 (en) Camera systems with enhanced document capture
CN112997217A (en) Document detection from video images
JP2014230117A (en) Document reader and document reading method
JP5732799B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5977526B2 (en) Image processing apparatus and image processing method
JP2019080181A (en) Scanner, display device, scan control program, display control program, and scan data production method
JP2013186560A (en) Image processing apparatus
CN116343289A (en) Face detection method, face detection system, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant