CN111629146A - Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium - Google Patents

Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium Download PDF

Info

Publication number
CN111629146A
CN111629146A CN202010465278.1A CN202010465278A CN111629146A CN 111629146 A CN111629146 A CN 111629146A CN 202010465278 A CN202010465278 A CN 202010465278A CN 111629146 A CN111629146 A CN 111629146A
Authority
CN
China
Prior art keywords
target
brightness
matrix
preview image
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010465278.1A
Other languages
Chinese (zh)
Other versions
CN111629146B (en
Inventor
泮诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010465278.1A priority Critical patent/CN111629146B/en
Publication of CN111629146A publication Critical patent/CN111629146A/en
Application granted granted Critical
Publication of CN111629146B publication Critical patent/CN111629146B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for adjusting shooting parameters, wherein the method comprises the following steps: acquiring a preview image of a camera device; determining a target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image; acquiring a target brightness matrix element set from a plurality of matrix elements included in a target brightness matrix based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set in a preview image as a target region; and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value. By adopting the embodiment of the invention, the shooting parameters of the camera device can be dynamically adjusted according to the brightness condition of the local area, and the quality of the image captured by the camera device is improved.

Description

Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device and a storage medium for adjusting shooting parameters.
Background
In recent years, electronic commerce rises and generates huge impact on traditional retail sales. Under the impact of a new consumption mode, an artificial intelligence technology is adopted in an off-line entity retail dispute, the advantages of the artificial intelligence technology in customer behavior analysis and accurate marketing are integrated, and the concept of an intelligent market is generated. In the wisdom market, can deploy a plurality of cameras, because the camera deploys the difference of position, illumination condition and environment are also different, for the play effect that the camera can be better, often need artificial respectively to every camera dispose, browse the real-time picture of every camera, adjust respectively to every camera to make every camera satisfy the requirement of making a video recording.
Often, thousands of cameras need to be deployed in a market, a lot of manpower and time are consumed according to the adjustment method, and the manual adjustment of the cameras may result in low accuracy of the adjustment. Therefore, how to effectively adjust the camera in the field of smart stores is a hot issue in current research.
Disclosure of Invention
The embodiment of the invention provides a shooting parameter adjusting method, a shooting parameter adjusting device, shooting parameter adjusting equipment and a storage medium, which can dynamically adjust the shooting parameters of a camera device according to the brightness condition of a local area and improve the quality of images captured by the camera device.
In one aspect, an embodiment of the present invention provides a method for adjusting shooting parameters, including:
acquiring a preview image of a camera device;
determining a target brightness matrix corresponding to the preview image based on an object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements;
acquiring a target brightness matrix set from the matrix elements based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set on the preview image as a target region, wherein the region division condition means that at least one matrix element in any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is less than a threshold;
and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
In one aspect, an embodiment of the present invention provides an apparatus for adjusting a shooting parameter, including:
an acquisition unit configured to acquire a preview image of an image pickup apparatus;
the determining unit is used for determining a target brightness matrix corresponding to the preview image according to the object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements;
the obtaining unit is further configured to obtain a target luminance matrix element set from the plurality of matrix elements based on a region division condition, where the region division condition is that at least one matrix element of any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is less than a threshold;
the processing unit is used for taking an area corresponding to the area occupied by the target brightness matrix element set on the preview image as a target area;
the acquisition unit is further used for acquiring a region brightness value of the target region;
the processing unit is further configured to dynamically adjust the shooting parameters of the image capturing device based on the area brightness values.
In one embodiment, when the image pickup device captures the preview image, the shooting parameters of the image pickup device are first shooting parameters; after the shooting parameters of the camera device are dynamically adjusted based on the region brightness value, the shooting parameters of the camera device are second shooting parameters; when capturing an image based on the second shooting parameter by the image capturing device, the brightness value of the target area in the captured image satisfies a brightness value condition.
In one embodiment, when determining the target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image, the determining unit performs the following operations: detecting whether a preset reference range exists or not; if the reference range exists in the preview image, taking the area indicated by the reference range in the preview image as a target area; and if the target brightness matrix does not exist, determining the target brightness matrix corresponding to the preview image according to the target brightness value of the target object in the preview image.
In one embodiment, the number of the target objects is at least one, and the determining unit performs the following operations when determining the target brightness matrix corresponding to the preview image according to the object brightness values of the target objects:
acquiring position information of each target object on the preview image;
acquiring an initial brightness matrix matched with the preview image based on the resolution of the camera device; determining a matching position matched with the position information of any one target object in each target object in the initial brightness matrix, and storing the object brightness value of any one target object as a matrix element at the matching position to obtain a target brightness matrix; in the target brightness matrix, the matrix elements at a plurality of matching positions matched with the position information of the same target object are the same, and the matrix elements at other positions not matched with the position information of any one target object are zero.
In one embodiment, the acquisition unit, when acquiring a target luminance matrix element set from the plurality of matrix elements based on a region division condition, performs the following operations:
selecting matrix elements which are not traversed from a plurality of matrix elements included in the target brightness matrix as first matrix elements traversed currently;
traversing adjacent matrix elements of the first matrix element, and determining whether a second matrix element exists, so that the area division condition is satisfied between the first matrix element and the second matrix element, where the condition that the first matrix element and the second matrix element satisfy the area division condition means that at least one of the second matrix element and the first matrix element is zero; or the difference between the second matrix element and the first matrix element is less than a threshold;
if so, continuously traversing whether a third matrix element exists or not so as to enable the area division condition to be met between the first matrix element and the third matrix element; or the area division condition is satisfied between the second matrix element and the third matrix element; if not, ending the current traversal, and storing the first matrix element into a target brightness matrix element set.
In one embodiment, the device for adjusting the shooting parameters further comprises a detection unit, wherein the detection unit is used for detecting whether a target object is included in the preview image; the determining unit executes a step of determining a target brightness matrix corresponding to the preview image according to a target brightness value of a target object in the preview image when the detecting unit detects that the preview image includes the target object.
In one embodiment, the target area is an area indicated by the reference range in the preview image, and the obtaining unit performs the following steps when obtaining an area brightness value of the target area: detecting whether the target area comprises the target object; if the target area comprises the target object, determining an object brightness value of the target object; and performing preset operation on the object brightness value of the target object, and taking the obtained operation result as the area brightness value of the target area.
In one embodiment, the acquisition unit, when acquiring the region luminance value of the target region, performs the following operations: and performing preset operation on at least one target brightness matrix element included in the target brightness matrix element set, and taking an obtained operation result as a region brightness value of the target region.
In an embodiment, the target area is an area indicated by the reference range in the preview image, and the acquiring unit is further configured to acquire a plurality of target images captured by the image capturing device within a preset time of history; the processing unit is further configured to adjust the shooting parameters of the image pickup device to initial shooting parameters if a target history preview image does not exist in the plurality of history preview images, wherein the target object is included in a target area in the target history preview image.
In one embodiment, the number of the target areas is at least one, and the processing unit performs the following operations when dynamically adjusting the shooting parameters of the image capturing device based on the area brightness value: obtaining a brightness difference value between the area brightness value of each target area and a brightness threshold value, and obtaining the maximum brightness difference value in a plurality of brightness difference values; and dynamically adjusting the shooting parameters of the camera device according to the direction of reducing the maximum brightness difference value to be less than or equal to the brightness difference threshold value.
In one aspect, an embodiment of the present invention provides a device for adjusting shooting parameters, including:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium storing one or more instructions adapted to be loaded by the processor and to perform the steps of:
acquiring a preview image of a camera device;
determining a target brightness matrix corresponding to the preview image according to an object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements;
acquiring a target brightness matrix element set from the matrix elements based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set on the preview image as a target region, wherein the region division condition means that at least one matrix element in any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is smaller than a threshold value;
and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
In one aspect, an embodiment of the present invention provides a computer storage medium, where computer program instructions are stored in the computer storage medium, and when executed by a processor, the computer program instructions are configured to perform:
acquiring a preview image of a camera device;
determining a target brightness matrix corresponding to the preview image according to an object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements;
acquiring a target brightness matrix element set from the matrix elements based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set on the preview image as a target region, wherein the region division condition means that at least one matrix element in any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is smaller than a threshold value;
and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
In the embodiment of the invention, after the camera device captures the preview image, the shooting parameter adjusting device determines the target area in the preview image based on the object brightness value of the target object in the preview image, further obtains the area brightness value of the target area, and dynamically adjusts the shooting parameter of the camera device based on the area brightness value. And aiming at the brightness condition of a local area, shooting parameters are dynamically adjusted, so that the problem that the local part of a shot image is too dark can be solved, and the quality of the image captured by the camera device is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a system for adjusting shooting parameters according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for adjusting shooting parameters according to an embodiment of the present invention;
fig. 3 is a schematic diagram of intercepting a sub-image corresponding to a target object according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of determining a target luminance matrix according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a method for determining a set of target luminance matrix elements according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of another method for adjusting shooting parameters according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an application scenario provided by an embodiment of the present invention;
fig. 8 is an interaction diagram of a method for adjusting shooting parameters according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an apparatus for adjusting shooting parameters according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an apparatus for adjusting shooting parameters according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The embodiment of the invention provides a shooting parameter adjusting scheme, which can determine a target area in a preview image according to the object brightness value of a target object in the preview image, and dynamically adjust the shooting parameters of a camera device according to the area brightness value of the target area, so that when the camera device carries out image acquisition based on the adjusted shooting parameters, the brightness of the target area in the acquired image meets the brightness condition, and the shooting parameters of the camera device are dynamically adjusted according to the brightness condition of a local area, thereby realizing intelligent shooting parameter adjustment and improving the image capturing quality of the camera device.
Based on the above adjustment scheme of the shooting parameters, an embodiment of the present invention provides an adjustment system of the shooting parameters, and referring to fig. 1, a schematic structural diagram of the adjustment system of the shooting parameters provided in the embodiment of the present invention is provided. The system for adjusting shooting parameters shown in fig. 1 includes an image pickup device 101 and an adjusting apparatus 102 for shooting parameters, the image pickup device 101 and the adjusting apparatus 102 for shooting parameters are connected to each other, and the image pickup device 101 may include a camera, an image capturing sensor, and the like. The shooting parameter adjusting device 102 may be a shooting parameter adjusting device, such as any one or more of a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like; alternatively, the device 102 for adjusting the shooting parameters may also be a server device, where the server device may refer to an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. Alternatively, the adjustment device 102 of the shooting parameters may include any one or more of the following artificial intelligence image capturing device, artificial intelligence computing chip TX1, TK1, and Movidias.
In one embodiment, the camera 101 may be used to capture images, for example, the camera 101 includes a camera deployed in a smart mall, and the camera 101 may capture images within the shooting range thereof. The adjusting device 102 of the shooting parameters may perform information interaction with the image capturing apparatus 101, for example, the image capturing apparatus 101 sends the acquired image to the adjusting device 102 of the shooting parameters, and the adjusting device 102 of the shooting parameters performs the above adjusting scheme of the shooting parameters based on the image acquired by the image capturing apparatus 101, so as to dynamically adjust the shooting parameters of the image capturing apparatus.
The shooting parameters refer to parameters affecting the brightness of the image, such as any one or more of exposure duration, exposure mode, shutter time and the like. The dynamic adjustment of the shooting parameters of the camera device refers to adjusting the shooting parameters of the camera device until the brightness value of the target area on the image acquired by the camera device meets the brightness value condition. Therefore, the shooting parameters of the camera device are dynamically adjusted according to the brightness condition of the area, the problem of regional over-darkness can be solved, and the quality of the image collected by the camera device 101 is improved.
Based on the above adjustment scheme and adjustment system for shooting parameters, the embodiment of the invention provides an adjustment method for shooting parameters. Referring to fig. 2, a flowchart of a method for adjusting shooting parameters according to an embodiment of the present invention is shown. The method for adjusting the shooting parameters shown in fig. 2 may be performed by an apparatus for adjusting the shooting parameters, and may specifically be performed by a processor of the apparatus for adjusting the shooting parameters, and the method for adjusting the shooting parameters shown in fig. 2 may include the following steps:
step S201 acquires a preview image of the imaging apparatus.
The camera device may be any device that can be used to capture images, such as a camera and an image sensor. In one embodiment, when the image pickup device captures the preview image, the shooting parameters of the image pickup device are first shooting parameters. The photographing parameters refer to parameters that can affect the brightness of an image, such as an exposure mode, an exposure time, and a shutter time, etc.
In one embodiment, the acquiring of the preview image captured by the image capturing device may be performed when a shooting parameter adjustment event is detected. Optionally, at different time periods, the lighting conditions are different, and in order to ensure that the brightness of the image captured in each time period is suitable, a capturing parameter adjustment event may be generated based on a time factor, and when the capturing parameter adjustment event is detected, each step of performing capturing adjustment is started.
In a specific implementation, the generating of the shooting parameter adjustment event based on the time factor may include: setting shooting parameter adjustment time, such as 10 am, 3 pm or any other time point; alternatively, the setting is to perform the shooting parameter adjustment every 1 hour from 8 am. Then, the detection of the photographing parameter adjustment event may refer to the detection of the arrival of the adjustment time of the photographing parameter.
Step S202, determining a target brightness matrix corresponding to the preview image according to the target brightness value of the target object in the preview image.
In one embodiment, the target object may include a human face or other designated objects, such as a vehicle, a table, a wall surface, and the like, and the number of the target objects is at least one. The target luminance matrix includes a plurality of matrix elements, each matrix element being determined based on a target luminance value of a target object.
In one embodiment, before performing step S202, the method further includes: an object luminance value of each target object is acquired. Optionally, the object brightness value of each target object may be obtained according to YUV data of a sub-image corresponding to each target object in the preview image. In a specific implementation, the obtaining the object brightness value of each target object includes: intercepting a sub-image corresponding to the target object from the preview image; acquiring YUV data of the sub-image, and acquiring data of a Y channel from the YUV data; and calculating the average brightness value of the sub-image based on the data of the Y channel and the size information of the sub-image, and taking the average brightness value as the object brightness value of the target object.
The embodiment of intercepting the sub-image corresponding to the target object from the preview image may include: determining coordinates of the upper left corner of the position of the target object in the preview image, which can be expressed as (x, y), and then determining the size of the target image, such as the length w and the width h; and taking the image formed by the coordinates and the size as a sub-image corresponding to the target object. Wherein, the coordinates and the size of the upper left corner can be collectively referred to as position information for representing the position of the target object in the preview image. For example, referring to fig. 3, in order to provide a schematic diagram for capturing a sub-image corresponding to a target object according to an embodiment of the present invention, 300 represents a preview image acquired by an imaging device, where the preview image includes two target objects 301 and 302, coordinates of an upper left corner of a position where the target object 302 is located in the preview image 300 are (x1, y1), sizes of the target objects are w1 and h1, position information of the target object 302 in the preview image 300 may be considered as (x1, y1, w1, h1), the region 303 on the preview image may be located according to the position information, and an image of the region 303 may be captured as the sub-image of the target object.
In one embodiment, the size information of the sub-image corresponding to the target object is assumed to be: if the length is w and the width is Y, then the average brightness value of the sub-image is calculated based on the data of the Y channel and the size information of the sub-image, and the average brightness value is taken as the object brightness value of the target object, which can be calculated by the following formula (1):
Figure BDA0002510921980000081
wherein L isavgAn object luminance value representing a target object,
Figure BDA0002510921980000082
representing the data in the nth y channel, with n taking a value between 1 and w h.
In an embodiment, after the object luminance value of each target object is obtained, the target luminance matrix corresponding to the preview image may be determined according to the object luminance value of each target object, and in a specific implementation: acquiring position information of each target object on the preview image; acquiring an initial brightness matrix matched with the preview image based on the resolution of the camera device; determining a matching position matched with the position information of any one target object in each target object in the initial brightness matrix, and storing the object brightness value of any one target object as a matrix element at the matching position to obtain a target brightness matrix; in the target brightness matrix, the matrix elements at a plurality of matching positions matched with the position information of the same target object are the same, and the matrix elements at other positions not matched with the position information of any one target object are zero.
Optionally, the obtaining of the initial luminance matrix matched with the preview image based on the resolution of the image capturing device may refer to that the size of the initial luminance matrix is in a certain proportion to the resolution of the image capturing device, for example, the proportion between the size of the initial luminance matrix and the resolution of the image capturing device is 1:1, that is, an initial luminance matrix with the same size as the resolution of the image capturing device is set, for example, the resolution of the image capturing device is 1080x1080, and then the size of the initial luminance matrix is 1080x 1080; further, if the ratio between the initial luminance matrix size and the resolution of the image pickup device is 1:2, the size of the initial luminance matrix can be set to 540x540 assuming that the resolution of the image pickup device is 1080x 1080. In the embodiment of the present invention, it is assumed that the size of the initial luminance matrix is the same as the resolution of the imaging device.
Optionally, the initial luminance matrix is a null matrix, and after the initial luminance matrix is determined, the object luminance value of each target object is stored as a matrix element in the initial luminance matrix at a matching position matched with the position information of the target object to obtain the target luminance matrix. For example, referring to fig. 4, a schematic diagram of determining a target luminance matrix according to an embodiment of the present invention is provided, where 400 denotes an initial luminance matrix, 411 denotes a preview image, and the preview image includes target objects 401, 402, and 403. Assuming that the size of the initial luminance matrix is 5x5, for the target object 401, assuming that the object luminance value of the target object 401 is 1, the position information of the target object 401 in the preview image can be represented as (0, y1, w1, h1), in the initial luminance matrix, the number of matching positions matching the position information is 422, the number of positions is two, the two matching positions are filled with 1 to obtain two matrix elements, and so on, the object luminance value of each target object is stored at the matching position of the initial luminance matrix, and for the other positions of the initial luminance matrix not matching the position information of any one target object, the matrix element is set to 0, through the above steps, the target luminance matrix is obtained as shown in 433 in fig. 4.
Step S203, acquiring a target luminance matrix element set from the plurality of matrix elements based on the region division condition, and taking a region corresponding to a region occupied by the target luminance matrix element set on the preview image as a target region.
In an embodiment, after the target luminance matrix is determined, a target luminance matrix element set may be obtained from a plurality of matrix elements included in the target luminance matrix based on a region division condition, where the target luminance matrix element set may include at least one matrix element, and a region corresponding to a region occupied by the target luminance matrix element set in the preview image is further used as a target region. The area division condition may mean that at least one matrix element is zero between any two adjacent matrix elements; alternatively, the difference between any two matrix elements is less than a threshold. The area occupied by the target luminance matrix element set may be understood as an area occupied by a plurality of target luminance matrix elements in the target luminance matrix element set.
Specifically, the obtaining a target luminance matrix element set from the plurality of matrix elements based on the region division condition includes: selecting matrix elements which are not traversed from a plurality of matrix elements included in the target brightness matrix as first matrix elements traversed currently; traversing adjacent matrix elements of the first matrix element, and determining whether a second matrix element exists, so that the area division condition is satisfied between the first matrix element and the second matrix element, where the condition that the first matrix element and the second matrix element satisfy the area division condition means that at least one of the second matrix element and the first matrix element is zero; or the difference between the second matrix element and the first matrix element is less than a threshold; if so, continuously traversing whether a third matrix element exists or not so as to enable the area division condition to be met between the first matrix element and the third matrix element; or the area division condition is satisfied between the second matrix element and the third matrix element; if not, ending the current traversal, and storing the first matrix element as a target brightness matrix element into a target brightness matrix element set.
Colloquially, the step of obtaining the set of target luminance matrix elements comprises: the method comprises the steps of scanning a target brightness matrix line by line, finding out first matrix elements of a plurality of matrix elements which are not divided into areas, traversing matrix elements adjacent to the first matrix elements by taking the first matrix elements as a center, comparing the adjacent matrix elements with the first matrix elements, and taking the adjacent matrix elements, of which the difference value with the first matrix elements is smaller than a threshold value, as second matrix elements; alternatively, an adjacent matrix element of 0 among adjacent matrix elements is taken as the second matrix element. Further, with the combination of the first matrix element and the second matrix element as a center, continuing the above steps, finding a third matrix element which satisfies the area division condition with the first matrix element, or finding a third matrix element which satisfies the area division condition with the second matrix element, and so on, ending the current traversal until no other matrix elements are found, and storing all matrix elements in the current traversal process as target brightness matrix elements in a target brightness matrix element set.
Further, the area of the preview image which is matched with the area occupied by the target brightness matrix element is taken as a target area. It should be understood that, in the above traversal process, each traversal will result in a target brightness matrix element set, and each target brightness matrix element set corresponds to a target area in the preview image, that is, the number of the target areas is at least one.
The following illustrates how the target luminance matrix element set is determined and how the target region is determined based on the target luminance matrix element set. Referring to fig. 5, a schematic diagram of determining a target luminance matrix element set according to an embodiment of the present invention is shown. 501 denotes a target luminance matrix including 25 matrix elements, each matrix element being determined based on a target luminance value of a target object, as can be seen from the foregoing. In the process of determining the target brightness matrix element set, the target brightness matrix is scanned line by line, and matrix elements which are not subjected to region division are found out to be used as first matrix elements traversed currently, and 51 is assumed to be the first matrix elements; checking the neighboring matrix elements around the first matrix element as the center, and if the matrix elements 52, 53, and 54 are all zero, then taking the matrix elements 52, 53, and 54 as the second matrix elements; and after combining 52, 53 and 54, continuing to traverse 51, 52, 53 and 54's neighboring matrix elements, finding that the difference between matrix element 55 and matrix element 53 in the neighboring elements of matrix element 53 is less than 1, and matrix element 56 is zero; if no other matrix element satisfying the area division condition exists in the adjacent matrix elements 51, 52, 53, and 54, the matrix elements 55 and 56 are used as the third matrix elements; further, the adjacent matrix elements of 55 and 56 are traversed; and repeating the steps, wherein the difference value between the matrix element 57 and the matrix elements 55 and 56 is less than 1, continuing to traverse to find that no matrix element meeting the area division condition exists, ending the current traverse, and storing the matrix elements 51-57 as target brightness matrix elements into a target brightness matrix element set.
After the current traversal is finished, a new first matrix element is continuously selected from the remaining matrix elements, and the traversal process is repeatedly performed until all the matrix elements in the target luminance matrix are divided into a certain target luminance matrix element set, and finally, the target luminance matrix is divided into a plurality of target luminance matrix element sets, as shown in 502 in fig. 5, each color represents one target luminance matrix element set.
After a plurality of target brightness matrix element sets are determined, the area occupied by each target brightness matrix element set is obtained, actually, the area occupied by the plurality of target brightness matrix elements in each target brightness matrix element set is obtained, and the area matched with the occupied area in the preview image is used as a target area.
And step S204, acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
In one embodiment, as shown in step S203, each target region corresponds to a set of target luminance matrix elements, and a value of each target luminance matrix element in the set of target luminance matrix elements is determined according to a target luminance value of the target object, that is, each target luminance matrix element represents a luminance value, which may be a target luminance value of the target object or zero. Based on this, in step S204, the region luminance value of the target region may be determined according to each target luminance matrix element included in the target luminance matrix element set corresponding to the target region.
In a specific implementation, the obtaining of the region brightness value of the target region includes: and performing preset elements on at least one target brightness matrix element included in the target brightness matrix element set, and taking an obtained operation result as a region brightness value of the target region. The preset operation includes an averaging operation, or the preset operation may further include a weighted averaging operation, and a specific budget is not limited in the embodiment of the present invention.
For example, in fig. 5, a target region including a subject luminance value of 1 corresponds to a set of target luminance matrix elements including 1 and 0 in the target luminance matrix, and then the region luminance value of the target region is: (1+0+1+0+0+1+0)/7 is 0.43.
In one embodiment, after the area brightness values of the target areas are determined according to the method, the shooting parameters of the image pickup device can be dynamically adjusted according to the area brightness values of the target areas. Specifically, a brightness difference between a region brightness value of each target region and a brightness threshold is determined, and a maximum brightness difference among a plurality of brightness differences is obtained; and dynamically adjusting the shooting parameters of the camera device in the direction of reducing the maximum brightness difference value to be less than or equal to the brightness difference threshold value. The brightness difference threshold may be preset, and when the brightness difference between a certain region and the brightness threshold is smaller than the brightness difference threshold, the image brightness of the region is ensured to be moderate.
In the embodiment of the invention, after the camera device captures the preview image, the adjusting device of the shooting parameters determines the target brightness matrix corresponding to the preview image based on the target brightness value of the target object in the preview image, and further acquires the target brightness matrix element set from a plurality of matrix elements included in the target brightness matrix based on the area division condition, and takes the area corresponding to the area occupied by the target brightness matrix element set in the preview image as the target area. And then dynamically adjusting shooting parameters of the camera device according to the area brightness value of the target area. The shooting parameters are adjusted through the adjusting equipment, and compared with manual adjustment of the shooting parameters, labor is saved, and accuracy of shooting parameter adjustment is improved. In addition, the shooting parameters are dynamically adjusted according to the brightness condition of the local area, so that the problem of regional over-darkness can be avoided, and the quality of the shot image can be improved.
Based on the above adjustment scheme and adjustment system for shooting parameters, the embodiment of the invention provides an adjustment method for shooting parameters. Fig. 6 is a schematic flow chart of a method for adjusting shooting parameters according to an embodiment of the present invention. The method for adjusting the shooting parameters shown in fig. 6 may be performed by an apparatus for adjusting the shooting parameters, and may specifically be performed by a processor of the apparatus for adjusting the shooting parameters, and the method for adjusting the shooting parameters shown in fig. 6 may include the following steps:
step S601, a preview image captured by the imaging device according to the first imaging parameter is acquired.
It should be understood that, for the same area, at different time periods, due to different illumination, the brightness of the image obtained by shooting the area is different. Therefore, in order to make the brightness condition in the target area in the image captured in each time period satisfy the brightness value condition, the capturing parameter adjustment time of the image capturing apparatus may be set, which may be a specific time point, such as 10 am, 3 pm, and the like, or a time period, such as once every 40 minutes from 8 am.
Based on this, the acquiring the preview image captured by the camera device according to the first shooting parameter includes: and triggering the camera device to capture the preview image according to the first shooting parameter when the current time is detected to reach the adjustment time of the shooting parameter.
Step S602, detecting whether a preset reference range exists.
In one embodiment, the reference range may be preset, and the reference range may be represented in a coordinate form or in size information. Such as a rectangle, as indicated by the reference ranges represented by coordinates (x1, y1), (x2, y2), (x3, y3), and (x4, y 4); for another example, the area indicated by the reference range is rectangular, and the reference range may be represented by size information having a length X and a width Y. It should be understood that the above is only an example that the area indicated by the reference range is rectangular, and in practical applications, the area indicated by the reference range may be any other shape, such as a circle, a pentagon, an irregular shape, and the like, as required.
In one embodiment, assume that the reference range is represented by pairs of coordinates, each pair representing an endpoint, represented by a floating point type. The actual meaning of each coordinate is the relative position of the coordinate point in the adjusting equipment of the shooting parameters, and the resolution of the camera device can be changed, and the size of the interface of the adjusting equipment of the shooting parameters for displaying the preview image is different from the actual resolution of the camera device, so that after the adjusting equipment of the shooting parameters receives the reference range set by a user, the reference range is issued to the camera device by adopting the relative position, so that the camera device acquires the preview image based on the reference range, and the preview image displayed in the adjusting equipment of the shooting parameters is ensured to be mapped with the actual scene one by one. For example, assuming that the length of the drawing canvas for displaying the preview image in the adjustment device of the shooting parameters is wdrawWidth of hdrawThe coordinate on the drawing canvas of a certain point is (x, y), and the actual resolution length of the camera device is wcamWidth of hcam. Then the relative coordinates (x) of the pointsactual,yactual) Can be calculated by equation (2):
xaCtual=x/WdraW,yaCtual=y/hdraW(2)
coordinates (x) of the point when calculated on the imaging devicerect,yrect) Can be expressed by equation (3):
xrect=xactual*Wcam,yrect=yactual*hcam(3)
when the adjusting device of the shooting parameters determines the target area, if the reference range exists, the target area is determined according to the reference range; if the reference range does not exist, it is determined according to the object brightness value of the target object. In a specific implementation, the determining the target area in the preview image includes: detecting whether a preset reference range exists or not; if the reference range exists in the preview image, taking the area indicated by the reference range in the preview image as a target area; and if the target object does not exist in the preview image, acquiring the target object included in the preview image, and determining a target area based on the object brightness value of the target object.
Step S603, if there is no preset reference range, determining a target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image.
Step S604, acquiring a target luminance matrix element set from the plurality of matrix elements based on the region division condition, and taking a region corresponding to a region occupied by the target luminance matrix element set on the preview image as a target region.
It should be understood that in different application scenes, the target object concerned by the camera device is different when shooting is performed, for example, in an application scene of an intelligent mall, when the camera device is used for shooting the inside of the mall, the target object concerned lies on a human face; in the intelligent traffic process, when the road is shot by the camera device, the target object of interest is the vehicle. In the embodiment of the present invention, it is assumed that a target object of interest when shooting is performed by an imaging device is a human face.
If the preset reference range does not exist, it indicates that the user wants to pay attention to the face appearing in the whole area that can be shot by the camera device, and due to different illumination at different positions and different environments, the brightness conditions of different areas in the preview image that can be shot by the camera device may be different. In this case, in order to ensure that the brightness condition of each region satisfies the brightness value condition, when adjusting the shooting parameters, the whole preview image needs to be divided into a plurality of target regions according to the target brightness value of the target object, so as to ensure that the region brightness value of each target region satisfies the brightness value condition, and dynamically adjust the shooting parameters of the image capturing device.
In an embodiment, before executing step S603, it may be determined whether the preview image includes the target object, and if the preview image includes the target object, then the step of determining the target luminance matrix corresponding to the preview image according to the object luminance value of the target object in the preview image is executed; if the target object is not included, it indicates that even if the shooting parameter adjustment is performed according to the current preview image at this time, it cannot be guaranteed that the brightness of the target object is good when the target object is shot under the adjusted shooting parameter next time. Therefore, in order to avoid excessive power consumption overhead, when the target object is not included in the preview image, the step of determining the target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image may not be performed.
In an embodiment, some specific implementations included in step S603 and step S604 may refer to descriptions of related steps in the embodiment of fig. 2, and are not described herein again.
And step S605, if the preset reference range exists, taking the area indicated by the reference range in the preview image as the target area.
In one embodiment, if a preset reference range exists, it indicates that a user wants to focus on a face appearing in an area indicated by the reference range, and it is necessary to ensure that the brightness of an image in the area indicated by the reference range captured by the imaging device is good, so that the area indicated by the reference range on the preview image can be used as a target area, so as to adjust the shooting parameters of the imaging device by taking the area brightness value of the target area as a target to meet the brightness value condition. Wherein, the region brightness value of the target region satisfying the brightness value condition may refer to: the area brightness value is smaller than the brightness threshold value; alternatively, the luminance difference between the region luminance value and the luminance threshold value is not greater than the luminance difference threshold value.
Optionally, if there is a reference range, an embodiment that takes an area indicated by the reference range on the preview image as a target area is as follows: determining a region indicated by a reference range, such as a rectangle in which the reference range is represented by coordinate information; and finding a rectangular area corresponding to the coordinate information in the preview image as a target area.
And step S606, acquiring a region brightness value of the target region, and dynamically adjusting the shooting parameters of the camera device based on the region brightness value to obtain second shooting parameters.
In an embodiment, if the target area is determined in step S603 and step S604, the obtaining of the area brightness value of the target area and the dynamic adjustment of the shooting parameters of the image capturing apparatus based on the area brightness value may refer to the description of the relevant steps in the embodiment of fig. 2, and will not be described herein again. In the embodiment of the present invention, some embodiments included in step S606 are described in detail in the case where the target area is determined based on the reference range.
In one embodiment, if the target region is determined by step S605, the acquiring the region brightness value of the target region may include: detecting whether the target area comprises a target object; and if the target area comprises the target object, determining an object brightness value of the target object, performing preset operation on the object brightness value of the target object, and taking an obtained operation result as an area brightness value of the target area.
It should be understood that the preset reference range indicates that the user wants to focus on the target object appearing in the region indicated by the reference range, and therefore, the shooting parameters of the camera device need to be adjusted based on the brightness condition of the target region. However, if it is detected that the target area does not include the target object, the dynamic adjustment of the shooting parameters of the camera device is continued according to the brightness condition of the target area, and it cannot be guaranteed that the brightness condition of the target object in the target area in the image is good when the image is acquired based on the adjusted shooting parameters. Based on this, in order to save the power consumption overhead of the adjusting device of the shooting parameters, when the target area is detected not to include the target object, the subsequent steps of acquiring the area brightness value and dynamically adjusting the shooting parameters of the camera device based on the area brightness value may not be executed; only when the target area is detected to include the target object, the relevant operation is performed again.
Optionally, the implementation of determining the object brightness value of the target object may be implemented by the description of the related content and the related formula (1) in the embodiment of fig. 2, and details are not repeated here.
In one embodiment, if the target area is determined based on the reference range, the dynamically adjusting the shooting parameters of the image capturing device based on the area brightness value to obtain second shooting parameters includes: and dynamically adjusting the second parameter of the camera device according to the direction of adjusting the region brightness value to meet the brightness value condition to obtain a second shooting parameter.
In other embodiments, if it is detected that the target area does not include the target object, the object brightness value of the target object is not obtained, and further, the area brightness value of the area is not obtained, and then the shooting parameters may be adjusted in the following manner. Specifically, the method comprises the following steps: acquiring a plurality of historical preview images captured by a camera device in a historical preset time period; and if the target history preview image does not exist in the plurality of history preview images, adjusting the shooting parameters of the camera to the initial shooting parameters.
In one embodiment, it should be understood that, in some time periods in some scenes, the target object appears less frequently, which may result in the target area of the acquired preview image not including the target object, for example, the target object is a human face, and the frequency of the human face appears less frequently during a low peak period of the stream of people in the mall or when the mall is closed at night. In this case, the shooting parameters adjusted last time may be maintained for a period of time, and if the target object is not detected beyond the period of time, the shooting parameters of the image capturing apparatus may be restored to the default shooting parameters, that is, the initial shooting parameters. Therefore, under the condition that the target area on the preview image is determined based on the reference range, whether the target area comprises the target object or not is achieved, the shooting parameters are dynamically adjusted by adopting different shooting parameter adjustment schemes, and the accuracy of shooting parameter adjustment is improved.
In one embodiment, the target history preview image refers to a history preview image of a target object in a target area of a plurality of history preview images, the history time period may be preset by an adjusting device of the shooting parameter, and the history time period may be set according to an environment where the camera is located, for example, in a shopping mall, the history time period may be set to be 30 minutes. In the history preview images acquired in the history period, if there is no target history preview image, it indicates that the image of which the target area includes the target object is not detected by the photographing parameter adjusting apparatus within the past 30 minutes, and at this time, the photographing parameters of the image pickup device may be adjusted to the initial photographing parameters.
In the embodiment of the invention, after the camera device captures the preview image, the adjusting equipment of the shooting parameters detects whether a reference range exists; and if the target brightness matrix exists, determining a target area in the preview image based on the reference range, if the target brightness matrix does not exist, determining a target brightness matrix corresponding to the preview image based on the target brightness value of the target object, further, selecting a target brightness matrix element set from a plurality of matrix elements included in the target brightness matrix based on the area dividing condition, and taking an area corresponding to the area occupied by the target brightness matrix element in the preview image as the target area. Then, acquiring a region brightness value of the target region, and dynamically adjusting shooting parameters of the camera device based on the region brightness value; compared with the manual adjustment of the camera device, the adjustment of the shooting parameters by the adjusting device of the shooting parameters realizes more accurate adjustment. And aiming at the brightness condition of the local area, the shooting parameters of the camera device are dynamically adjusted, so that the problem that the local area in the captured image is too dark can be avoided, and the overall quality of the captured image of the camera device can be improved.
Based on the above-mentioned shooting parameter adjustment method, an embodiment of an application scenario is provided in the embodiment of the present invention, an application scenario diagram provided in the embodiment of the present invention is provided with reference to fig. 7, an interaction diagram of a shooting parameter adjustment method provided in the embodiment of the present invention is provided with reference to fig. 8, and an application scenario of the shooting parameter adjustment method is described below with reference to fig. 7 and 8.
In fig. 7, it is assumed that the method for adjusting the shooting parameters is applied to an intelligent mall, the target object is a human face, the camera device includes a camera 701 in the mall, and a manager in the mall sets a reference range in advance. The camera 701 is connected with the adjusting device 702 for shooting parameters used by the administrator, and the market pictures collected by the camera 701 can be transmitted to the adjusting device 702 for shooting parameters, so that the administrator can view the pictures.
In one embodiment, referring to fig. 8, a smart page in which an administrator can input a set reference range may be displayed in the adjusting apparatus 702 of the photographing parameter; then, the configuration service of the adjustment device 702 for the shooting parameters configures the reference range, and issues the reference range to the camera 701, so that the camera 701 starts a face snapshot service to acquire an image based on the reference range.
Further, if the target area in the acquired preview image is empty, the face snapshot service continues to capture the face; if the target area in the acquired preview image includes a face, filtering out a face image in a non-target area in the preview image, sending the face image in the target area to the shooting parameter adjusting device 702, and starting a dynamic adjusting service by the shooting parameter adjusting device 702 to dynamically adjust the shooting parameters of the camera device.
And after the adjustment is finished, returning the adjusted shooting parameters to the camera device. Optionally, if the target area does not include a face, the shooting parameters may be maintained for 30 minutes according to the last shooting parameters, and if an image of the target area including the face is not acquired by more than 30 minutes, the shooting parameters of the camera device are adjusted to default values.
Therefore, the shooting parameters of the camera device can be dynamically adjusted through the shooting parameter adjusting equipment, and the problems that human resources are wasted, accuracy is low and continuous adjustment cannot be carried out due to manual adjustment of the camera device in the prior art are solved. The shooting parameter adjusting method can be used for dynamically adjusting the shooting parameters of the camera device based on the brightness value of the designated area in a targeted manner, and solves the problem that the regional darkness cannot be solved in the prior art, so that the quality of the acquired image can be improved.
Based on the foregoing method for adjusting shooting parameters, an embodiment of the present invention further provides an apparatus for adjusting shooting parameters, and referring to fig. 9, a schematic structural diagram of the apparatus for adjusting shooting parameters provided in the embodiment of the present invention is shown. The adjustment device for shooting parameters shown in fig. 9 may operate as follows:
an acquisition unit 901 configured to acquire a preview image of an imaging apparatus;
a determining unit 902, configured to determine, according to an object brightness value of a target object in the preview image, a target brightness matrix corresponding to the preview image, where the target brightness matrix includes a plurality of matrix elements;
the obtaining unit 901 is further configured to obtain a target luminance matrix element set from a plurality of matrix elements based on a region division condition, where the region division condition is that at least one matrix element of any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is less than a threshold;
a processing unit 903, configured to use an area on the preview image corresponding to an area occupied by the target luminance matrix element set as a target area;
the acquiring unit 901 is further configured to acquire a region brightness value of the target region;
the processing unit 903 is further configured to dynamically adjust the shooting parameters of the image capturing apparatus based on the area brightness values.
In one embodiment, when the image pickup device captures the preview image, the shooting parameters of the image pickup device are first shooting parameters; after the shooting parameters of the camera device are dynamically adjusted based on the region brightness value, the shooting parameters of the camera device are second shooting parameters; when capturing an image based on the second shooting parameter by the image capturing device, the brightness value of the target area in the captured image satisfies a brightness value condition.
In one embodiment, when determining the target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image, the determining unit 902 performs the following operations: detecting whether a preset reference range exists or not; if the reference range exists in the preview image, taking the area indicated by the reference range in the preview image as a target area; and if the target brightness matrix does not exist, determining the target brightness matrix corresponding to the preview image according to the target brightness value of the target object in the preview image.
In one embodiment, when determining the target brightness matrix corresponding to the preview image according to the object brightness value of each target object, the determining unit 902 performs the following operations:
acquiring position information of each target object on the preview image;
acquiring an initial brightness matrix matched with the preview image based on the resolution of the camera device; determining a matching position matched with the position information of any one target object in each target object in the initial brightness matrix, and storing the object brightness value of any one target object as a matrix element at the matching position to obtain a target brightness matrix; in the target brightness matrix, the matrix elements at a plurality of matching positions matched with the position information of the same target object are the same, and the matrix elements at other positions not matched with the position information of any one target object are zero.
In one embodiment, the obtaining unit 901 performs the following operations when obtaining a target luminance matrix element set from the plurality of matrix elements based on the region division condition:
selecting matrix elements which are not traversed from a plurality of matrix elements included in the target brightness matrix as first matrix elements traversed currently;
traversing adjacent matrix elements of the first matrix element, and determining whether a second matrix element exists, so that the area division condition is satisfied between the first matrix element and the second matrix element, where the condition that the first matrix element and the second matrix element satisfy the area division condition means that at least one of the second matrix element and the first matrix element is zero; or the difference between the second matrix element and the first matrix element is less than a threshold;
if so, continuously traversing whether a third matrix element exists or not so as to enable the area division condition to be met between the first matrix element and the third matrix element; or the area division condition is satisfied between the second matrix element and the third matrix element; if not, ending the current traversal, and storing the first matrix element into a target brightness matrix element set.
In one embodiment, the apparatus for adjusting the shooting parameter further includes a detecting unit 904, where the detecting unit 904 is configured to detect whether a target object is included in the preview image; when the detection unit 904 detects that the preview image includes the target object, the determination unit 902 performs a step of determining a target brightness matrix corresponding to the preview image according to a target brightness value of the target object in the preview image.
In one embodiment, the target region is a region indicated by the reference range in the preview image, and the obtaining unit 901 performs the following steps when obtaining a region brightness value of the target region: detecting whether the target area comprises the target object; if the target area comprises the target object, determining an object brightness value of the target object; and performing preset operation on the object brightness value of the target object, and taking the obtained operation result as the area brightness value of the target area.
In one embodiment, the obtaining unit 901 performs the following operations when obtaining the region brightness value of the target region: and performing preset operation on at least one target brightness matrix element included in the target brightness matrix element set, and taking an obtained operation result as a region brightness value of the target region.
In an embodiment, the target area is an area indicated by the reference range in the preview image, and the obtaining unit 901 is further configured to obtain a plurality of target images acquired by the image capturing apparatus based on a second shooting parameter within a preset time; the processing unit 903 is further configured to adjust the shooting parameters of the image capturing apparatus to initial shooting parameters if a target history preview image does not exist in the plurality of history preview images, where the target object is included in a target area in the target history preview image.
In one embodiment, the number of the target areas is at least one, and the processing unit 903 performs the following operations when dynamically adjusting the shooting parameters of the image capturing apparatus based on the area brightness values: acquiring a brightness difference value between the area brightness value of each target area and a brightness threshold value, and acquiring the maximum brightness difference value in a plurality of brightness difference values; and dynamically adjusting the shooting parameters of the camera device according to the direction of reducing the maximum brightness difference value to be less than or equal to the brightness difference threshold value.
According to an embodiment of the present invention, the steps involved in the method for adjusting shooting parameters shown in fig. 2 and 6 may be performed by units in the device for adjusting shooting parameters shown in fig. 9. For example, steps S201 and S204 described in fig. 2 may be performed by the acquisition unit 901 of the adjusting apparatus of the shooting parameters described in fig. 9, step S202 may be performed by the determination unit 902 of the adjusting apparatus of the shooting parameters described in fig. 9, and steps S203 and S204 may be performed by the processing unit of the adjusting apparatus of the shooting parameters described in fig. 9; as another example, step S601, step S604, and step S606 in the method for adjusting shooting parameters shown in fig. 6 may be performed by the acquisition unit 901 in the adjusting apparatus for shooting parameters shown in fig. 9, step S602 may be performed by the detection unit 904 in the adjusting apparatus for shooting parameters shown in fig. 9, and step S603 may be performed by the determination unit 902 in the adjusting apparatus for shooting parameters shown in fig. 9; steps S605 and S604 can be executed by the processing unit 903 in the apparatus for adjusting shooting parameters described in fig. 9.
According to another embodiment of the present invention, the units in the device for adjusting shooting parameters shown in fig. 9 may be respectively or entirely combined into one or several other units to form the unit, or some unit(s) thereof may be further split into multiple units with smaller functions to form the unit(s), which may achieve the same operation without affecting the achievement of the technical effect of the embodiment of the present invention. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present invention, the adjusting device based on the shooting parameters may also include other units, and in practical applications, these functions may also be implemented by the assistance of other units, and may be implemented by cooperation of multiple units.
According to another embodiment of the present invention, the adjusting apparatus of the photographing parameters as shown in fig. 9 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods as shown in fig. 2 and fig. 6 on a general-purpose computing device such as a computer including a processing element and a storage element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like, and the adjusting method of the photographing parameters of the embodiment of the present invention may be implemented. The computer program may be embodied on a computer-readable storage medium, for example, and loaded into and executed by the above-described computing apparatus via the computer-readable storage medium.
In the embodiment of the invention, after the camera device captures the preview image, the adjusting device of the shooting parameters determines the target brightness matrix corresponding to the preview image based on the target brightness value of the target object in the preview image, and further acquires the target brightness matrix element set from a plurality of matrix elements included in the target brightness matrix based on the area division condition, and takes the area corresponding to the area occupied by the target brightness matrix element set in the preview image as the target area. Further, an area brightness value of the target area is obtained, and the shooting parameters of the camera device are dynamically adjusted based on the area brightness value. The shooting parameters are adjusted through the adjusting equipment, and compared with manual adjustment of the shooting parameters, labor is saved, and accuracy of shooting parameter adjustment is improved. In addition, the shooting parameters are dynamically adjusted according to the brightness condition of the local area, so that the problem of regional over-darkness can be avoided, and the quality of the shot image can be improved.
Based on the above method embodiment and device embodiment, an embodiment of the present invention further provides an adjusting apparatus for shooting parameters, and referring to fig. 10, a schematic structural diagram of the adjusting apparatus for shooting parameters provided in the embodiment of the present invention is shown. The adjusting apparatus of the photographing parameters shown in fig. 10 may include at least a processor 1001, an input interface 1002, an output interface 1003, and a computer storage medium 1004. The processor 1001, the input interface 1002, the output interface 1003, and the computer storage medium 1004 may be connected by a bus or other means.
A computer storage medium 1004 may be stored in the memory of the node device, the computer storage medium 1204 being used for storing a computer program comprising program instructions, the processor 1001 being used for executing the program instructions stored by the computer storage medium 1004. The processor 1001 (or CPU) is a computing core and a control core of the shooting parameter adjusting apparatus, and is adapted to implement one or more instructions, and specifically, adapted to load and execute the one or more instructions so as to implement a corresponding method flow or a corresponding function. In one embodiment, the processor 1001 according to an embodiment of the present invention may be configured to perform: acquiring a preview image of a camera device; determining a target brightness matrix corresponding to the preview image based on an object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements; acquiring a target brightness matrix element set from a plurality of matrix elements based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set on a preview image as a target region, wherein the region division condition means that at least one matrix element in any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is smaller than a threshold value; and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
The embodiment of the invention also provides a computer storage medium (Memory), which is a Memory device in the session management device and is used for storing programs and data. It is understood that the computer storage medium herein may include a built-in storage medium in the adjusting device of the shooting parameters, and may of course include an extended storage medium supported by the adjusting device of the shooting parameters. The computer storage medium provides a storage space that stores an operating system of the adjusting apparatus of the shooting parameters. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 1001. The computer storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by the processor 1001 to implement the corresponding steps of the method in the embodiment of the method for adjusting shooting parameters shown in fig. 2 and 6, and in particular, one or more instructions stored in the computer storage medium may be loaded and executed by the processor 1001 to implement the following steps: acquiring a preview image of a camera device; determining a target brightness matrix corresponding to the preview image according to the object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements; acquiring a target brightness matrix element set from the matrix elements based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set on the preview image as a target region, wherein the region division condition means that at least one matrix element in any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is smaller than a threshold value; and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
In one embodiment, when the image pickup device captures the preview image, the shooting parameters of the image pickup device are first shooting parameters; after the shooting parameters of the camera device are dynamically adjusted based on the region brightness value, the shooting parameters of the camera device are second shooting parameters; when an image is captured based on the second shooting parameter by the image capturing device, the brightness value of the target area in the captured image satisfies a brightness value condition.
In one embodiment, when determining the target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image, the processor 1001 performs the following steps: detecting whether a preset reference range exists or not; if the reference range exists in the preview image, taking the area indicated by the reference range in the preview image as a target area; and if the target brightness matrix does not exist, determining the target brightness matrix corresponding to the preview image according to the target brightness value of the target object in the preview image.
In one embodiment, the number of the target objects is at least one, and the processor 1001 performs the following steps when determining a target brightness matrix corresponding to the preview image according to the object brightness values of the target objects:
acquiring position information of each target object on the preview image
Acquiring an initial brightness matrix matched with the preview image based on the resolution of the camera device; determining a matching position matched with the position information of any one target object in each target object in the initial brightness matrix, and storing the object brightness value of any one target object as a matrix element at the matching position to obtain a target brightness matrix;
in the target brightness matrix, the matrix elements at a plurality of matching positions matched with the position information of the same target object are the same, and the matrix elements at other positions not matched with the position information of any one target object are zero.
In one embodiment, the processor 1001, when obtaining a target luminance matrix element set from the plurality of matrix elements based on the region division condition, performs the steps of:
selecting matrix elements which are not traversed from a plurality of matrix elements included in the target brightness matrix as first matrix elements traversed currently;
traversing adjacent matrix elements of the first matrix element, and determining whether a second matrix element exists, so that the area division condition is satisfied between the first matrix element and the second matrix element, where the condition that the first matrix element and the second matrix element satisfy the area division condition means that at least one of the second matrix element and the first matrix element is zero; or the difference between the second matrix element and the first matrix element is less than a threshold;
if so, continuously traversing whether a third matrix element exists or not so as to enable the area division condition to be met between the first matrix element and the third matrix element; or the area division condition is satisfied between the second matrix element and the third matrix element;
if not, ending the current traversal, and storing the first matrix element as a target brightness matrix element into the target brightness matrix element set.
In one embodiment, before determining the target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image, the processor 1001 is further configured to: detecting whether a target object is included in the preview image; and if the preview image comprises the target object, determining a target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image.
In one embodiment, the target area is an area indicated by the reference range in the preview image, and the processor 1001, when acquiring an area brightness value of the target area, performs the following operations: detecting whether the target area comprises the target object; if the target area comprises the target object, determining an object brightness value of the target object; and performing preset operation on the object brightness value of the target object, and taking the obtained operation result as the area brightness value of the target area.
In one embodiment, the processor 1001, when acquiring the region brightness value of the target region, performs the following operations: and performing preset operation on at least one target brightness matrix element included in the target brightness matrix element set, and taking an obtained operation result as a region brightness value of the target region.
In one embodiment, the processor 1001 is further configured to: if the target area does not comprise the target object, acquiring a plurality of historical preview images captured by the camera device within a historical preset time period; and if the target history preview image does not exist in the plurality of history preview images, adjusting the shooting parameters of the camera to initial shooting parameters, wherein the target object is included in a target area in the target history preview image.
In one embodiment, the number of the target areas is at least one, and the processor 1001 performs the following steps when dynamically adjusting the shooting parameters of the image capturing apparatus based on the area brightness values: determining a brightness difference value between the area brightness value of each target area and a brightness threshold value, and acquiring the maximum brightness difference value in a plurality of brightness difference values; and dynamically adjusting the shooting parameters of the camera device according to the direction of reducing the maximum brightness difference value to be less than or equal to the brightness difference threshold value.
In the embodiment of the invention, after the camera device captures the preview image, the adjusting device of the shooting parameters determines the target brightness matrix corresponding to the preview image based on the target brightness value of the target object in the preview image, and further acquires the target brightness matrix element set from a plurality of matrix elements included in the target brightness matrix based on the area division condition, and takes the area corresponding to the area occupied by the target brightness matrix element set in the preview image as the target area. Further, an area brightness value of the target area is obtained, and the shooting parameters of the camera device are dynamically adjusted based on the area brightness value. The shooting parameters are adjusted through the adjusting equipment, and compared with manual adjustment of the shooting parameters, labor is saved, and accuracy of shooting parameter adjustment is improved. In addition, the shooting parameters are dynamically adjusted according to the brightness condition of the local area, so that the problem of regional over-darkness can be avoided, and the quality of the shot image can be improved.
The above disclosure is intended to be illustrative of only some embodiments of the invention, and is not intended to limit the scope of the invention.

Claims (13)

1. A method for adjusting shooting parameters is characterized by comprising the following steps:
acquiring a preview image of a camera device;
determining a target brightness matrix corresponding to the preview image according to an object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements;
acquiring a target brightness matrix element set from the matrix elements based on a region division condition, and taking a region corresponding to a region occupied by the target brightness matrix element set on the preview image as a target region, wherein the region division condition means that at least one matrix element in any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is smaller than a threshold value;
and acquiring the area brightness value of the target area, and dynamically adjusting the shooting parameters of the camera device based on the area brightness value.
2. The method according to claim 1, wherein when the camera device captures the preview image, the shooting parameter of the camera device is a first shooting parameter; after the shooting parameters of the camera device are dynamically adjusted based on the region brightness value, the shooting parameters of the camera device are second shooting parameters; when an image is captured based on the second shooting parameter by the image capturing device, the brightness value of the target area in the captured image satisfies a brightness value condition.
3. The method of claim 1, wherein determining the target brightness matrix corresponding to the preview image according to the object brightness values of the target objects in the preview image comprises:
detecting whether a preset reference range exists or not;
if the reference range exists in the preview image, taking the area indicated by the reference range in the preview image as a target area;
and if the target brightness matrix does not exist, determining the target brightness matrix corresponding to the preview image according to the target brightness value of the target object in the preview image.
4. The method of claim 1, wherein the number of the target objects is at least one, and the determining the target brightness matrix corresponding to the preview image according to the object brightness values of the target objects comprises:
acquiring position information of each target object on the preview image;
acquiring an initial brightness matrix matched with the preview image based on the resolution of the camera device;
determining a matching position matched with the position information of any one target object in each target object in the initial brightness matrix, and storing the object brightness value of any one target object as a matrix element at the matching position to obtain a target brightness matrix;
in the target brightness matrix, the matrix elements at a plurality of matching positions matched with the position information of the same target object are the same, and the matrix elements at other positions not matched with the position information of any one target object are zero.
5. The method of claim 1, wherein the obtaining a target set of luminance matrix elements from the plurality of matrix elements based on a region partition condition comprises:
selecting matrix elements which are not traversed from a plurality of matrix elements included in the target brightness matrix as first matrix elements traversed currently;
traversing adjacent matrix elements of the first matrix element, and determining whether a second matrix element exists, so that the area division condition is satisfied between the first matrix element and the second matrix element, where the condition that the first matrix element and the second matrix element satisfy the area division condition means that at least one of the second matrix element and the first matrix element is zero; or the difference between the second matrix element and the first matrix element is less than a threshold;
if so, continuously traversing whether a third matrix element exists or not so as to enable the area division condition to be met between the first matrix element and the third matrix element; or the area division condition is satisfied between the second matrix element and the third matrix element;
if not, ending the current traversal, and storing the first matrix element as a target brightness matrix element into the target brightness matrix element set.
6. The method of claim 1, wherein prior to determining the target brightness matrix corresponding to the preview image based on the object brightness values of the target objects in the preview image, the method further comprises:
detecting whether a target object is included in the preview image;
and if the preview image comprises the target object, executing the step of determining a target brightness matrix corresponding to the preview image according to the object brightness value of the target object in the preview image.
7. The method of claim 3, wherein the target area is an area indicated by the reference range in the preview image, and the obtaining of the area brightness value of the target area comprises:
detecting whether the target area comprises the target object;
if the target area comprises the target object, determining an object brightness value of the target object;
and performing preset operation on the object brightness value of the target object, and taking the obtained operation result as the area brightness value of the target area.
8. The method of claim 1, wherein said obtaining a region brightness value for the target region comprises:
and performing preset operation on at least one target brightness matrix element included in the target brightness matrix element set, and taking an obtained operation result as a region brightness value of the target region.
9. The method of claim 7, further comprising:
if the target area does not comprise the target object, acquiring a plurality of historical preview images captured by the camera device within a historical preset time period;
and if the target history preview image does not exist in the plurality of history preview images, adjusting the shooting parameters of the camera to initial shooting parameters, wherein the target object is included in a target area in the target history preview image.
10. The method according to claim 2, wherein the number of the target areas is at least one, and the dynamically adjusting the shooting parameters of the image pickup apparatus based on the area brightness values comprises:
determining a brightness difference value between the area brightness value of each target area and a brightness threshold value, and acquiring the maximum brightness difference value in a plurality of brightness difference values;
and dynamically adjusting the shooting parameters of the camera device according to the direction of reducing the maximum brightness difference value to be less than or equal to the brightness difference threshold value.
11. An apparatus for adjusting a photographing parameter, comprising:
an acquisition unit configured to acquire a preview image of an image pickup apparatus;
the determining unit is used for determining a target brightness matrix corresponding to the preview image according to the object brightness value of a target object in the preview image, wherein the target brightness matrix comprises a plurality of matrix elements;
the obtaining unit is further configured to obtain a target luminance matrix element set from the plurality of matrix elements based on a region division condition, where the region division condition is that at least one matrix element of any two adjacent matrix elements is zero; or the difference between any two adjacent matrix elements is smaller than a threshold value;
the processing unit is used for taking an area corresponding to the area occupied by the target brightness matrix element set on the preview image as a target area;
the acquisition unit is further used for acquiring a region brightness value of the target region;
and the processing unit is also used for dynamically adjusting the shooting parameters of the camera device based on the region brightness value.
12. An apparatus for adjusting shooting parameters, comprising:
a processor adapted to implement one or more instructions; and
computer storage medium storing one or more instructions adapted to be loaded by the processor and to perform the method of adjusting shooting parameters according to any of claims 1-10.
13. A computer storage medium, characterized in that the computer storage medium has stored therein first computer program instructions for executing the method of adjusting shooting parameters according to any one of claims 1-10 when executed by a processor.
CN202010465278.1A 2020-05-27 2020-05-27 Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium Active CN111629146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010465278.1A CN111629146B (en) 2020-05-27 2020-05-27 Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010465278.1A CN111629146B (en) 2020-05-27 2020-05-27 Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111629146A true CN111629146A (en) 2020-09-04
CN111629146B CN111629146B (en) 2021-08-24

Family

ID=72272652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010465278.1A Active CN111629146B (en) 2020-05-27 2020-05-27 Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111629146B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113592800A (en) * 2021-07-22 2021-11-02 梅卡曼德(北京)机器人科技有限公司 Image scanning method and device based on dynamic scanning parameters
WO2023122906A1 (en) * 2021-12-27 2023-07-06 深圳传音控股股份有限公司 Image processing method, intelligent terminal and storage medium
CN116735999A (en) * 2023-05-12 2023-09-12 浙江科正电子信息产品检验有限公司 Intelligent monitoring method for EMC test of vehicle-mounted domain control product
CN116824116A (en) * 2023-06-26 2023-09-29 爱尔眼科医院集团股份有限公司 Super wide angle fundus image identification method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304489A (en) * 2008-06-20 2008-11-12 北京中星微电子有限公司 Automatic exposure method and apparatus
US20110298886A1 (en) * 2010-06-06 2011-12-08 Apple, Inc. Auto Exposure Techniques for Variable Lighting Conditions
CN106484257A (en) * 2016-09-22 2017-03-08 广东欧珀移动通信有限公司 Camera control method, device and electronic equipment
CN107566752A (en) * 2017-10-31 2018-01-09 努比亚技术有限公司 A kind of image pickup method, terminal and computer-readable storage medium
CN109547701A (en) * 2019-01-04 2019-03-29 Oppo广东移动通信有限公司 Image capturing method, device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304489A (en) * 2008-06-20 2008-11-12 北京中星微电子有限公司 Automatic exposure method and apparatus
US20110298886A1 (en) * 2010-06-06 2011-12-08 Apple, Inc. Auto Exposure Techniques for Variable Lighting Conditions
CN106484257A (en) * 2016-09-22 2017-03-08 广东欧珀移动通信有限公司 Camera control method, device and electronic equipment
CN107566752A (en) * 2017-10-31 2018-01-09 努比亚技术有限公司 A kind of image pickup method, terminal and computer-readable storage medium
CN109547701A (en) * 2019-01-04 2019-03-29 Oppo广东移动通信有限公司 Image capturing method, device, storage medium and electronic equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113592800A (en) * 2021-07-22 2021-11-02 梅卡曼德(北京)机器人科技有限公司 Image scanning method and device based on dynamic scanning parameters
WO2023122906A1 (en) * 2021-12-27 2023-07-06 深圳传音控股股份有限公司 Image processing method, intelligent terminal and storage medium
CN116735999A (en) * 2023-05-12 2023-09-12 浙江科正电子信息产品检验有限公司 Intelligent monitoring method for EMC test of vehicle-mounted domain control product
CN116824116A (en) * 2023-06-26 2023-09-29 爱尔眼科医院集团股份有限公司 Super wide angle fundus image identification method, device, equipment and storage medium
CN116824116B (en) * 2023-06-26 2024-07-26 爱尔眼科医院集团股份有限公司 Super wide angle fundus image identification method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111629146B (en) 2021-08-24

Similar Documents

Publication Publication Date Title
CN111629146B (en) Shooting parameter adjusting method, shooting parameter adjusting device, shooting parameter adjusting equipment and storage medium
US9451173B2 (en) Electronic device and control method of the same
CN109167931B (en) Image processing method, device, storage medium and mobile terminal
CN111028189A (en) Image processing method, image processing device, storage medium and electronic equipment
WO2019071613A1 (en) Image processing method and device
CN108898567A (en) Image denoising method, apparatus and system
WO2018223394A1 (en) Method and apparatus for photographing image
CN109040523B (en) Artifact eliminating method and device, storage medium and terminal
CN108320270B (en) Image correction method, device and storage medium
CN109639896A (en) Block object detecting method, device, storage medium and mobile terminal
US10121093B2 (en) System and method for background subtraction in video content
US11184570B2 (en) Method controlling image sensor parameters
CN111028276A (en) Image alignment method and device, storage medium and electronic equipment
CN110300268A (en) Camera switching method and equipment
WO2021139764A1 (en) Method and device for image processing, electronic device, and storage medium
Choi et al. A method for fast multi-exposure image fusion
WO2022105277A1 (en) Projection control method and apparatus, projection optical machine, and readable storage medium
CN112437237B (en) Shooting method and device
CN109672829B (en) Image brightness adjusting method and device, storage medium and terminal
CN116168045B (en) Method and system for dividing sweeping lens, storage medium and electronic equipment
US12035033B2 (en) DNN assisted object detection and image optimization
CN112565595B (en) Image jitter eliminating method, device, electronic equipment and storage medium
CN114764821A (en) Moving object detection method, moving object detection device, electronic apparatus, and storage medium
CN113313841A (en) AR method and device based on cloud storage service, electronic equipment and storage medium
CN112085002A (en) Portrait segmentation method, portrait segmentation device, storage medium and electronic equipment

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40028564

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant