Disclosure of Invention
The embodiment of the invention provides a light supplementing method and device, a computer device and a readable storage medium, which are used for solving the technical problem that the existing light supplementing scheme cannot take both the image processing precision and the influence of light pollution into consideration.
In a first aspect, an embodiment of the present invention provides a light supplement method, including:
acquiring and obtaining an infrared image aiming at a monitored area;
acquiring attribute information of each target object in M target objects in the infrared image, and acquiring M pieces of attribute information in total, wherein M is a positive integer;
determining N target objects which accord with preset attribute information from the M attribute information, wherein N is a positive integer not greater than M;
and controlling visible light to supplement light for each target object in the N target objects.
In the technical scheme of the embodiment of the invention, the infrared image of the monitored area is acquired and analyzed, the attribute information of each target object in M target objects in the infrared image is determined, and M attribute information is acquired. Then, N target objects that meet preset attribute information are determined from the M pieces of attribute information. Then, the visible light is controlled to fill light into each target object of the N target objects. That is to say, the infrared image is analyzed, the target object which meets the preset attribute information is screened out from the target objects of the infrared image, then, the visible light is controlled to supplement light to the target object which meets the preset attribute information, namely, the supplement light of the visible light to the target object is guided according to the attribute information of the target object in the infrared image. The whole light supplementing process improves the precision of image acquisition through visible light supplementing, and avoids light pollution caused by supplementing light to all target objects by visible light. That is to say, the whole light supplement process takes into account the precision of image acquisition and the influence of light pollution at the same time.
Optionally, after determining N target objects meeting preset attribute information from the M attribute information, the method further includes:
acquiring behavior characteristic information of each target object in the N target objects, and acquiring N pieces of behavior characteristic information in total;
determining N moments when visible light supplements each target object of the N target objects according to the N behavior feature information, wherein the moment when the visible light supplements a first target object of the N target objects corresponds to a first moment of the N moments;
and when the current moment is the first moment, controlling visible light to supplement light for the first target object.
In the technical scheme of the embodiment of the invention, after N target objects which accord with preset attribute information are determined from M pieces of attribute information, behavior characteristic information of each target object in the N target objects is obtained, and N pieces of behavior characteristic information are obtained in total. Then, according to the N behavior feature information, N times at which visible light supplements each of the N target objects are determined. That is to say, the behavior characteristics of the N target objects that meet the preset attribute information are analyzed, and then the time when the visible light supplements each target object of the N target objects is determined, so that the target objects do not need to be supplemented with light in the whole process, and only the corresponding target objects need to be supplemented with light when the corresponding time arrives. Therefore, the eye discomfort is avoided, and meanwhile, the accurate light supplement of the target object is guaranteed.
Optionally, after controlling the visible light to supplement light to the first target object, the method further includes:
acquiring and obtaining a first visible light image aiming at the first target object;
and marking the current state of the first target object as a processed state, and controlling visible light to stop the light supplement of the first target object.
In the technical scheme of the embodiment of the invention, after the visible light is used for supplementing light to a first target object in N target objects, a first visible light image aiming at the first target object is acquired and obtained; and then, marking the current state of the first target object as a processed state, and controlling visible light to stop supplementing light to the first target object. That is to say, after the acquisition of the first visible light image of the first target object is completed, the first target object is marked as a processed state, and the subsequent visible light does not need to continuously perform light supplement and image acquisition on the first target object, so that the light supplement efficiency is improved.
Optionally, the method further comprises:
determining the area position of each target object in the N target objects in the monitoring area, and obtaining N area positions in total;
and controlling visible light to supplement light for the target object at each of the N area positions.
In the technical scheme of the embodiment of the invention, after N target objects which accord with preset attribute information are screened out from M target objects of infrared images, the area position of each target object in a monitoring area in the N target objects is determined, and N area positions are obtained in total; and then, controlling the visible light to fill in light of the target object at each of the N area positions. That is to say, after the target objects meeting the preset attribute information are screened out, the target objects in the positions of the regions are subjected to targeted light supplement according to the positions of the target objects in the monitored regions, so that the targeted light supplement of the target objects is realized, and the light supplement efficiency is improved.
Optionally, the attribute information includes at least one of size, human body attribute, clothing attribute and vehicle attribute of the target object in the image;
the behavior feature information comprises at least one of orientation, posture, distance, movement speed and position.
In a second aspect, an embodiment of the present invention further provides a light supplement device, including:
the first acquisition unit is used for acquiring and obtaining an infrared image aiming at a monitored area;
the first obtaining unit is used for obtaining attribute information of each target object in M target objects in the infrared image, and obtaining M pieces of attribute information in total, wherein M is a positive integer;
a first determining unit, configured to determine, from the M pieces of attribute information, N target objects that meet preset attribute information, where N is a positive integer not greater than M;
and the first control unit is used for controlling the visible light to supplement light for each target object in the N target objects.
Optionally, after the determining unit determines N target objects meeting preset attribute information from the M attribute information, the apparatus further includes:
a second obtaining unit, configured to obtain behavior feature information of each target object in the N target objects, and obtain N behavior feature information in total;
the second determining unit is used for determining N moments when visible light supplements each target object of the N target objects according to the N behavior feature information, wherein the moment when the visible light supplements the first target object of the N target objects corresponds to a first moment of the N moments;
and the second control unit is used for controlling the visible light to supplement light for the first target object when the current moment is the first moment.
Optionally, after the second control unit controls the visible light to supplement light to the first target object, the apparatus further includes:
the second acquisition unit is used for acquiring and obtaining a first visible light image aiming at the first target object;
and the third control unit is used for marking the current state of the first target object as a processed state and controlling visible light to stop supplementing light to the first target object.
Optionally, the apparatus further comprises:
a third determining unit, configured to determine an area position of each target object in the monitoring area in the N target objects, and obtain N area positions in total;
and the fourth control unit is used for controlling the visible light to supplement light for the target object at each of the N area positions.
Optionally, the attribute information includes at least one of size, human body attribute, clothing attribute and vehicle attribute of the target object in the image;
the behavior feature information comprises at least one of orientation, posture, distance, movement speed and position.
In a third aspect, an embodiment of the present invention further provides a computer apparatus, where the computer apparatus includes a processor, and the processor is configured to implement the steps of the fill-in light method according to the first aspect when executing a computer program stored in a memory.
In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the light supplement method according to the first aspect.
Detailed Description
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to better understand the technical solutions of the present invention, the technical solutions of the present invention are described in detail below with reference to the drawings and the specific embodiments, and it should be understood that the specific features in the embodiments and the embodiments of the present invention are detailed descriptions of the technical solutions of the present invention, and are not limitations of the technical solutions of the present invention, and the technical features in the embodiments and the embodiments of the present invention may be combined with each other without conflict.
In the embodiment of the present invention, the light supplement method may be specifically applied to an image acquisition system, where the image acquisition system includes an infrared image acquisition module, an infrared light supplement module, a visible light image acquisition module, an image processing module, and the like. The infrared light supplementing module is used for performing infrared light supplementing on the monitored area in real time; the infrared image acquisition module is specifically used for acquiring and obtaining an infrared image for a monitored area in real time; the image processing module is used for analyzing the infrared image and determining the attribute information of the target object in the infrared image so as to determine the target object which accords with the preset attribute information; then, the image processing module controls the visible light supplementary lighting module to supplement light for the target object which accords with the preset attribute information; then, a visible light image of the target object aiming at the preset attribute information is obtained by a visible light image acquisition module; then, the obtained visible light image is analyzed and processed by the image processing module.
In the embodiment of the present invention, the image capturing system may be a dual-camera structure, in which one group of lenses and image sensors captures infrared images, and the other group of lenses and image sensors captures visible light images. The image acquisition system can also be a light splitting structure, specifically, light acquired by the same lens is split into one path of infrared light and one path of visible light according to wavelength by light splitting devices such as a prism and the like, and the infrared light and the visible light are respectively acquired by corresponding image sensors. The image acquisition system can also adopt a structure of a single lens and a mixed pixel image sensor, and specifically, the pixels of the image sensor are formed by mixing visible light sensing pixels and infrared light sensing pixels. In a specific implementation process, the acquired infrared image and the visible light image have a determined position mapping relation.
In addition, in the embodiment of the present invention, each module included in the image capturing system may also be named by other names, and all modules capable of implementing corresponding functions are within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the invention provides a light supplement method, including:
s101: acquiring and obtaining an infrared image aiming at a monitored area;
s102: acquiring attribute information of each target object in M target objects in the infrared image, and acquiring M pieces of attribute information in total, wherein M is a positive integer;
s103: determining N target objects which accord with preset attribute information from the M attribute information, wherein N is a positive integer not greater than M;
s104: and controlling visible light to supplement light for each target object in the N target objects.
In the specific implementation process, the specific implementation process of step S101 to step S104 is as follows:
firstly, infrared light supplement is carried out on a monitored area, and an infrared image aiming at the monitored area is acquired and obtained. Then, analyzing the infrared image to obtain attribute information of each target object in M target objects in the infrared image, and obtaining M pieces of attribute information in total, wherein M is a positive integer. In a specific implementation process, the attribute information may specifically be at least one of size, human body attribute, clothing attribute, and vehicle attribute of the target object in the image. Wherein each attribute information may be a set including a plurality of features. For example, the human body attribute comprises gender and age, the clothing attribute comprises hat, skirt and shoes, and the vehicle attribute comprises bus, car and bicycle. As a specific example, M is 3, and there are A, B, C target objects in the infrared image, where the attribute information of the target object a is "middle age, male, optical head, walking", the attribute information of the target object B is "child, female, twisted braid, toy car", and the attribute information of the target object C is "young, female, long hair, car".
Then, N target objects which accord with preset attribute information are determined from the obtained M pieces of attribute information. Wherein N is a positive integer not greater than M. In a specific implementation process, the preset attribute information may be specifically set manually by a user according to actual needs, or may be set by a person skilled in the art in advance for an image acquisition system. Still taking the above example as an example, when the preset attribute information is "middle age, male, bald", the target object a is determined to be the target object conforming to the preset attribute information.
In the embodiment of the present invention, based on the attribute of the size of the target object in the image, the target object meeting the size requirement may be screened, for example, the target object with the size larger than a preset threshold may be screened, where the preset threshold may be a numerical value specifically set by a person skilled in the art according to an actual use habit of a user, and for example, the preset threshold is 10pixels × 10 pixels. Of course, the numerical value can also be manually set by the user according to needs, and the description is omitted here. Of course, those skilled in the art can set other attribute information than the above listed attribute information according to actual needs to implement the screening of the target object, and details thereof are not described here.
And then, controlling the visible light to supplement light for each target object in the N target objects. Still taking the above example as an example, the visible light is controlled to fill the target object a with light. In a specific implementation process, if it is determined from the M attribute information that there are a plurality of N target objects that meet the preset attribute information, the N target objects may be supplemented with light by visible light, or each target object of the N target objects may be supplemented with light sequentially according to a preset sequence. The preset sequence may be a sequence preset by a person skilled in the art according to an actual use habit of a user, or may be a sequence manually set by the user, for example, light supplement is sequentially performed according to a height sequence from top to bottom, and then light supplement is sequentially performed according to a left-to-right sequence, and the like, which are not illustrated herein.
In order to implement accurate light supplement for a target object in the embodiment of the present invention, referring to fig. 2, in step S103: after determining N target objects meeting preset attribute information from the M attribute information, the method further includes:
s201: acquiring behavior characteristic information of each target object in the N target objects, and acquiring N pieces of behavior characteristic information in total;
s202: determining N moments when visible light supplements each target object of the N target objects according to the N behavior feature information, wherein the moment when the visible light supplements a first target object of the N target objects corresponds to a first moment of the N moments;
s203: and when the current moment is the first moment, controlling visible light to supplement light for the first target object.
In the specific implementation process, the specific implementation process of step S201 to step S203 is as follows:
firstly, behavior feature information of each target object in N target objects is obtained, and N pieces of behavior feature information are obtained in total. Wherein the behavior feature information comprises at least one of orientation, posture, distance, movement speed and position. The behavior feature information of each target object may be a set of a plurality of behavior features. In a specific implementation process, the behavior feature information may be manually set by a user according to actual needs, or may be preset for an image acquisition system by a person skilled in the art. In a specific implementation, the orientation is used to characterize the orientation of the face of the target object, for example, the face of the target object is facing the image acquisition system; the posture is used for representing the current appearance and expression of the target object, for example, the current posture of the target object is sitting upright relative to the image acquisition system; for another example, the current posture of the target object is kneeling with one leg relative to the image acquisition system. The distance is used for representing the distance condition between the target object and the image acquisition system; the motion speed is used for representing the speed value of the target object. The position is used for representing the position information of the specific position of the target object. Of course, those skilled in the art can set other behavior feature information than the above listed behavior feature information according to actual needs to implement the screening of the target object, and details thereof are not described herein.
Then, according to the N behavior feature information, N times at which the visible light supplements each of the N target objects are determined, wherein a time at which the visible light supplements a first target object of the N target objects corresponds to a first time of the N times. And then, when the current moment is a first moment, controlling the visible light to supplement light to the first target object. That is to say, through analyzing the behavior characteristics of N target objects that accord with preset attribute information, and then confirm the moment that the visible light carries out the light filling to every target object in these N target objects, only need to carry out the light filling to corresponding target object again when corresponding moment arrives, whole process need not whole journey and carries out the light filling to target object to when avoiding eyes are uncomfortable, guaranteed the accurate light filling to target object.
Still taking the above example as an example, the behavior feature information of the target object a is obtained, and when it is detected that the current face of the target object a is directly facing the image acquisition system, the target object a is supplemented with visible light. In a specific implementation process, if a plurality of N target objects are provided, the time when the face of each target object is over against the image acquisition system can be determined, and the visible light is controlled at the corresponding time to supplement light for the corresponding target object. Of course, besides determining the light supplement time of each target object in the N target objects according to the face orientation, a person skilled in the art may also define the corresponding light supplement time when the behavior feature information of the N target objects is specific according to the actual usage habit of the user, and thus the description is omitted here.
In the embodiment of the present invention, referring to fig. 3, in order to improve the light supplement efficiency, in step S203: when the current time is the first time, after the visible light is controlled to supplement light to the first target object, the method further includes:
s301: acquiring and obtaining a first visible light image aiming at the first target object;
s302: and marking the current state of the first target object as a processed state, and controlling visible light to stop the light supplement of the first target object.
In the specific implementation process, the specific implementation process from step S301 to step S302 is as follows:
first, a first visible light image for a first target object is acquired. And then, marking the current state of the first target object as a processed state, and controlling the visible light to stop the light supplement of the first target object. That is, after the acquisition of the first visible light image of the first target is completed, the first target object is marked as a processed state, and then the light supplement and image acquisition are continuously performed on the first target object without visible light. In a specific process, the processed state may be a completed acquisition state, and after the first target object is in the processed state, the light supplement and the image acquisition of the first target object are continued without visible light until the first target object is lost. Still taking the above example as an example, after performing visible light supplementary lighting on the target object a, acquiring to obtain a visible light image for the target object a, marking the target object a in a processed state, and then performing visible light supplementary lighting and image acquisition on the target object a again is not needed.
In addition, in the specific implementation process, when the N target objects are a plurality of target objects including the first target object, the same processing can be performed on other objects except the first target object, and it is not necessary to continuously perform visible light supplementary lighting on each target object and image acquisition, so that discomfort to human eyes caused by continuous visible light supplementary lighting and light pollution to other objects in a monitored area are effectively avoided, and the service performance of the image acquisition system is improved while the supplementary lighting efficiency is improved.
In an embodiment of the present invention, in order to improve the targeted light supplement for the target object and further improve the light supplement efficiency, please refer to fig. 4, the method further includes:
s401: determining the area position of each target object in the N target objects in the monitoring area, and obtaining N area positions in total;
s402: and controlling visible light to supplement light for the target object at each of the N area positions.
In the specific implementation process, the specific implementation process from step S401 to step S402 is as follows:
firstly, determining the area position of each target object in the N target objects in a monitoring area, and obtaining N area positions in total; and then, controlling the visible light to fill in light of the target object at each of the N area positions. That is to say, after the target objects meeting the preset attribute information are screened out, targeted light supplement is performed on the target objects in each area position according to the position of each target object in the monitored area, so that a function of targeted light supplement according to the area positions is achieved, light supplement efficiency is improved, and meanwhile, waste of energy consumption is effectively reduced.
Based on the same inventive concept, please refer to fig. 5, an embodiment of the present invention further provides a light supplement device, including:
thefirst acquisition unit 10 is used for acquiring and obtaining an infrared image aiming at a monitored area;
a first obtainingunit 20, configured to obtain attribute information of each of M target objects in the infrared image, and obtain M pieces of attribute information in total, where M is a positive integer;
a first determiningunit 30, configured to determine, from the M attribute information, N target objects that meet preset attribute information, where N is a positive integer not greater than M;
and thefirst control unit 40 is configured to control the visible light to supplement light to each of the N target objects.
Since the functions of the above units have been described in detail in the above light supplement method, they are not described again here.
In an embodiment of the present invention, after the determining unit determines, from the M pieces of attribute information, N target objects that meet preset attribute information, the apparatus further includes:
a second obtaining unit, configured to obtain behavior feature information of each target object in the N target objects, and obtain N behavior feature information in total;
the second determining unit is used for determining N moments when visible light supplements each target object of the N target objects according to the N behavior feature information, wherein the moment when the visible light supplements the first target object of the N target objects corresponds to a first moment of the N moments;
and the second control unit is used for controlling the visible light to supplement light for the first target object when the current moment is the first moment.
In this embodiment of the present invention, after the second control unit controls the visible light to supplement light to the first target object, the apparatus further includes:
the second acquisition unit is used for acquiring and obtaining a first visible light image aiming at the first target object;
and the third control unit is used for marking the current state of the first target object as a processed state and controlling visible light to stop supplementing light to the first target object.
In an embodiment of the present invention, the apparatus further includes:
a third determining unit, configured to determine an area position of each target object in the monitoring area in the N target objects, and obtain N area positions in total;
and the fourth control unit is used for controlling the visible light to supplement light for the target object at each of the N area positions.
In the embodiment of the invention, the attribute information comprises at least one of the information of the size, the human body attribute, the clothing attribute and the vehicle attribute of the target object in the image;
the behavior feature information comprises at least one of orientation, posture, distance, movement speed and position.
An embodiment of the present invention further provides a computer apparatus, where the computer apparatus includes a processor, a memory, and a computer program stored in the memory and executable on the processor, for example: acquiring and obtaining an infrared image aiming at a monitored area; acquiring attribute information of each target object in M target objects in the infrared image, and acquiring M pieces of attribute information in total, wherein M is a positive integer; determining N target objects which accord with preset attribute information from the M attribute information, wherein N is a positive integer not greater than M; and controlling visible light to supplement light for each target object in the N target objects. The processor, when executing the computer program, performs the steps in the method embodiments described in the above aspects, such as the method steps shown in fig. 1. Alternatively, the processor implements the functions of the units in the above-described device embodiments when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the supplementary lighting device/computer device. For example, the computer program may be divided into a first acquisition unit, a first obtaining unit, a first determining unit, and a first control unit, and the specific functions of the modules are as follows: the first acquisition unit is used for acquiring and obtaining an infrared image aiming at a monitored area; the first obtaining unit is used for obtaining attribute information of each target object in M target objects in the infrared image, and obtaining M pieces of attribute information in total, wherein M is a positive integer; a first determining unit, configured to determine, from the M pieces of attribute information, N target objects that meet preset attribute information, where N is a positive integer not greater than M; and the first control unit is used for controlling the visible light to supplement light for each target object in the N target objects.
The supplementary lighting device/computer device may be a monocular camera, a binocular camera, or other computing devices. The light supplementing device/computer device may include, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that the schematic diagram is merely an example of the lighting device/computer device, and does not constitute a limitation of the lighting device/computer device, and may include more or less components than those shown in the drawings, or combine some components, or different components, for example, the lighting device/computer device may further include an input and output device, a network access device, a bus, and the like.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the processor is a control center of the lighting device/computer device, and various interfaces and lines are used to connect various parts of the whole lighting device/computer device.
The memory may be configured to store the computer program and/or the module, and the processor may implement various functions of the lighting device/computer device by operating or executing the computer program and/or the module stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Yet another aspect of the embodiments of the present invention provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the light supplement method described above.
The module/unit integrated with the light supplement device/the computer device may be stored in a computer readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.