CN113129242A - Image identification triggering method and device - Google Patents

Image identification triggering method and device Download PDF

Info

Publication number
CN113129242A
CN113129242A CN201911412503.9A CN201911412503A CN113129242A CN 113129242 A CN113129242 A CN 113129242A CN 201911412503 A CN201911412503 A CN 201911412503A CN 113129242 A CN113129242 A CN 113129242A
Authority
CN
China
Prior art keywords
image
light
background
fill
indication value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911412503.9A
Other languages
Chinese (zh)
Inventor
张岩
黄韵棋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sinosecu Technology Co ltd
Original Assignee
Beijing Sinosecu 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 Beijing Sinosecu Technology Co ltd filed Critical Beijing Sinosecu Technology Co ltd
Priority to CN201911412503.9A priority Critical patent/CN113129242A/en
Publication of CN113129242A publication Critical patent/CN113129242A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides an image identification triggering method and device, wherein the method comprises the following steps: shooting towards an article placement area to obtain a light supplement image when the light supplement lamp is in an on state, and shooting towards the article placement area to obtain a non-light supplement image when the light supplement lamp is in an off state; subtracting the light supplement image from the non-light supplement image to obtain a background-removed image; and outputting a trigger signal for controlling the identification of the object to be identified under the condition that the first overall brightness indication value of the background removing image is within a first predetermined range, wherein the first predetermined range can indicate that the object to be identified exists in the article placing area. According to the scheme, the anti-interference capability during triggering image recognition can be improved.

Description

Image identification triggering method and device
Technical Field
The invention relates to the technical field of image recognition, in particular to an image recognition triggering method and device.
Background
The certificate identification equipment can comprise a light supplement lamp, a certificate placing area, a camera and the like. After the certificate is placed in the certificate placement area, the light supplement is started, and the image of the certificate is shot clearly and displayed.
In the prior art, the certificate image can be obtained according to one or more pictures shot when the light supplement lamp is on, and when the certificate image meets a certain condition, the certificate image is triggered and identified.
The trigger mode is sensitive to the change of the external environment, and easily causes false triggering, so the anti-interference performance is poor. For example, when the shadow of an interfering object falls in the preset difference region, false triggering may be caused.
Disclosure of Invention
In view of this, the present invention provides an image recognition triggering method and device to improve the anti-interference capability when triggering image recognition.
In order to achieve the above object, the present invention adopts the following modes:
according to an aspect of an embodiment of the present invention, there is provided an image recognition triggering method, including: shooting towards an article placement area under the condition that a light supplement lamp is in an on state to obtain a light supplement image; shooting towards the object placing area under the condition that the light supplementing lamp is in an off state to obtain a non-light supplementing image; subtracting the light supplement image from the non-light supplement image to obtain a background-removed image; and outputting a trigger signal for controlling the identification of the object to be identified under the condition that the first overall brightness indication value of the background removing image is within a first predetermined range, wherein the first predetermined range can indicate that the object to be identified exists in the article placing area.
According to another aspect of the embodiments of the present invention, there is provided an image recognition triggering apparatus including: the shooting unit is used for shooting towards an article placing area to obtain a light supplementing image under the condition that the light supplementing lamp is in an on state, and shooting towards the article placing area to obtain a non-light supplementing image under the condition that the light supplementing lamp is in an off state; the background removing unit is used for subtracting the light supplementing image from the non-light supplementing image to obtain a background removing image; and the triggering unit is used for outputting a triggering signal for controlling and identifying the object to be identified under the condition that the first overall brightness indication value of the background removing image is within a first preset range, wherein the first preset range can indicate that the object to be identified exists in the article placement area.
According to still another aspect of an embodiment of the present invention, there is provided an image recognition apparatus including: the image recognition triggering device according to the above embodiment.
According to a further aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the above-described embodiments.
According to the image identification triggering method, the image identification triggering device, the image identification device and the computer readable storage medium, the light supplement image and the non-light supplement image are subtracted to obtain the background removing image, the triggering signal is output only when the background removing image meets the requirement, and the background removing image is subjected to subtraction processing, so that the obtained background removing image mainly reflects the shaking condition of the image to be identified and is not easily influenced by the external environment, the background removing image is used as the basic condition for triggering image identification, the influence of the external environment can be well resisted, and the false triggering of image identification is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a flowchart illustrating an image recognition triggering method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the configuration of a credential identification device in accordance with one embodiment of the invention;
FIG. 3 is a diagram illustrating an image captured by an image recognition triggering method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an image recognition triggering method according to an embodiment of the present invention;
FIG. 5 is a schematic view of an image taken when the light is turned off according to an embodiment of the present invention;
FIG. 6 is a schematic view of an image taken when the light is turned on according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating gray level subtraction of image pixels according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an image recognition triggering device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
Taking the certificate identification device as an example, in a conventional case, images are shot under the condition that the light supplement lamp is turned on, for example, images are shot when the light supplement lamp is turned on, and the certificate part is a certificate image. And if the external environment is unchanged, subtracting the two images shot when the light supplement lamp is turned on, and judging whether the subtraction result meets the set condition or not, so that certificate identification can be correctly triggered. However, if the external environment changes, the mode can result in that the certificate recognition cannot be correctly triggered. For example, when the external environment causes the document placing area to have a shadow, the document identification may be triggered by mistake when no document exists, and when the external environment has strong light, the document identification may not be triggered when the document exists.
In order to solve the above problems, the inventors have found through research that an image is captured when the light supplement lamp is turned on, the certificate part is a certificate image, the image is captured when the light supplement lamp is turned off, and the certificate part is completely dark and almost a background image. Based on the discovery, the invention provides an image identification triggering method which can be used for triggering and identifying electronic certificates and can resist certificate identification false triggering caused by external environment change. Of course, the invention can be used not only to trigger electronic document identification, but also to identify other images or objects.
Fig. 1 is a flowchart illustrating an image recognition triggering method according to an embodiment of the present invention. As shown in fig. 1, the image recognition triggering method of some embodiments may include:
step S110: shooting towards an article placement area to obtain a light supplement image when the light supplement lamp is in an on state, and shooting towards the article placement area to obtain a non-light supplement image when the light supplement lamp is in an off state;
step S120: subtracting the light supplement image from the non-light supplement image to obtain a background-removed image;
step S130: and outputting a trigger signal for controlling the identification of the object to be identified under the condition that the first overall brightness indication value of the background removing image is within a first predetermined range, wherein the first predetermined range can indicate that the object to be identified exists in the article placing area.
In the step S110, the light supplement lamp may be a white light lamp, an infrared lamp, or the like, and may illuminate the object placement area. The article placement area may be used to place an article, such as the article itself (e.g., paper documents, drawings), a displayed image of the article (e.g., displayed electronic documents, facial images), and so forth. The shooting can be performed by using a shooting device which can shoot the article placing area, so that when the article is placed in the article placing area, an image of the article can be shot for processing such as identification of the article.
The light supplement lamp can be manually switched on and off; alternatively, the fill light may be automatically turned on and off, and the time interval of the automatic turning on and off may be fixed. For example, the fill light is turned on and off at predetermined time intervals, wherein the predetermined time intervals may be the duration of the light-off state or the duration of the light-on state.
For example, the specific implementation of step S110 may include: the method comprises the steps that under the condition that a light supplement lamp is switched on and off at preset time intervals, shooting is conducted on the object placing area in the opening time period of the light supplement lamp, so that a light supplement image is obtained, and shooting is conducted on the object placing area in the closing time period of the light supplement lamp, so that a non-light supplement image is obtained. The predetermined time interval may be an on time period of the fill light or an off time period of the fill light. The on-time period of the fill light and the off-time period of the fill light may constitute one switching period, wherein the on-time period may refer to a light-on duration in one switching period, and the off-time period may refer to a light-off duration in one switching period. During specific implementation, the shooting time interval of the shooting equipment of the camera shooting equipment and the switching time interval of the light supplement lamp can be set to be consistent or approximate through programming, so that the light supplement image can be shot during the period that the light supplement lamp is turned on, and the non-light supplement image can be shot during the period that the light supplement lamp is turned off. In the embodiment, the light supplement image and the non-light supplement image are obtained by shooting under the condition that the light supplement lamp is switched on and off at preset time intervals, the images can be automatically and regularly shot, and the image shooting efficiency is high. Of course, the on-time period and the off-time period of the fill light may be the same or different, and the on-time period, the off-time period, or the cycle of the switch may be changed according to a certain rule. Illustratively, the non-fill-in image and the fill-in image used for obtaining the background-removed image are adjacent frame images. In this embodiment, the adjacent frame image may be obtained by obtaining the supplementary lighting image first and obtaining the non-supplementary lighting image next, so that the procedure is simple; or, the adjacent frame image may be obtained first from the non-fill-in image and then from the next frame from the fill-in image, so that the program running progress is faster.
The light supplement image in the invention is an image shot facing the article placement area when the light supplement lamp irradiates the article placement area; of course, the light supplement image may also be an image obtained by shooting the object placement area in a direction facing the object placement area when other light sources supplement light to the object placement area. The non-light supplement image in the invention is an image obtained by shooting an article placing area which is not irradiated by a light supplement lamp; of course, the non-supplementary light image may also be an image obtained by shooting the object placement area in a direction facing the object placement area when no other light source is used for supplementing light to the object placement area. In other words, the non-supplementary light image may be an image captured under the condition of natural light or external light source of the external environment; the light supplement image is an image shot under the irradiation of a light supplement lamp or other light sources capable of providing light compensation under the condition of natural light or external light sources of the external environment. The "facing" is not limited to the right opposite side, as long as an image of the article placement area can be captured, and further requirements can be determined according to whether the image can be used for subsequent image recognition. In general, the light supplement lamp can be continuously switched on and off, and a light supplement image and a non-light supplement image can be continuously shot at the same time, so that when an object (such as a certificate) is placed in the object placement area, the light supplement image comprises an image of the object, and the non-light supplement image also comprises an image of the object; when no article is placed in the article placement area, the light supplement image and the non-light supplement image do not contain the image of the article. Certainly, can place article to article and place regional back, open light filling lamp starting switch through the manual work for the light filling lamp is automatic according to setting for the time interval switch, perhaps manual switch light filling lamp.
In step S120, one or more fill-in images can be obtained when the same or different fill-in lamps are turned on, and one or more non-fill-in images can be obtained when the same or different fill-in lamps are turned off. Selecting a light supplement image and a non-light supplement image, subtracting the light supplement image and the non-light supplement image to obtain a background removing image, wherein the background removing image reflects the image required to be obtained, such as the image of the certificate placed in the article placing area.
In the case that the fill light is turned on or off at predetermined time intervals, in a further embodiment, the configuration may be such that: and the turn-on time period of the light supplement lamp corresponding to the light supplement image for obtaining the background removing image is adjacent to the turn-off time period of the light supplement lamp corresponding to the non-light supplement image for obtaining the background removing image. For example, the on-time period of the fill light is Δ t1, and the off-time period of the fill light is Δ t2, the on-off process of the fill light may sequentially include a first on-time period Δ t1, a first off-time period Δ t2, a second on-time period Δ t1, a second off-time period Δ t2, a third on-time period Δ t1, and a third off-time period Δ t2 … …, and images respectively captured during adjacent on-time periods and off-time periods may be respectively used as the fill light image and the non-fill light image, specifically, for example, one image is captured as the fill light image during the second on-time period Δ t1, and one image is captured as the non-fill light image during the second off-time period Δ t 2. Therefore, the subsequent background-removed image can be more accurate or consistent with the image to be shot.
The background-removed image may be obtained by subtracting parameter values that reflect differences in the image. Exemplary, the specific implementation of step S120 may include: and subtracting the first bright and dark indication value of the pixel point of one light supplement image from the first bright and dark indication value of the corresponding pixel point of one non-light supplement image to obtain a background removed image. The first light and dark indication value may be various parameter values capable of reflecting a difference between light and dark of images, for example, the first light and dark indication value may be a value of a gray scale value, a brightness value, or a color component, in other words, the type of the first light and dark indication value may be a gray scale value, a brightness value, or a color component. The color component may be one or more of red (R), green (G) and blue (B).
Specifically, a difference image obtained by subtracting a first bright and dark indication value of a corresponding pixel point of one non-fill light image from a first bright and dark indication value of a pixel point of one fill light image is used as the background-removed image; or obtaining the background-removed image according to an absolute value of a difference value between the first bright and dark indication value of the pixel point of one light supplement image and the first bright and dark indication value of the corresponding pixel point of one non-light supplement image.
Generally, the first bright-dark indication value of the light supplement image is larger, the first bright-dark indication value of the non-light supplement image is smaller, the first bright-dark indication value of each pixel point of the light supplement image subtracts the first bright-dark indication value of each pixel point of the non-light supplement image, each obtained difference value is not a negative number, a background removal image can be directly obtained according to the image of each difference value, and a background removal image can also be obtained according to the absolute value of each difference value; subtracting the first bright and dark indication value of each pixel point of the light supplement image from the first bright and dark indication value of each pixel point of the non-light supplement image to obtain each difference value which may be a negative number, taking the absolute value of the difference value, and obtaining the background removed image according to the absolute value of the difference value.
For example, assuming that the fill-in image and the non-fill-in image are both images of a 3 × 3 pixel array, the bright and dark indication values (e.g., pixel values) of each pixel of the fill-in image can be expressed as a matrix
Figure BDA0002350345110000061
The light and dark indication values (e.g., pixel values) of each pixel of the non-fill light image can be expressed as a matrix
Figure BDA0002350345110000062
The result of the subtraction (e.g., pixel values) of the fill-in image and the non-fill-in image can be represented as a matrix
Figure BDA0002350345110000063
A background-removed image can be obtained from the matrix of the subtraction results. If the light and dark indication values (e.g. pixel values) of each pixel of another fill-in image are expressed as a matrix
Figure BDA0002350345110000064
The result (e.g., pixel value) of the subtraction between the supplemental image and the non-supplemental image can be expressed as a matrix
Figure BDA0002350345110000065
The background-removed image may be a result of subtracting the fill-in image and the non-fill-in image, or may be a result of performing a certain process on a result of subtracting the fill-in image and the non-fill-in image, for example, taking an absolute value for each element in the subtraction result. The type of the light and dark indication value of the fill-in image and the type of the light and dark indication value of the non-fill-in image are generally the same, and the type of the light and dark indication value used for indicating the background removing image can be determined according to the types of the light and dark indication values of the fill-in image and the non-fill-in image. More specifically, the type of the light and dark indication value used to represent the background-removed image may be the same as the types of the light and dark indication values of the fill-in image and the non-fill-in image, or may be a value estimated from the values of the types of the light and dark indication values of the fill-in image and the non-fill-in image. Specifically, when the types of the light and dark indication values of the fill-in image and the non-fill-in image are both gray scales, the type of the light and dark indication value of the background-removed image may be gray scale or brightness, wherein the gray scale value of the background-removed image may be converted into a brightness value, and the brightness value may be converted into a value of a color component from the gray scale valueIn the case of (2), the type of the light and dark indication value of the background-removed image may be a color component.
The above-illustrated specific implementation of the step S120 is to obtain the background-removed image by subtracting the first bright-dark indication value of the pixel point of one of the supplementary lighting images from the first bright-dark indication value of the corresponding pixel point of one of the non-supplementary lighting images, and more specifically, the step S may include: and subtracting the first bright and dark indication value of the pixel point of one light supplement image from the first bright and dark indication value of the corresponding pixel point of one non-light supplement image to obtain a difference value, and obtaining the background removing image according to the absolute value of the difference value. Since the article placement area is not changed when the light supplement image and the non-light supplement image are obtained by shooting, the corresponding pixel point of the non-light supplement image can refer to the pixel point at the position corresponding to the position of the pixel point of the light supplement image, for example, if the position of the pixel point of the light supplement image is the pixel point at the position of the row a and the column b (a and b are positive integers greater than or equal to 1) in the light supplement image, the corresponding pixel point of the non-light supplement image can refer to the pixel point at the position of the row a and the column b in the non-light supplement image. For example, in the case of a 3 × 3 pixel array image for both the fill-in image and the non-fill-in image, the bright and dark indication values (e.g., gray values) of the background-removed image can be expressed as a matrix
Figure BDA0002350345110000071
The other background-removed image, i.e. its light and dark indication values (e.g. grey values), can be represented as a matrix
Figure BDA0002350345110000072
By representing in absolute value form, the subsequent calculation process can be simplified, so that the result of calculating the overall light and dark indication value can reflect the actual situation better.
In step S130, the first total brightness indication value may be a total gray scale, a total brightness, or a total color component of all pixel points of one background-removed image. A first overall light and dark indication value of the background-removed image within a first predetermined range may indicate the presence of an item, such as a document to be identified, in the item-placement area.
For example, before step S130, the method of each embodiment further includes: the step of determining whether the overall brightness indication value of the background-removed image is in a first predetermined range may include: and judging whether a first overall brightness indication value of the background-removed image is within the first preset range or not so as to judge whether the object to be identified exists in the article placement area or not. The type of the first overall light and dark indication value may be a grayscale, a brightness or a color component, and the type of the first overall light and dark indication value may be determined according to the type of the first light and dark indication value, for example, the type of the first overall light and dark indication value is the same as the type of the first light and dark indication value, or may be converted from the type of the first light and dark indication value. In specific implementation, the judging steps can be automatically realized through a programming program, so that whether the background image meets the requirement or not is automatically judged, whether an article is placed in an article placing area or not can be determined without people, and the triggering efficiency of image identification can be improved.
A specific embodiment of the foregoing step of determining whether the overall brightness indication value of the background-removed image is within a first predetermined range, that is, whether the first overall brightness indication value of the background-removed image is within the first predetermined range, to determine whether the object to be identified exists in the article placement area, may include: judging whether a first overall brightness indication value of the background-removed image is larger than a lower threshold value of the first preset range or not so as to judge whether an object to be identified exists in the article placement area or not; wherein the type of the first overall brightness indication value is a grayscale or a color component. When the type of the first overall light and dark indication value is gray scale or color component, if the first overall light and dark indication value is larger, the image of the background image containing the article placed in the article placement area can be indicated, and in this case, only whether the lower limit condition of the first predetermined range is met can be judged, so that the judgment time can be saved.
The first overall brightness indication value may indicate a parameter value capable of reflecting an overall condition of the entire image, and the parameter value may reflect a difference between different images. The type of the first overall brightness indication value may be a gray scale, a brightness, or a color component, and the color component may be one or more of three colors of red (R), green (G), and blue (B). The "total" may refer to a sum, a mean, or the like, for example, the first total light and dark indication value may be a total gray value, a total brightness value, or a total color component value of an image, more specifically, the total gray value may refer to a sum of gray values at all pixel points of an image, the total brightness value may refer to a sum of brightness values at all pixel points of an image, and the total color component value may refer to a sum of color values of one or more channels at all pixel points of an image.
The first predetermined range may be determined according to a type of the first overall light and dark indication value, for example, when the first overall light and dark indication value is a total gray value, a lower limit of the first predetermined range may be a lower gray threshold, and the background-removed image may be used to obtain the background image as long as the total gray value of the background-removed image is greater than the lower gray threshold. For another example, when the first overall brightness indication value is a total brightness value, the lower limit of the first predetermined range may be an upper brightness threshold, and the background-removed image may be used to obtain the background image as long as the total brightness value of the background-removed image is greater than the upper brightness threshold.
The object to be identified in the article placement area can be confirmed by indicating the value of the brightness value of the background image in a certain range, for example, by indicating the value of the gray value of the background image in a predetermined range.
In the embodiments, the light supplement image and the non-light supplement image are subtracted to obtain the background removing image, the trigger signal is output only when the background removing image meets the requirement, and the background removing image is subjected to subtraction processing, so that the obtained background removing image mainly reflects the self condition of the image to be recognized, the influence of light environment change is eliminated, the trigger action is not easily influenced by the external environment, the influence of the external environment can be better resisted, and the false triggering of image recognition is reduced.
In other embodiments, after step S120, that is, after the step of subtracting one of the fill-in light images from one of the non-fill-in light images to obtain a background-removed image, the image recognition triggering method shown in fig. 1 may further include the steps of: s140, acquiring at least one background image; the background image is obtained by subtracting the two background-removed images. In this case, the step S130 of outputting the trigger signal for controlling the recognition of the object to be recognized in the case where the first overall light and dark indication value of the background removed image is within the first predetermined range may more specifically include: s131, outputting a trigger signal for controlling and identifying the object to be identified under the condition that the first overall light and dark indication value of the background removing image is in a first preset range and the second overall light and dark indication value of at least one background image is in a second preset range, wherein the second preset range can indicate that the object to be identified is stably located in the article placing area.
In other words, in this embodiment, the trigger signal is output when the first overall light and dark indication value of the background image is within the first predetermined range and the second overall light and dark indication value of the background image is within the second predetermined range. The condition in which the second overall brightness indication value of the background image is within the second predetermined range may be equivalent to a debounce operation.
Before the step S131 is executed, before, after, or simultaneously with the determining whether the first overall brightness indication value of the background-removed image is within the first predetermined range, at least one background image may be obtained. For example, when it is determined whether the first overall lightness-darkness indication value of the background-removed image is within the first predetermined range, the above step S140 is executed in parallel, that is, the background image is obtained by subtracting the two background-removed images. Alternatively, for example, before determining whether the first overall brightness indication value of the background-removed image is within the first predetermined range, the above step S140 is performed, that is, the background image is obtained by subtracting the two background-removed images. Further alternatively, for example, after determining whether the first overall brightness indication value of the background-removed image is within a first predetermined range, the above step S140 is performed, that is, the background image is obtained by subtracting the two background-removed images.
In an implementation scenario, the second overall brightness indication value of at least one of the background images is within a second predetermined range, which may specifically include: the second overall light and dark indication values of both of the background images are within a second predetermined range.
In one implementation scenario, the two background images for determining that the second overall light and dark indication value is within the second predetermined range are two consecutive images.
In the step S140, the light supplement image and the non-light supplement image for obtaining the background removal image may be obtained by shooting at a certain time interval, and the two background removal images for obtaining the background image may have a certain relationship in the obtaining time. For example, the on-time period of the fill-in light corresponding to the fill-in light image for obtaining the background-removed image and the off-time period of the fill-in light corresponding to the non-fill-in light for obtaining the background-removed image are adjacent to each other, and the predetermined time interval corresponding to the two background-removed images is adjacent to each other. More specifically, for example, the non-fill-in image and the fill-in image used for obtaining the background-removed image may be adjacent frame images, and the two background-removed images used for obtaining the background image may be adjacent frame images.
For example, the first frame image is a first fill-in light image, the second frame image is a first non-fill-in light image, the third frame image is a second fill-in light image, the fourth frame image is a second non-fill-in light image, the fifth frame image is a third fill-in light image, the sixth frame image is a third non-fill-in light image, the seventh frame image is a fourth fill-in light image, and the eighth frame image is a fourth non-fill-in light image, the first fill-in light image and the first non-fill-in light image are subtracted from each other to obtain a first background-removed image, the second fill-in light image and the second non-fill-in light image are subtracted from each other to obtain a second fill-out background image, the third fill-in light image and the third non-in light image are subtracted from each other to obtain a third background-removed image, the fourth background-removed image is obtained by subtracting the fourth non-fill-in light image from each other to obtain a fourth background-removed image, the second background-removed image is obtained by removing the first fill-in light image and the second background-, and subtracting the third background-removed image and the fourth background-removed image to obtain a second background image, wherein the first background-removed image and the second background-removed image are adjacent frame images, the second background-removed image and the third background-removed image are adjacent frame images, the third background-removed image and the fourth background-removed image are adjacent frame images, and the first background image and the second background image are adjacent frame images.
In step S140, a background image can be obtained by subtracting the parameter values that can reflect the image difference, and the background image can reflect the shaking of the background image (such as the image of the certificate in the article placement area). Illustratively, the step S140 of subtracting the two background-removed images to obtain the background image may include: and obtaining a background image according to the absolute value of the difference value of the second bright and dark indication values of the corresponding pixel points of the two background-removed images. The type of the second light and dark indication value may be a gray scale, a brightness or a color component, and the color component may be one or more of three colors of red (R), green (G) and blue (B). The type of the second light and dark indication value may be determined according to the type of the first light and dark indication value described above. Specifically, it may mean that the type of the second light and dark indication value may be the same as the type of the first light and dark indication value, or the type of the second light and dark indication value may be obtained by converting the type of the first light and dark indication value, for example, if the first light and dark indication value is a gray value, the second light and dark indication value may be a gray value (in the case of being the same) or a brightness value (in the case of being converted), wherein the brightness value may be obtained by converting the gray value. In some embodiments, the type of the first light and dark indication value and the type of the second light and dark indication value may both be gray scale, and the first overall light and dark indication value may be a total gray scale value, so that calculation may be facilitated, and the light and dark conditions of the image may be visually reflected.
The above exemplary embodiment of step S140, namely, subtracting the second bright and dark indication values of the corresponding pixel points of the two background images to obtain the background image, and more specifically, the method may include: subtracting the second bright and dark indication values of the corresponding pixel points of the two background-removed images, and subtracting the difference valueThe absolute value of (d) yields a background image. For example, the second light and dark indication value (which may be in absolute value form) of each pixel of a background-removed image can be represented by a matrix
Figure BDA0002350345110000111
The second light and dark indication value (which may be in the form of absolute value) of each pixel point of another background-removed image can be expressed as a matrix
Figure BDA0002350345110000112
Then, the light and dark indication values of each pixel point of the background image can be expressed as a matrix
Figure BDA0002350345110000113
Or the light and dark indication values of each pixel point of the background image can be expressed in the form of absolute values
Figure BDA0002350345110000114
By representing in absolute value form, the calculation process can be simplified, so that the result of calculating the overall light and dark indication value can reflect the actual situation better.
In the case where the fill light is turned on and off at predetermined time intervals, in some embodiments, the configuration may be such that: the predetermined time intervals corresponding to the two background removing images are adjacent, in other words, the shooting time periods of two pairs of images (each pair of images includes a fill-in image and a non-fill-in image) based on which the two background removing images are obtained are adjacent. For example, a fill-in image is captured during a first on-time period Δ t1, a non-fill-in image is captured during a first off-time period Δ t2, a background-removed image can be obtained according to the fill-in image and the non-fill-in image obtained during the first fill-in lamp on-off period, an image is captured during a period immediately adjacent to the fill-in lamp on-off period (a second fill-in lamp on-off period), that is, another fill-in image is captured during a second on-time period Δ t1, another non-fill-in image is captured during a second off-time period Δ t2, another background-removed image can be obtained according to the fill-in image and the non-fill-in image obtained during the second fill-in lamp on-off period, and the predetermined time interval corresponding to the two background-removed images thus obtained is adjacent. Therefore, the background image can be more accurate, namely the shaking condition of the image of the article or the article placement area can be more reflected.
In the above step S131, the type of the second overall light and dark indication value may be a gray scale, a brightness, or a color component. The type of the second overall light and dark indication value may be determined according to the type of the second light and dark indication value, and specifically: the type of the second overall light and dark indication value is the same as the type of the second light and dark indication value, for example, both are gray; alternatively, the second overall light and dark indication value and the second light and dark indication value may be scaled with each other, for example, the type of the second light and dark indication value is a gray scale, and the type of the second overall light and dark indication value may be a brightness. The second overall light and dark indication value is different from the second light and dark indication value mainly in that the second light and dark indication value can be used for reflecting a parameter value at a certain pixel point, and the second overall light and dark indication value can reflect the overall parameter value condition of an image, and can be a sum value, an average value and the like.
The second predetermined range can reflect the shake of the image itself that can be used for image recognition, and the specific range can be set as needed. After step S140 and before step S131, the method of various embodiments may further include: judging whether a second overall brightness indication value of the background image is within a second preset range; the type of the second overall light and dark indication value can be a gray scale, a brightness or a color component, and the type of the second overall light and dark indication value can be determined according to the type of the second light and dark indication value. The trigger signal is output only in a case where it is judged that the second overall lightness-darkness indication value of the background image is within the second predetermined range. The second predetermined range may be set appropriately so that when the second overall lightness-darkness indication value of the background image is within the second predetermined range, the shake of the background-removed image can be considered to be within the allowable range, and the trigger signal is output only at this time, whereby it can be ensured that the image used for recognizing the image is more convenient for obtaining a more accurate recognition result.
In the embodiments, the light supplement image and the non-light supplement image are subtracted to obtain the background removing image, the two background removing images meeting the requirement are used to obtain the background image, the trigger signal is output only when the background removing image meets the requirement, and the obtained background image mainly reflects the shaking condition of the image to be recognized and is not easily influenced by the external environment due to the fact that the subtraction processing is carried out on the background removing image, so that the background image is used as the basic condition for triggering image recognition, the influence of the external environment can be well resisted, and false triggering of the image recognition is reduced.
The background-removed image for image recognition may be obtained by a method similar to the above steps S110 and S120, and one background-removed image may be selected from the latest background-removed images, for example, the method of each embodiment may further include the steps of: and S150, outputting the latest background-removed image for identifying the object to be identified. The background removed image output in step S150 may be the latest background removed image that has been obtained after the above steps S110 and S120 are performed or before the trigger signal is output. Or, when the second overall brightness indication value of the background image is determined to be within the second preset range, a background removing image is obtained again, the background removing image is determined to meet the condition, and the obtained background removing image is used for image recognition.
Illustratively, before outputting the trigger signal for controlling the recognition of the object to be recognized, the method of the embodiments may further include the steps of:
s141: re-acquiring a background-removed image as a first background-removed image; in the case that a third overall brightness indication value of the first background-removed image is within a third predetermined range, outputting the first background-removed image for identifying an object to be identified, wherein the third predetermined range can indicate that the object to be identified exists in the article placement area; or, a supplementary light image is acquired again to be a first supplementary light image, and the first supplementary light image is output and used for identifying the object to be identified.
The third overall bright-dark indication value and the first overall bright-dark indication value may be of different types, for example, the first overall bright-dark indication value is a gray scale, the third overall bright-dark indication value is a luminance, at this time, it is determined that the third overall bright-dark indication value of the first background-removed image is within a third predetermined range, and then a trigger signal is output, so that a luminance detection function can be conveniently performed, and it is ensured that the luminance is within a normal range, thereby further improving the external interference resistance. In the case where the third overall brightness indication value is a gray scale, the specific range value of the third predetermined range may be modified accordingly in the case of brightness detection.
In addition, in the case where the third overall light and dark indication value is the same type as the first overall light and dark indication value, the third predetermined range may be the same as or similar to the first predetermined range, for example, the third overall light and dark indication value and the first overall light and dark indication value may both be in grayscale, and if the third predetermined range is similar to the first predetermined range, the image that can be used for confirming the image recognition is a desired image, that is, an image including or being an article placed on the article placement area. In addition, when the trigger signal needs to be output, the background removing image meeting the requirements is obtained again and can be used for image recognition, and therefore the background removing image can be guaranteed to be the required image.
In other embodiments, the latest fill-in image may be selected from the already obtained fill-in images for image recognition, or an image may be re-captured for image recognition before the trigger signal is output. For example, in a case where the second overall lightness-darkness indication value of the background image is within a second predetermined range, the method of each embodiment may further include the steps of: and S160, when the light supplement lamp is in an on state, shooting towards the object placing area again to obtain a third light supplement image, and outputting the third light supplement image for identifying the object to be identified.
In some embodiments, the image recognition triggering method of each embodiment may further include a step of determining whether an article in the article placement area is removed, and specifically, after outputting a trigger signal for controlling recognition of the object to be recognized, the method may further include a step of:
s170: re-acquiring a background-removed image as a second background-removed image;
s180: determining whether the object to be identified of the item placement area is moved away from the item placement area by determining whether a fourth overall light-dark indication value of the second background removed image is within a fourth predetermined range;
s190: when the object to be recognized is moved away from the object placement area, the step S110 may be executed again, that is, when the light supplement lamp is in an on state, the object is shot facing the object placement area to obtain a light supplement image, and when the light supplement lamp is in an off state, the object is shot facing the object placement area to obtain a non-light supplement image; wherein the fourth predetermined range can indicate that the object to be identified is not present in the article placement area.
Step S170 may be implemented with reference to the specific implementation of step S120. Step S180 may be implemented with reference to the specific implementation of step S130. The fourth predetermined range may reflect that the object to be identified is not present in the article placement area, and may be similar according to a range outside the first predetermined range, for example, the fourth predetermined range is the same as the range outside the first predetermined range, or is within the range outside the first predetermined range. When it is determined that the object or the article to be identified has been moved away from the article placement area, the operation may be performed from step S110 again, and the operation may be performed to process the object or the article to be identified, which is placed in the article placement area next time, so as to output a corresponding trigger signal.
In this embodiment, by determining whether the object or the article to be identified has been moved away from the article placement area, and re-executing the step S110 after the object or the article has been moved away from the article placement area, the whole image identification triggering control process can be automatically and cyclically executed, so that the artificial determination or operation is reduced, and the efficiency of triggering control or image identification can be improved.
It should be noted that the light and dark indication values mentioned in the embodiments may reflect the light and dark conditions of the pixel points, for example, the first light and dark indication value, the second light and dark indication value, and the like. The mentioned overall light and dark indication value of the embodiments may reflect the overall light and dark condition of the image, e.g. a first overall light and dark indication value, a second overall light and dark indication value, a third overall light and dark indication value, a fourth overall light and dark indication value, etc. The first overall light and dark indication value, the second overall light and dark indication value and the fourth overall light and dark indication value can be used for judging whether an object or an article to be identified exists in the article placement area, the corresponding ranges outside the first preset range, the third preset range and the fourth preset range can be the same or different, and the judgment can be specifically determined according to the functions of the objects and the types of data needing to be judged. The second overall light and dark indication value may reflect a dithering condition of the background-removed image. The parameter types of the above-mentioned each light and dark indication value and each overall light and dark indication value may be both gray scales, or both brightness, or both color components, and more specifically, may be both red color, green color, or blue color, for example. The parameter types of the light and dark indication values and the overall light and dark indication values can be different, and the values of different types can be converted with each other. Each bright and dark indication value can be an absolute value, and each overall bright and dark indication value can be the sum, the average value and the like of the bright and dark indication values of each pixel point of an image.
For example, the type of the first light and dark indication value may be a grayscale, a brightness, or a color component; the type of the second light and dark indication value may be a gray scale, a brightness or a color component; the type of the first overall light and dark indication value may be a grayscale, a brightness or a color component; the type of the second overall light and dark indication value may be a gray scale, a brightness or a color component; the first overall brightness and darkness indication value can be the average value or the sum of the brightness and darkness indication values of all pixel points of the background-removed image; the second overall brightness indication value may be an average value or a sum of brightness indication values of each pixel of the background image.
In order that those skilled in the art will better understand the present invention, embodiments of the present invention will be described below with reference to specific examples.
FIG. 2 is a schematic diagram of a credential identification device in accordance with an embodiment of the invention. Referring to fig. 2, the certificate recognition apparatus (image recognition device) may include a fill light 201, a camera 202, a certificate placement area 203 (article placement area), and the like. The fill light 201 can be a white light or an infrared light, the camera 202 can be a video camera, a still camera, etc., and the document placement area 203 can be provided by a transparent substrate (e.g., a glass plate). Light filling lamp 201 can shine the certificate and place district 203, and camera 202 can shoot the certificate and place district 203, and camera 202 and light filling lamp 201 can be located the certificate and place one side of district 203, and certificate 204 is located the certificate and places the opposite side of district 203, and the certificate is placed district 203 top and can be set up shading cover (not shown), also can not set up shading cover, specifically can set up according to actual conditions. Fig. 2 merely illustrates a device or apparatus on which the method of an embodiment of the present invention may be based, and in other embodiments, the fill light 201, the camera 202, and the credential 204 may all be located on the same side of the credential placement region 203.
It should be noted that, although the identification device and the subsequent identification method are described only by taking the certificate as an example, in the specific implementation, the object to be identified may be other various objects, and different objects or object images, such as human faces, plants, animals, characters, etc., may be identified by using different image recognition algorithms.
Based on the certificate recognition device shown in fig. 2, referring to fig. 3 and 4, a certificate recognition triggering method, also referred to as an image recognition triggering method, of a specific embodiment may include the following steps S301 to S312.
S301: under the condition that the light supplement lamp is switched on and off according to the preset time interval, a first image (a light supplement image or a non-light supplement image) of the certificate placement area is obtained through the camera according to the preset time interval.
The acquired first image may be an image in any format or color mode, and the present invention does not limit the image. In one switching period of the fill-in light, two frames of images before and after can be acquired, one frame is an image (fill-in light image) shot when the light is turned on, and the other frame is an image (non-fill-in light image) shot when the light is turned off.
Referring to fig. 2 again, assuming that the external environment is unchanged and no certificate is placed in the certificate placement area: the images taken when the light is turned off and turned on are the same, as shown in fig. 5; when the certificate is placed in the certificate placing area: the image taken when the light is off is different from the image taken when the light is on, as shown in fig. 5 and 6, the difference between the images taken when the light is off and on is in the certificate part, the certificate part is black or dark when the light is off, and the certificate part is the certificate image when the light is on.
S302: and subtracting the first image obtained currently from the first image of the previous frame to obtain a background-removed image.
The process of obtaining the background-removed image from the fill-in image and the non-fill-in image may be referred to as background removal. The method for obtaining the first background-removed image can comprise the following steps: subtracting the gray value of each pixel point corresponding to the first image of the previous frame and the next frame to obtain the absolute value (hereinafter referred to as a first absolute value) of the gray value difference of each pixel point, wherein each first absolute value is the gray value of each pixel point of the background removed image. For example, referring to fig. 7, which includes A, B and C, a is an image captured when the light is turned off, B is an image captured when the light is turned on, and a and B are the first images of the preceding and following frames. X1-X9 are gray values of each pixel point of the image A, X1 '-X9' are gray values of each pixel point of the image B, gray values of pixel points at the same position are subtracted (the gray value of the pixel point of the image A is subtracted by the gray value of the pixel point of the image B, and the gray value of the pixel point of the image B is subtracted by the gray value of the pixel point of the image A), and corresponding first absolute values | X1-X1'|, | X2-X2' | and the like are obtained, wherein each first absolute value is a gray value of one pixel point of the image C. In other embodiments, the absolute value of the gray-scale difference may not be obtained, for example, if the non-fill-light image is subtracted from the fill-light image, and the gray-scale difference is positive, the absolute value does not need to be obtained, and if there is a negative value, a negative value may be retained or normalization processing may be performed according to a gray-scale value range.
S303: and judging whether the total gray value of the currently acquired background-removed image is greater than a first preset threshold value.
If the determination result is "greater than" the subsequent step S304 may be executed to continue obtaining more background-removed images, otherwise, the step S301 may be executed to re-shoot the supplementary light image and the non-supplementary light image.
The step S303 is a specific implementation step of determining whether the first overall bright-dark indication value of the background-removed image is within a first predetermined range, and when the first overall bright-dark indication value is the total gray value, the first preset threshold is a lower threshold of the first predetermined range.
S304: subtracting every two adjacent frames of images (light filling images and non-light filling images) in the multi-frame first image acquired after the step S303 to obtain at least two background removing images.
S305: subtracting each two adjacent background-removed images of the background-removed image obtained in step S302 and the at least two background-removed images obtained in step S304 to obtain at least two background images, and obtaining a second total gray value (a second total bright and dark indication value) of each background image.
S306: it is determined whether the obtained at least two second total gradation values (second total light-dark indication values) are both within a preset range (second predetermined range).
If the determination result is yes, the following step S307 may be executed, and a background-removed image is obtained for certificate recognition, otherwise, the above step S301 may be executed, and the supplementary light image and the non-supplementary light image are re-photographed.
S307: subtracting the latest first image (fill-in image/non-fill-in image) acquired after step S306 from the previous first image (non-fill-in image/fill-in image) to obtain a background-removed image.
S308: and judging whether the total gray scale of the background-removed image acquired in the step S307 is greater than a second preset threshold.
If the determination result is "greater than", the following S309 may be performed; otherwise, the above S301 may be executed, and the capturing of the supplementary light image and the non-supplementary light image may be executed again.
Here, this step S308 is a specific implementation manner of the foregoing embodiment to determine whether the third overall brightness indication value of the background-removed image is within a third predetermined range. When the third overall brightness indication value is the overall gray scale, the second preset threshold is the lower threshold of the third predetermined range. The step judges the acquired background-removed image again, and can ensure that the latest state of the certificate placing area is the state where the certificate is placed.
S309: and outputting a trigger signal.
The trigger signal is used to inform the certificate identification device that a certificate is placed, and the certificate identification device can perform certificate identification (image identification) according to a preset identification mode, where the certificate image used in identification may be an image obtained by re-shooting, or may be identified by the background-removed image obtained in step S307, or may also be re-shot, and then the background-removed image is obtained by subtracting the first images of the previous and subsequent frames obtained by re-shooting, and is used as the image for identification.
It should be noted that, after step S309 is executed, the background-removed image obtained in step S307 is directly used for certificate identification, and no shooting operation is performed, then the subsequent step S310 can be directly executed, and the light supplement lamp can continuously flash; if the image needs to be shot after the step S309 is executed, the subsequent step S310 may be executed after the image is shot, and the light supplement lamp may or may not flicker during the image shooting process, which may be set according to actual requirements.
S310: and acquiring a second image (a light supplement image or a non-light supplement image) of the certificate placement area according to a preset time interval.
S311: and subtracting the second image obtained currently from the second image of the previous frame (one frame is a light supplement image or the other frame is a non-light supplement image) to obtain a background removing image.
S312: and judging whether the total gray scale of the currently acquired background-removed image is smaller than a third preset threshold value.
If the judgment result is 'less than', the certificate is judged to be moved out, then S301 is executed again, and the actions of shooting the light supplement image and the non-light supplement image are executed again; otherwise, the certificate is judged not to be moved out, S311 can be repeatedly executed, and whether the certificate is moved out is judged again.
Switching a light supplement lamp of the certificate identification equipment according to a preset time interval, acquiring an image of a certificate placement area through a camera according to the same preset time interval, subtracting the acquired images under the conditions of switching on and switching off the lamp to obtain a background removing image, executing a shaking removing operation (steps S305-S306) if the total gray value of the background removing image is within a preset range, then acquiring the next background removing image, judging whether the total gray value of the background removing image is greater than a preset threshold value, if so, outputting a trigger signal, and then detecting whether the certificate is moved out; otherwise, repeatedly taking pictures according to the preset time interval. The gray scale mentioned in this embodiment may be luminance or may be a color component.
The method of this embodiment has the following advantageous effects:
(1) the background removing operation is carried out on the image corresponding to the whole certificate placing area, the obtained image is the image with the environmental factors removed, whether triggering is carried out or not is judged according to the image, the accuracy rate is high, and the false triggering rate is reduced.
If the gray value difference of the preset areas of the front and rear frame images is larger than the preset threshold value, triggering is carried out, the influence of environmental factors is not considered, and the false triggering rate is high.
(2) And (4) debouncing operation (judging whether the gray values of at least two background images are in a preset range) is performed, so that the false triggering probability is reduced, and the anti-interference performance is improved. In addition, the brightness detection operation (after the debounce operation, whether the total gray level of the current background image is larger than a third preset threshold value or not) further improves the anti-interference performance.
(3) In the prior art, when judging that there is the certificate to put into, automatic trigger certificate identification equipment shoots, discerns again, and this scheme compares with prior art, can directly use to remove the background image and discern, reduces operating procedure, saves time, raises the efficiency. In addition, the background-removed image is an image with interference filtered out, so that the identification accuracy can be improved.
In short, the embodiment can perform the operations of debouncing, brightness detection, taking the image without the background as the image to be identified after receiving the trigger signal, carrying out certificate identification, certificate removal detection and the like.
Based on the same inventive concept as the image recognition triggering method shown in fig. 1, the embodiment of the present application further provides an image recognition triggering device, as described in the following embodiments. Because the principle of solving the problems of the image recognition triggering device is similar to that of the image recognition triggering method, the implementation of the image recognition triggering device can refer to the implementation of the image recognition triggering method, and repeated parts are not described again.
Fig. 8 is a schematic structural diagram of an image recognition triggering device according to an embodiment of the present invention. As shown in fig. 8, the image recognition triggering device of some embodiments may include:
the shooting unit 410 is configured to shoot towards an article placement area to obtain a light supplement image when the light supplement lamp is in an on state, and shoot towards the article placement area to obtain a non-light supplement image when the light supplement lamp is in an off state;
a background removing unit 420, configured to subtract one of the fill-in light images from one of the non-fill-in light images to obtain a background-removed image;
a triggering unit 430, configured to output a triggering signal for controlling recognition of an object to be recognized if the first overall brightness indication value of the background-removed image is within a first predetermined range, where the first predetermined range can indicate that the object to be recognized exists in the article placement area.
In some embodiments, the capturing unit 410 is specifically configured to:
the method comprises the steps that under the condition that a light supplement lamp is switched on and off at preset time intervals, shooting is conducted on the object placing area in the opening time period of the light supplement lamp, so that a light supplement image is obtained, and shooting is conducted on the object placing area in the closing time period of the light supplement lamp, so that a non-light supplement image is obtained.
In some embodiments, the fill-in image and the non-fill-in image used for obtaining the background-removed image are adjacent frame images.
In some embodiments, the background removing unit 420 is specifically configured to:
subtracting a difference value of first bright and dark indication values of corresponding pixel points of one non-light supplement image from a first bright and dark indication value of a pixel point of one light supplement image to obtain the background removed image; or
And obtaining the background-removed image according to the absolute value of the difference value between the first bright and dark indication value of the pixel point of one light supplement image and the first bright and dark indication value of the corresponding pixel point of one non-light supplement image.
In some embodiments, after obtaining a background-removed image by subtracting one of the fill-in light images from one of the non-fill-in light images, the apparatus further includes:
the background unit is used for acquiring at least one background image; the background image is obtained by subtracting the two background removing images;
the triggering unit 430 is specifically configured to:
and under the condition that the first overall light and dark indication value of the background removing image is within a first preset range and the second overall light and dark indication value of at least one background image is within a second preset range, outputting a trigger signal for controlling the identification of the object to be identified, wherein the second preset range can indicate that the object to be identified is stably positioned in the article placing area.
In some embodiments, the background unit is specifically configured to: and obtaining at least one background image before, after or simultaneously with judging whether the first overall brightness indication value of the background-removed image is within a first preset range.
In some embodiments, the second overall brightness indication value of at least one of the background images is within a second predetermined range, which specifically includes:
the second overall light and dark indication values of both of the background images are within a second predetermined range.
In some embodiments, the two background images for determining that the second overall lightness-darkness indication value is within the second predetermined range are two consecutive images.
In some embodiments, the background unit is specifically configured to:
and obtaining a background image according to the absolute value of the difference value of the second bright and dark indication values of the corresponding pixel points of the two background-removed images.
In some embodiments, the two background-removed images used to obtain the background image are adjacent images.
In some embodiments, prior to outputting the trigger signal for controlling identification of the object to be identified:
the background removing unit 420 is further configured to obtain a background removing image as a first background removing image;
an output unit, configured to output the first background-removed image for identifying an object to be identified if a third overall brightness indication value of the first background-removed image is within a third predetermined range, where the third predetermined range can indicate that the object to be identified exists in the article placement area;
alternatively, the first and second electrodes may be,
the shooting unit 410 is further configured to reacquire a fill-in image as a first fill-in image;
and the output unit is used for outputting the first supplementary lighting image and identifying the object to be identified.
In some embodiments, after outputting the trigger signal for controlling the identification of the object to be identified:
the background removing unit 420 is further configured to obtain a background removing image as a second background removing image;
a shifting-out unit, configured to determine whether the object to be identified in the article placement area is shifted out of the article placement area by determining whether a fourth overall brightness indication value of the second background-removed image is within a fourth predetermined range;
the shooting unit 410 is further configured to, when the object to be identified is moved away from the article placement area, re-perform shooting towards the article placement area to obtain a light supplement image when the light supplement lamp is in an on state, and shoot towards the article placement area to obtain a non-light supplement image when the light supplement lamp is in an off state; wherein the fourth predetermined range can indicate that the object to be identified is not present in the article placement area.
The embodiment of the invention also provides an image recognition device which comprises the image recognition triggering device. The image recognition triggering device can be realized on the basis of a chip or an electronic device. The image recognition device can further comprise a light supplementing lamp, camera equipment, a component for forming an article placing area and the like, and can be used for photographing articles placed in the article placing area, judging according to the photographed images to output trigger signals and triggering the action of image recognition according to the trigger signals.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method described in the above embodiments.
In summary, in the image recognition triggering method, the image recognition triggering device, the image recognition device, and the computer-readable storage medium according to the embodiments of the present invention, the light-supplemented image and the non-light-supplemented image are subtracted to obtain the background-removed image, and the trigger signal is output only when the background-removed image meets the requirement.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the various embodiments is provided to schematically illustrate the practice of the invention, and the sequence of steps is not limited and can be suitably adjusted as desired.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, 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, 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.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, 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.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. An image recognition triggering method, comprising:
shooting towards an article placement area under the condition that a light supplement lamp is in an on state to obtain a light supplement image; shooting towards the object placing area under the condition that the light supplementing lamp is in an off state to obtain a non-light supplementing image;
subtracting the light supplement image from the non-light supplement image to obtain a background-removed image;
and outputting a trigger signal for controlling the identification of the object to be identified under the condition that the first overall brightness indication value of the background removing image is within a first predetermined range, wherein the first predetermined range can indicate that the object to be identified exists in the article placing area.
2. The image recognition triggering method as claimed in claim 1, wherein when the fill-in light lamp is in an on state, shooting is performed facing an object placement area to obtain a fill-in light image, and when the fill-in light lamp is in an off state, shooting is performed facing the object placement area to obtain a non-fill-in light image, including:
the method comprises the steps that under the condition that a light supplement lamp is switched on and off at preset time intervals, shooting is conducted on the object placing area in a facing mode during the on time of the light supplement lamp, so that a light supplement image is obtained, and shooting is conducted on the object placing area in a facing mode during the off time of the light supplement lamp, so that a non-light supplement image is obtained.
3. The image recognition triggering method as claimed in claim 2, wherein the fill-in image and the non-fill-in image for obtaining the background-removed image are adjacent frame images.
4. The image recognition triggering method as claimed in claim 3, wherein subtracting one of the fill-in images from one of the non-fill-in images to obtain a background-removed image comprises:
taking a difference image obtained by subtracting the first bright and dark indication value of the corresponding pixel point of one non-supplementary lighting image from the first bright and dark indication value of the pixel point of one supplementary lighting image as the background-removed image; or
And obtaining the background-removed image according to the absolute value of the difference value between the first bright and dark indication value of the pixel point of one light supplement image and the first bright and dark indication value of the corresponding pixel point of one non-light supplement image.
5. The image recognition triggering method as claimed in claim 1, wherein after obtaining the background-removed image by subtracting one of the fill-in images and one of the non-fill-in images, the method further comprises:
acquiring at least one background image; the background image is obtained by subtracting the two background removing images;
in the case that the first overall brightness indication value of the background-removed image is within a first predetermined range, outputting a trigger signal for controlling recognition of an object to be recognized, including:
and under the condition that the first overall light and dark indication value of the background removing image is within a first preset range and the second overall light and dark indication value of at least one background image is within a second preset range, outputting a trigger signal for controlling the identification of the object to be identified, wherein the second preset range can indicate that the object to be identified is stably positioned in the article placing area.
6. The image recognition trigger method of claim 5, wherein at least one of the background images is obtained before, after, or simultaneously with the determination of whether the first overall light-dark indicator value of the background-removed image is within the first predetermined range.
7. The image recognition trigger method of claim 5 or 6, wherein the second overall light-dark indication value of at least one of the background images is within a second predetermined range, specifically comprising:
the second overall light and dark indication values of both of the background images are within a second predetermined range.
8. An image recognition triggering device, comprising:
the shooting unit is used for shooting towards the object placing area under the condition that the light supplementing lamp is in an on state to obtain a light supplementing image; shooting towards the object placing area under the condition that the light supplementing lamp is in an off state to obtain a non-light supplementing image;
the background removing unit is used for subtracting the light supplementing image from the non-light supplementing image to obtain a background removing image;
and the triggering unit is used for outputting a triggering signal for controlling and identifying the object to be identified under the condition that the first overall brightness indication value of the background removing image is within a first preset range, wherein the first preset range can indicate that the object to be identified exists in the article placement area.
9. An image recognition apparatus, comprising: the image recognition triggering device as recited in claim 8.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN201911412503.9A 2019-12-31 2019-12-31 Image identification triggering method and device Pending CN113129242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911412503.9A CN113129242A (en) 2019-12-31 2019-12-31 Image identification triggering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911412503.9A CN113129242A (en) 2019-12-31 2019-12-31 Image identification triggering method and device

Publications (1)

Publication Number Publication Date
CN113129242A true CN113129242A (en) 2021-07-16

Family

ID=76770281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911412503.9A Pending CN113129242A (en) 2019-12-31 2019-12-31 Image identification triggering method and device

Country Status (1)

Country Link
CN (1) CN113129242A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116419074A (en) * 2023-03-08 2023-07-11 哈尔滨市科佳通用机电股份有限公司 Railway vehicle image acquisition method and system for eliminating sunlight interference

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116419074A (en) * 2023-03-08 2023-07-11 哈尔滨市科佳通用机电股份有限公司 Railway vehicle image acquisition method and system for eliminating sunlight interference
CN116419074B (en) * 2023-03-08 2024-04-19 哈尔滨市科佳通用机电股份有限公司 Railway vehicle image acquisition method and system for eliminating sunlight interference

Similar Documents

Publication Publication Date Title
CN106664364B (en) Image processing apparatus, control method therefor, and image capturing apparatus
CN106604005B (en) A kind of projection TV Atomatic focusing method and system
KR20100098450A (en) Camera flash module and method for controlling same
CN108418920B (en) Intelligent terminal and control method thereof
US9591231B2 (en) Image processing apparatus capable of properly emphasizing differences in brightness between bright spots, image processing method, and storage medium
CN111368819B (en) Light spot detection method and device
CN100565323C (en) Imaging device, imaging apparatus control method
CN104052933A (en) Method for determining dynamic range mode, and image obtaining apparatus
EP2161679B1 (en) Apparatus and method for extracting object image
CN111612839A (en) Colored lamp position identification method, system and device and storage medium
CN101640764A (en) Imaging apparatus and method
CN111385447B (en) Image pickup apparatus and driving method thereof
CN113129242A (en) Image identification triggering method and device
CN113132617B (en) Image jitter judgment method and device and image identification triggering method and device
JP2015092643A (en) Image processing device, image processing method thereof, computer program and image processing system
JP2017152866A (en) Image processing system and image processing method
TW201923712A (en) Image processing method and electronic apparatus for foreground image extraction
CN108629329B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110555809B (en) Background blurring method based on foreground image and electronic device
JP2009063674A (en) Imaging apparatus and flash control method
CN112770021B (en) Camera and filter switching method
JP7278764B2 (en) IMAGING DEVICE, ELECTRONIC DEVICE, IMAGING DEVICE CONTROL METHOD AND PROGRAM
CN110555351B (en) Foreground image extraction method and electronic device
JP2008011560A (en) Electronic camera apparatus and stroboscope color correction method
JP2013132065A (en) Imaging apparatus and flash control 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