[go: up one dir, main page]

WO2022151813A1 - Electronic device, front image signal processor, and image processing method - Google Patents

Electronic device, front image signal processor, and image processing method Download PDF

Info

Publication number
WO2022151813A1
WO2022151813A1 PCT/CN2021/128536 CN2021128536W WO2022151813A1 WO 2022151813 A1 WO2022151813 A1 WO 2022151813A1 CN 2021128536 W CN2021128536 W CN 2021128536W WO 2022151813 A1 WO2022151813 A1 WO 2022151813A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
color
image
color shift
scene
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.)
Ceased
Application number
PCT/CN2021/128536
Other languages
French (fr)
Chinese (zh)
Inventor
吴义孝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of WO2022151813A1 publication Critical patent/WO2022151813A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/57Mechanical or electrical details of cameras or camera modules specially adapted for being embedded in other devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the present application relates to the technical field of image processing, and in particular, to an electronic device, a front-end image signal processor, and an image processing method.
  • Embodiments of the present application provide an electronic device, a front image signal processor, and an image processing method, which can improve the color reproduction capability of the electronic device.
  • an embodiment of the present application provides an electronic device, including: a camera for collecting a scene image of a shooting scene; a front image signal processor for recognizing objects existing in the shooting scene according to the scene image ; an application processor for performing white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, according to The color shift performs color restoration processing on the corrected image to obtain a restored image.
  • an embodiment of the present application further provides a front image signal processor, including: a data interface for acquiring a scene image of a shooting scene from a camera; and transmitting the scene image to an application processor for white balance correction , and receive the corrected image returned after the application processor performs white balance correction; a neural network processing unit is used to identify the scene image through an object recognition model, so as to identify the object existing in the shooting scene; image A signal processing unit, configured to perform color restoration processing on the corrected image according to the color shift when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object to obtain a restoration image.
  • the embodiments of the present application further provide an image processing method, which acquires a scene image of a shooting scene; performs white balance correction on the scene image to obtain a corrected image; and identifies images existing in the shooting scene according to the scene image object; when the color vector of the object in the corrected image has a color deviation from the pre-assigned color vector of the object, perform color restoration processing on the corrected image according to the color deviation to obtain a restored image.
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 2 is an example diagram of an object existing in a scene image being recognized and obtained according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a refined structure of the front image signal processor in FIG. 1 .
  • FIG. 4 is an example diagram of sampling pixel points determined in an embodiment of the present application.
  • 5 is a schematic diagram of the corresponding relationship between the color shift direction and the preset similarity, which is associated with the pre-assigned color vector in the embodiment of the application.
  • FIG. 6 is an example diagram of a color shift vector calculated in an embodiment of the present application.
  • FIG. 7 is an example diagram of interpolation processing in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a pre-image signal processor provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • This embodiment provides an electronic device, the electronic device includes:
  • a camera used to collect scene images of the shooting scene
  • a front image signal processor configured to identify objects existing in the shooting scene according to the scene image
  • An application processor configured to perform white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, according to the The color cast performs color restoration processing on the corrected image to obtain a restored image.
  • the pre-image signal processor is configured to perform state statistics on the scene image to obtain state information required by the application processor to perform white balance correction; and perform optimization processing on the scene image, Get the optimized scene image;
  • the application processor is configured to perform white balance correction on the optimized scene image according to the state information to obtain the corrected image.
  • the pre-image signal processor includes:
  • an image signal processing unit configured to perform state statistics on the scene image to obtain the state information; and perform a first optimization process on the scene image;
  • a neural network processing unit for performing a second optimization process on the scene image after the first optimization process; and performing object recognition on the scene image after the second optimization process through an object recognition model, so as to identify the shooting scene objects that exist in .
  • the application processor is configured to determine a sampling pixel point for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixel point as the the color vector of the object; and calculating the vector difference between the color vector and the pre-assigned color vector, and determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference.
  • the application processor is configured to determine a difference threshold based on the color shift direction of the color vector and the pre-assigned color vector, and determine the difference between the color vector and the color vector based on the difference threshold and the vector difference. Whether there is a color cast in the pre-assigned color vector.
  • the application processor is configured to calculate a difference vector between the color vector and the pre-assigned color vector, and use the difference vector as a color shift vector of the sampled pixel point; and according to the Perform interpolation processing on the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image; A restoration process is performed to obtain the restored image.
  • the application processor is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel point, to obtain a plurality of candidate color shift vectors of the non-sampled pixel point; and According to the plurality of candidate color shift vectors, the color shift vectors of the non-sampled pixels are obtained.
  • the application processor is configured to calculate the average value of components of the plurality of candidate color shift vectors in each dimension, and obtain the color shift of the non-sampling pixel point according to the average value of each dimension component amount;
  • Weighted summation is performed on components of the plurality of candidate color shift vectors in each dimension, and the color shift vector of the non-sampled pixel point is obtained according to the weighted sum value of each dimension component.
  • the application processor is configured to obtain the recognition confidence level corresponding to the object, and perform correction processing on the color shift vector of the sampling pixel point according to the recognition confidence level, so as to obtain the correction of the sampling pixel point and performing interpolation processing according to the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.
  • FIG. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application.
  • the electronic device 100 includes a camera 110, a front image signal processor 120 and an application processor 130, wherein,
  • a camera 110 used for collecting scene images of the shooting scene
  • the front image signal processor 120 is used for identifying objects existing in the shooting scene according to the scene image;
  • the application processor 130 is configured to perform white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the aforementioned object in the corrected image and the pre-assigned color vector of the aforementioned object, perform a color shift on the corrected image according to the color shift. Color restoration processing to obtain restored images.
  • the entity presentation form of the electronic device is not specifically limited, and the entity presentation form of the electronic device may be a mobile electronic device such as a smartphone, a tablet computer, a palmtop computer, and a notebook computer, or may be a mobile electronic device.
  • the electronic device at least includes the camera 110 , the front image signal processor 120 and the application processor 130 .
  • the camera 110 is composed of multiple parts, mainly including a lens, a motor, and an image sensor.
  • the lens is used to project the external light signal to the image sensor;
  • the image sensor is used to photoelectrically convert the light signal projected by the lens to convert the light signal into a usable electrical signal to obtain the original image data; and
  • the motor is used to drive
  • the lens moves, thereby adjusting the distance between the lens and the image sensor to satisfy the imaging formula (or lens imaging formula, Gaussian imaging formula, etc.), so that the image is clear.
  • the camera 110 is configured to collect a scene image of a shooting scene.
  • the shooting scene can be understood as the scene that the camera 110 is aimed at after being enabled, that is, the scene where the camera 110 can convert the light signal into corresponding image data.
  • the electronic device enables the camera 110 according to the user operation, if the user controls the camera 110 of the electronic device 100 to aim at a scene including an object, the scene including the object is the shooting scene of the camera 110 .
  • the shooting scene does not refer to a specific scene, but a scene that is aimed in real time following the direction of the camera 110 .
  • the shooting scene does not include only a single object, and various objects may exist in it.
  • the shooting scene of the camera 110 includes not only the "target person" to be shot, but also other objects such as grass, trees, and buildings.
  • a specific object has a specific color, such as the sky is usually blue, the clouds are usually white, and the fire hydrant is usually red.
  • different objects are assigned colors corresponding to them in advance based on experience, which are denoted as pre-assigned color vectors, thereby establishing a correspondence between objects and pre-assigned color vectors.
  • pre-assigned color vectors which are denoted as pre-assigned color vectors, thereby establishing a correspondence between objects and pre-assigned color vectors.
  • the front image signal processor 120 is configured to identify objects existing in the shooting scene according to the scene image according to the configured identification strategy.
  • the configuration of the recognition strategy is not specifically limited here, and can be configured by those of ordinary skill in the art according to actual needs, including but not limited to target-based object recognition methods and artificial intelligence-based object recognition methods.
  • FIG. 2 shows a scene image
  • the front image signal processor 120 recognizes an object "fire hydrant" existing in the corresponding shooting scene by identifying the scene image.
  • the application processor 130 performs white balance correction on the aforementioned scene image according to the configured white balance strategy, and obtains a scene image after the white balance correction, which is recorded as a corrected image.
  • the configuration of the white balance strategy is not specifically limited here, and can be configured by those of ordinary skill in the art according to actual needs, including but not limited to white balance correction methods based on grayscale world and white balance correction methods based on color temperature estimation.
  • the application processor 130 is further configured to obtain the color vector of the object in the identified shooting scene in the corrected image; and obtain the pre-assigned color vector corresponding to the object in the shooting scene according to the correspondence between the object and the pre-assigned color vector. and judge whether the color vector of the object in the shooting scene and the pre-assigned color vector have color shift; and when the color vector of the object in the shooting scene and the pre-assigned color vector have color shift, according to the color vector of the object in the shooting scene and the pre-assigned color vector Color shift of color vector Perform color restoration processing on the corrected image to eliminate color shift, and record the corrected image after color restoration processing as a restored image.
  • the electronic device 100 includes a camera 110 , a front image signal processor 120 and an application processor 130 .
  • the scene image of the shooting scene is collected by the camera 110, and the objects existing in the shooting scene are identified by using the scene image by the front image signal processor 120, and the white balance correction is performed on the scene image by the application processor 130 to obtain a corrected image
  • the application processor 130 performs color restoration processing on the corrected image to obtain a restored image. In this way, by identifying the color shift existing in the white balance result and performing the color restoration processing accordingly, the stability of the color restoration capability of the electronic device 100 can be ensured.
  • the application processor 130 is configured to perform white balance correction on the scene image while the front image signal processor 120 recognizes objects existing in the shooting scene according to the scene image. to get the corrected image.
  • the pre-image signal processor 120 is configured to perform state statistics on the scene image to obtain the state information required by the application processor 130 to perform white balance correction; and perform optimization processing on the scene image to obtain Optimized scene image;
  • the application processor 130 is configured to perform white balance correction on the optimized scene image according to the state information to obtain a corrected image.
  • the pre-image signal processor 120 is further configured to perform state statistics on the scene image, so as to obtain state information required by the application processor 130 to perform white balance correction.
  • the pre-image signal processor 120 is further configured to perform optimization processing on the scene image according to the configured optimization strategy after obtaining the state information required by the application processor 130 to perform white balance correction by statistics to obtain an optimized scene image .
  • the configuration of the optimization strategy is not specifically limited here, and can be flexibly configured by those of ordinary skill in the art according to the processing performance of the pre-image signal processor 120 and actual needs. The optimization process optimizes the scene image.
  • the pre-image signal processor 120 After the aforementioned state information and the optimized scene image obtained through statistics are obtained, the pre-image signal processor 120 also transmits the aforementioned state information and the aforementioned optimized scene image to the application processor 130 .
  • the application processor 130 is further configured to perform white balance correction on the optimized scene image according to the aforementioned state information to obtain a corrected image.
  • the pre-image signal processor 120 includes:
  • the image signal processing unit 1201 is used to perform state statistics on the scene image to obtain the state information required by the application processor 130 to perform white balance correction; and perform the first optimization process on the scene image;
  • the neural network processing unit 1202 is used to perform a second optimization process on the scene image after the first optimization process; and perform object recognition on the scene image after the second optimization process through an object recognition model, to identify the object that exists.
  • the pre-image signal processor 120 includes an image signal processing unit 1201 and a neural network processing unit 1202 .
  • the image signal processing unit 1201 is configured to perform state statistics on the scene image to obtain the state information required by the application processor 130 to perform white balance correction.
  • the image signal processing unit 1201 is further configured to perform a first optimization process on the aforementioned scene image, including but not limited to dead pixel correction processing, Domain noise reduction processing, 3D noise reduction processing, linearization processing and black level correction processing and other non-artificial intelligence-based optimization processing methods.
  • a first optimization process including but not limited to dead pixel correction processing, Domain noise reduction processing, 3D noise reduction processing, linearization processing and black level correction processing and other non-artificial intelligence-based optimization processing methods.
  • optimization processing methods not listed in this application may also be included.
  • the neural network processing unit 1202 is configured to perform a second optimization process on the scene image after the image signal processing unit 1201 performs the first optimization process.
  • the manner in which the neural network processing unit 1202 processes the image data may be to read data blocks in a row manner, and process the data blocks in a row manner.
  • the neural network processing unit 1202 reads the data block in a multi-line manner, and processes the data block in a multi-line manner.
  • one frame of image data may have multiple rows of data blocks, that is, the neural network processing unit 1202 may process a part of one frame of image data, such as n rows of data blocks, where n is a positive integer, such as 2, 4, 5 Wait.
  • the neural network processing unit 1202 may have a built-in cache to store the data of the multi-line data blocks processed by the neural network processing unit 1202 in the process of processing one frame of image data.
  • the neural network processing unit 1202 can complete the processing according to the preset time.
  • the preset time for the neural network processing unit 1202 to process one frame of image is 33ms, which can ensure that the neural network processing unit 1202 can realize real-time data transmission on the basis of rapidly processing image data.
  • the second optimization processing performed by the neural network processing unit 1202 includes, but is not limited to, optimization processing methods based on artificial intelligence such as night scene algorithms, HDR algorithms, blurring algorithms, noise reduction algorithms, and super-resolution algorithms. Of course, optimization processing methods not listed in this application may also be included.
  • the optimization process performed by the pre-image signal processor 120 is divided into two parts, namely, the first optimization process based on non-artificial intelligence performed by the image signal processing unit 1201, and the first optimization process based on artificial intelligence performed by the neural network processing unit 1202. Intelligent second optimization processing.
  • the neural network processing unit 1202 is further deployed with an object recognition model, and the object recognition model is configured to recognize objects existing in the input image.
  • the architecture and training method of the object recognition model are not specifically limited here, and can be selected by those of ordinary skill in the art according to actual needs.
  • a convolutional neural network model is used as the basic model for training the object recognition model.
  • sample images including different objects for example, objects with a specific color may be preferentially selected
  • object labels of objects existing in the sample images are manually marked.
  • the convolutional neural network model is supervised by using the obtained sample objects and the correspondingly calibrated object labels until the convolutional neural network model converges, and the converged convolutional neural network model is used as the object for object recognition. Identify the model.
  • the application processor 130 is configured to determine sampling pixels for color sampling from the aforementioned objects in the object area in the corrected image, and use the color vectors of the sampling pixels as the color vectors of the aforementioned objects. color vector; and calculating the vector difference between the aforementioned color vector and the pre-assigned color vector, and judging whether there is a color shift between the aforementioned object's color vector and the pre-assigned color vector according to the calculated vector difference.
  • color sampling is performed on the identified object in the shooting scene, and the color vector obtained by sampling is used to identify whether there is a color shift in the white balance correction result.
  • the application processor 130 firstly determines the sampling pixel points for color sampling from the aforementioned object in the object area in the corrected image.
  • the selection of sampling pixel points is not specifically limited here, and can be selected by those of ordinary skill in the art as required.
  • the pixel point located at the geometric center of the object area in the corrected image may be used as the sampling pixel point, or a pixel point may be randomly selected from the aforementioned object in the object area of the corrected image as the sampling pixel point.
  • the application processor 130 uses the color vector of the sampled pixel point as the color vector of the aforementioned object.
  • FIG. 4 shows a scene image of a shooting scene.
  • the front image signal processor 120 identifies an object "fire hydrant" existing in the shooting scene, and the application processor 130 uses the object
  • the pixel point of the geometric center of the image area of the "fire hydrant" in the illustrated scene image is determined as the sampling pixel point, and the color vector of the sampling pixel point is used as the color vector of the object "fire hydrant”.
  • the application processor 130 further calculates the vector difference between the color vector of the aforementioned object and its pre-allocated color vector, which can be expressed as:
  • r 3 (r 1 -r 2 )/256;
  • g 3 (g 1 -g 2 )/256;
  • diff represents the vector difference between the color vector of the aforementioned object and its pre-assigned color vector
  • r 1 represents the component value of the aforementioned pre-assigned color vector in the red channel
  • g 1 represents the component value of the aforementioned pre-assigned color vector in the green channel
  • b 1 represents the component value of the aforementioned pre-assigned color vector in the blue channel
  • r 2 represents the component value of the aforementioned color vector in the red channel
  • g 2 represents the component value of the aforementioned color vector in the green channel
  • b 2 represents the aforementioned color vector in the blue channel. component value.
  • the application processor 130 can determine whether there is a color shift between the color vector of the object and the pre-assigned color vector according to the calculated vector difference.
  • a difference threshold for determining the presence of color shift may be pre-configured, and accordingly, by comparing whether the aforementioned vector difference is greater than or equal to the difference threshold, it can be determined whether there is color shift according to the comparison result. Wherein, if the aforementioned vector difference is greater than or equal to the difference threshold, it is determined that there is a color deviation between the aforementioned color vector and the aforementioned pre-assigned color vector (represented by the difference vector between the aforementioned color vector and the aforementioned pre-assigned color vector), if the aforementioned vector difference is less than the difference. If the threshold is set, it is determined that there is no color shift between the aforementioned color vector and the aforementioned pre-assigned color vector.
  • the value of the difference threshold is not specifically limited in the embodiments of the present application, and can be configured by those of ordinary skill in the art according to actual needs.
  • the difference threshold may be configured as a fixed value, or the value of the difference threshold may be dynamically determined. value.
  • the application processor 130 is configured to determine a difference threshold based on the color shift direction of the aforementioned color vector and the aforementioned pre-assigned color vector, and to judge the aforementioned color vector and the aforementioned color vector based on the difference threshold and the aforementioned vector difference. Whether there is a color cast in the pre-allocated color vector.
  • the color shift direction is used to dynamically determine the value of the difference threshold.
  • the corresponding relationship between the color shift direction and the difference threshold associated with each pre-assigned color vector is pre-established.
  • the ellipse in the figure represents the corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vectors.
  • the difference threshold corresponding to when the color shift direction is biased towards blue or red is significantly larger than that corresponding to when the color shift direction is biased towards green. , because the human eye is more sensitive to green.
  • the application processor 130 based on the established correspondence between the color shift direction and the difference threshold associated with the pre-assigned color vector, when the application processor 130 identifies the color shift, it first determines that the color vector of the identified object in the shooting scene is compared with It pre-allocates the color shift direction of the color vector, and then determines the difference threshold corresponding to the color shift direction of the aforementioned color vector according to the corresponding relationship between the color shift direction associated with the pre-assigned color vector and the difference threshold, and then judges the aforementioned Whether the vector difference of the color vectors is greater than or equal to the difference threshold corresponding to the aforementioned color shift direction, wherein, if the vector difference of the aforementioned color vector is greater than or equal to the aforementioned difference threshold corresponding to the aforementioned color shift direction, it is determined that the aforementioned color vector and the aforementioned pre-assigned color vector There is a color shift (here, the aforementioned vector difference and color shift direction are used to characterize), otherwise, it is determined that there
  • the application processor 130 determines that the color vector of the object "fire hydrant" and its pre-assigned color vector have a color shift by identifying the color shift of the object "fire hydrant" in the shooting scene shown in the figure.
  • the arrow represents the color shift, wherein the direction of the arrow represents the color shift direction, and the length of the arrow represents the difference threshold, that is, the longer the length, the greater the difference threshold.
  • the application processor 130 is configured to calculate the difference vector between the aforementioned color vector and the pre-assigned color vector, and use the aforementioned difference vector as the color shift vector of the sampling pixel; and according to the sampling pixel Perform interpolation processing on the color shift vector of the corrected image to obtain the color shift vector of the non-sampling pixel in the corrected image; and perform color restoration processing on each pixel according to the color shift vector of each pixel in the corrected image to obtain a restored image.
  • the application processor 130 is configured to calculate a difference vector between the foregoing color vector and the foregoing pre-assigned color vector, and use the difference vector as a color shift vector of the sampling pixel. Then, according to a preconfigured interpolation strategy, the application processor 130 interpolates according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image. So far, the color shift vectors of all pixels in the corrected image, including sampling pixels and non-sampling pixels, are known, and each pixel can be color-coded according to the color shift vector of each pixel in the corrected image. Restoration processing to obtain a restored image.
  • the interpolation processing performed in the above embodiments of the present application can be understood as a process of estimating the color shift vectors of other pixel points in the entire corrected image through the known color shift vectors of discrete pixels.
  • the front image signal processor 120 has identified 8 different objects in total, and the black solid circles shown in FIG. 7 represent the objects corresponding to these identified objects. Sampling pixel points, the arrows represent the corresponding color shift vector. As shown in FIG. 7 , the application processor 130 obtains the color shift vectors of all pixels in the corrected image by interpolation according to the color shift vectors of the sampled pixels.
  • interpolation strategy used in the embodiments of the present application is not specifically limited, and can be selected by those of ordinary skill in the art according to actual needs, including but not limited to recent field interpolation, bilinear interpolation, or bicubic interpolation, etc.
  • the application processor 130 is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel points, to obtain a plurality of candidate color shift vectors of the non-sampled pixel points; and According to the multiple candidate color shift vectors, the color shift vectors of the non-sampling pixels are obtained;
  • the neighborhood pixel points selected by the application processor 130 during interpolation according to different interpolation strategies are different.
  • a single interpolation strategy is not used for interpolation processing, but multiple interpolation strategies are combined to perform interpolation processing.
  • interpolation strategy is adopted and the number of interpolation strategies, which can be configured according to the processing capability of the application processor 130 in the art.
  • the embodiment of the present application does not specifically limit which fusion strategy is adopted, and can be configured by those of ordinary skill in the art according to actual needs.
  • interpolation strategy A three different interpolation strategies are pre-configured in the embodiment of the present application, which are denoted as interpolation strategy A, interpolation strategy B, and interpolation strategy C, respectively.
  • the application processor 130 uses interpolation strategy A to obtain the candidate color shift vector A of the non-sampling pixel point according to the color shift vector of the sampled pixel point, and obtains the candidate color shift vector A of the non-sampled pixel point by interpolation strategy B.
  • the candidate color shift vector B of the non-sampling pixel point, and the candidate color shift vector C of the non-sampling pixel point obtained by interpolation using an interpolation strategy C.
  • the application processor 130 fuses the candidate color shift vector A, the candidate color shift vector B, and the candidate color shift vector C into one vector according to the configured fusion strategy, which is used as the color shift vector of the non-sampled pixel point.
  • the application processor 130 is configured to calculate the average value of the components of the multiple candidate color shift vectors in each dimension, and obtain the color shift of the non-sampling pixel point according to the average value of each dimension component. amount; or
  • Weighted summation is performed on the components of the multiple candidate color shift vectors in each dimension, and the color shift vector of the non-sampling pixel point is obtained according to the weighted sum value of each dimension component.
  • the application processor 130 calculates the average value of the components of its multiple candidate color shift vectors in each dimension, and obtains the color shift vector of the non-sampling pixel according to the average value of each dimension component. .
  • the application processor 130 performs a weighted summation of the components of the multiple candidate color shift vectors of the non-sampling pixel in each dimension according to the weight corresponding to each interpolation strategy, The weighted sum value of , obtains the color shift vector of the non-sampled pixel point.
  • the application processor 130 is configured to obtain the recognition confidence level corresponding to the aforementioned object, and perform correction processing on the color shift vector of the aforementioned sampling pixel point according to the recognition confidence level, to obtain the corrected sample pixel point. color shift vector; and performing interpolation processing on the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.
  • the magnitude of the color restoration is determined according to the recognition confidence of the object recognized by the pre-image signal processor 120 .
  • the application processor 130 first obtains the recognition confidence of the pre-image signal processor 120 to identify the object in the shooting scene, and performs correction processing on the color shift vector of the aforementioned sampling pixel points according to the recognition confidence, which can be expressed as:
  • V' represents the corrected color shift vector of the sampled pixel point
  • V represents the color shift vector of the sampled pixel point obtained by calculation
  • represents the recognition confidence of the aforementioned object.
  • the application processor 130 After completing the correction of the color shift vector of the sampling pixel, the application processor 130 further performs interpolation processing according to the corrected color shift vector of the sampling pixel, so as to obtain the color shift vector of the non-sampling pixel in the corrected image,
  • interpolation processing according to the corrected color shift vector of the sampling pixel, so as to obtain the color shift vector of the non-sampling pixel in the corrected image.
  • the embodiment of the present application also provides a pre-image signal processor, and the device includes:
  • a data interface for acquiring a scene image of a shooting scene from a camera; and transmitting the scene image to an application processor for white balance correction, and receiving a corrected image returned after the application processor performs white balance correction;
  • a neural network processing unit configured to recognize the scene image through an object recognition model, so as to recognize the object existing in the shooting scene
  • An image signal processing unit configured to perform color restoration processing on the corrected image according to the color deviation when the color vector of the object in the corrected image and the pre-assigned color vector of the object have a color deviation, to obtain Restore the image.
  • the image signal processing unit is configured to determine a sampling pixel point for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixel point as a the color vector of the object; and calculating the vector difference between the color vector and the pre-assigned color vector, and judging whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference.
  • the image signal processing unit is configured to determine a difference threshold based on the color shift direction between the color vector and the pre-assigned color vector, and determine the color based on the difference threshold and the vector difference Whether there is a color shift between the vector and the pre-assigned color vector.
  • the image signal processing unit is configured to calculate a difference vector between the color vector and the pre-assigned color vector, and use the difference vector as a color shift vector of the sampling pixel; and Perform interpolation processing according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image; A color restoration process is performed to obtain the restored image.
  • the image signal processing unit is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vectors of the sampled pixels to obtain multiple candidate color shift vectors of the non-sampled pixels ; and obtaining the color shift vector of the non-sampling pixel point according to the plurality of candidate color shift vectors.
  • the image signal processing unit is configured to obtain the recognition confidence corresponding to the object, and perform correction processing on the color shift vector of the sampling pixel point according to the recognition confidence to obtain the sampling pixel point-corrected color shift vector; and performing interpolation processing according to the corrected color shift vector of the sampled pixel point to obtain the color shift vector of the non-sampled pixel point in the corrected image.
  • the present application also provides a pre-image signal processor.
  • the pre-image signal processor 200 includes:
  • a data interface 210 for acquiring a scene image of the shooting scene from the camera; and transmitting the scene image to the application processor for white balance correction, and receiving the corrected image returned after the application processor performs white balance correction;
  • the neural network processing unit 220 is used to identify the scene image through the object recognition model, to identify the object existing in the shooting scene;
  • the image signal processing unit 230 is configured to perform color restoration processing on the corrected image according to the color shift to obtain a restored image when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object.
  • the front image signal processor provided in the present application can be applied to an electronic device having a camera and an application processor to improve the color reproduction capability of the electronic device.
  • the type of the data interface 210 is not specifically limited in the embodiments of the present application, including but not limited to a mobile industry processor interface (Mobile Industry Processor Interface, MIPI), a PCI-E interface, and the like.
  • MIPI Mobile Industry Processor Interface
  • PCI-E interface PCI-E interface
  • the shooting scene can be understood as the scene that the camera is aimed at after being enabled, that is, the scene where the camera can convert the light signal into corresponding image data.
  • the electronic device enables the camera according to the user operation, if the user controls the camera of the electronic device to aim at a scene including an object, the scene including the object is the shooting scene of the camera.
  • the shooting scene does not refer to a specific scene, but a scene that is aimed in real time following the direction of the camera.
  • the shooting scene does not include only a single object, and various objects may exist in it.
  • the shooting scene of the camera not only includes the "target person", but also other objects such as grass, trees, and buildings.
  • a specific object has a specific color, such as the sky is usually blue, the clouds are usually white, and the fire hydrant is usually red.
  • different objects are assigned colors corresponding to them in advance based on experience, which are denoted as pre-assigned color vectors, thereby establishing a correspondence between objects and pre-assigned color vectors.
  • pre-assigned color vectors which are denoted as pre-assigned color vectors, thereby establishing a correspondence between objects and pre-assigned color vectors.
  • the data interface 210 is configured to acquire the scene image of the shooting scene from the camera.
  • the neural network processing unit 220 is deployed with an object recognition model, and the object recognition model is configured to recognize objects existing in the input image.
  • the architecture and training method of the object recognition model are not specifically limited here, and can be selected by those of ordinary skill in the art according to actual needs.
  • a convolutional neural network model is used as the basic model for training the object recognition model.
  • sample images including different objects for example, objects with a specific color may be preferentially selected
  • object labels of objects existing in the sample images are manually marked.
  • the convolutional neural network model is supervised by using the obtained sample objects and the correspondingly calibrated object labels until the convolutional neural network model converges, and the converged convolutional neural network model is used as the object for object recognition. Identify the model.
  • the neural network processing unit 220 is configured to recognize the scene image through the object recognition model, so as to recognize the object existing in the shooting scene.
  • the pre-image signal processor 200 recognizes the scene image through the neural network processing unit 220, and identifies an object "fire hydrant" in the corresponding shooting scene.
  • the data interface 210 is further configured to transmit the scene image to the application processor to perform white balance correction, and to receive the corrected image returned after the application processor performs the white balance correction.
  • the application processor performs white balance correction on the aforementioned scene image according to the configured white balance strategy, and obtains the scene image after the white balance correction, which is recorded as a corrected image.
  • the configuration of the white balance strategy is not specifically limited here, and can be configured by those of ordinary skill in the art according to actual needs, including but not limited to white balance correction methods based on grayscale world and white balance correction methods based on color temperature estimation. After the corrected image is obtained from the correction, the corrected image is returned to the data interface 210.
  • the image signal processing unit is configured to obtain the identified color vector of the object in the shooting scene in the corrected image; and obtain the pre-assigned color vector corresponding to the object in the shooting scene according to the correspondence between the object and the pre-assigned color vector; And judge whether the color vector of the object in the shooting scene and the pre-assigned color vector have color shift;
  • the color cast of the vector performs color restoration processing on the corrected image to eliminate the color cast, and records the corrected image after the color restoration processing as the restored image.
  • the front image signal processor 200 obtaineds the scene image of the shooting scene from the camera through the data interface 210; and transmits the scene image to the application processor for white balance correction, and receives the application processor for white balance correction.
  • the corrected image returned after the balance correction; the scene image is recognized based on the object recognition model by the neural network processing unit 220 to identify the object existing in the shooting scene; and the color vector of the object in the corrected image by the image signal processing unit 230
  • the corrected image is subjected to color restoration processing according to the color shift to obtain a restored image. In this way, by identifying the color shift existing in the white balance result, and performing color restoration processing accordingly, the color restoration capability of the electronic device can be improved.
  • the image signal processing unit 230 is configured to perform state statistics on the scene image to obtain state information required by the application processor to perform white balance correction;
  • the data interface 210 is used to transmit the aforementioned status information and the scene image to the application processor for white balance correction, and receive the corrected image returned after the application processor performs the white balance correction.
  • the image signal processing unit 230 is further configured to perform state statistics on the scene image, so as to obtain state information required by the application processor to perform white balance correction.
  • the data interface 210 is configured to transmit the aforementioned status information and the aforementioned scene image to the application processor for white balance correction, and to receive the corrected image returned after the application processor performs white balance correction.
  • the image signal processing unit 230 is further configured to perform a first optimization process on the scene image after obtaining the state information from statistics;
  • the neural network processing unit 220 is further configured to perform a second optimization process on the scene image after the first optimization process
  • the data interface 210 is used to transmit the foregoing status information and the scene image after the second optimization process to the application processor for white balance correction, and receive the corrected image returned after the application processor performs white balance correction.
  • the image signal processing unit 230 is further configured to perform a first optimization process on the aforementioned scene image, including but not limited to dead pixel correction processing, temporal noise reduction, after the state information required by the application processor to perform white balance correction is statistically obtained. Processing, 3D noise reduction processing, linearization processing and black level correction processing and other non-artificial intelligence-based optimization processing methods. Of course, optimization processing methods not listed in this application may also be included.
  • the neural network processing unit 220 is configured to perform a second optimization process on the scene image after the image signal processing unit 230 performs the first optimization process.
  • the manner in which the neural network processing unit 220 processes the image data may be to read data blocks in a row manner, and process the data blocks in a row manner.
  • the neural network processing unit 220 reads the data block in a multi-line manner, and processes the data block in a multi-line manner.
  • one frame of image data may have multiple rows of data blocks, that is, the neural network processing unit 220 may process a part of one frame of image data, such as n rows of data blocks, where n is a positive integer, such as 2, 4, and 5. Wait.
  • the neural network processing unit 220 may have a built-in cache to store the data of the multi-line data blocks processed by the neural network processing unit 220 in the process of processing one frame of image data.
  • the neural network processing unit 220 can complete the processing according to the preset time.
  • the preset time for the neural network processing unit 220 to process one frame of image is 33ms, which can ensure that the neural network processing unit 220 can realize real-time data transmission on the basis of fast processing image data.
  • the second optimization processing performed by the neural network processing unit 220 includes, but is not limited to, optimization processing methods based on artificial intelligence such as night scene algorithms, HDR algorithms, blurring algorithms, noise reduction algorithms, and super-resolution algorithms. Of course, optimization processing methods not listed in this application may also be included.
  • the pre-image signal processor 200 performs two optimization processes through the image signal processing unit 230 and the neural network processing unit 220 respectively, which are the first optimization process based on non-artificial intelligence performed by the image signal processing unit 230 respectively, and artificial intelligence-based second optimization processing performed by the neural network processing unit 220 .
  • the data interface 210 is further configured to transmit the foregoing status information and the scene image after the second optimization process to the application processor for white balance correction, and receive a corrected image returned after the application processor performs white balance correction.
  • the neural network processing unit 220 is configured to perform object recognition on the scene image after the second optimization process through the object recognition model, so as to recognize the objects existing in the shooting scene.
  • the image signal processing unit 230 is configured to determine sampling pixels for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixels as the color of the object. vector; and calculating the vector difference between the color vector and the pre-allocated color vector, and determining whether there is a color shift between the color vector and the pre-allocated color vector according to the vector difference.
  • color sampling is performed on the identified object in the shooting scene, and the color vector obtained by sampling is used to identify whether there is a color shift in the white balance correction result.
  • the image signal processing unit 230 firstly determines the sampling pixel points for color sampling from the aforementioned object in the object area in the corrected image.
  • the selection of sampling pixel points is not specifically limited here, and can be selected by those of ordinary skill in the art as required.
  • the pixel point located at the geometric center of the object area in the corrected image may be used as the sampling pixel point, or a pixel point may be randomly selected from the aforementioned object in the object area of the corrected image as the sampling pixel point.
  • the image signal processing unit 230 uses the color vector of the sampled pixel point as the color vector of the aforementioned object.
  • FIG. 4 shows a scene image of a shooting scene.
  • the front image signal processor 200 recognizes an object "fire hydrant" existing in the shooting scene, and the image signal processing unit 230 will The pixel point of the object "fire hydrant" in the geometric center of the image area in the illustrated scene image is determined as the sampling pixel point, and the color vector of the sampling pixel point is used as the color vector of the object "fire hydrant".
  • the image signal processing unit 230 further calculates the vector difference between the color vector of the aforementioned object and its pre-assigned color vector, which can be expressed as:
  • r 3 (r 1 -r 2 )/256;
  • g 3 (g 1 -g 2 )/256;
  • diff represents the vector difference between the color vector of the aforementioned object and its pre-assigned color vector
  • r 1 represents the component value of the aforementioned pre-assigned color vector in the red channel
  • g 1 represents the component value of the aforementioned pre-assigned color vector in the green channel
  • b 1 represents the component value of the aforementioned pre-assigned color vector in the blue channel
  • r 2 represents the component value of the aforementioned color vector in the red channel
  • g 2 represents the component value of the aforementioned color vector in the green channel
  • b 2 represents the aforementioned color vector in the blue channel. component value.
  • the image signal processing unit 230 can determine whether there is a color shift between the color vector of the object and the pre-assigned color vector according to the calculated vector difference.
  • a difference threshold for determining the presence of color shift may be pre-configured, and accordingly, by comparing whether the aforementioned vector difference is greater than or equal to the difference threshold, it can be determined whether there is color shift according to the comparison result. Wherein, if the aforementioned vector difference is greater than or equal to the difference threshold, it is determined that there is a color deviation between the aforementioned color vector and the aforementioned pre-assigned color vector (represented by the difference vector between the aforementioned color vector and the aforementioned pre-assigned color vector), if the aforementioned vector difference is less than the difference. If the threshold is set, it is determined that there is no color shift between the aforementioned color vector and the aforementioned pre-assigned color vector.
  • the value of the difference threshold is not specifically limited in the embodiments of the present application, and can be configured by those of ordinary skill in the art according to actual needs.
  • the difference threshold may be configured as a fixed value, or the value of the difference threshold may be dynamically determined. value.
  • the image signal processing unit 230 is configured to determine a difference threshold based on the color shift direction of the color vector and the pre-assigned color vector, and determine whether the color vector and the pre-assigned color vector are not based on the difference threshold and the vector difference. There is a color cast.
  • the color shift direction is used to dynamically determine the value of the difference threshold.
  • the corresponding relationship between the color shift direction and the difference threshold associated with each pre-assigned color vector is pre-established.
  • the ellipse in the figure represents the corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vectors.
  • the difference threshold corresponding to when the color shift direction is biased towards blue or red is significantly larger than that corresponding to when the color shift direction is biased towards green. , because the human eye is more sensitive to green.
  • the image signal processing unit 230 when the image signal processing unit 230 performs color shift identification, it first determines that the color vector of the identified object in the shooting scene is compared with Based on the color shift direction of its pre-assigned color vector, then according to the corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vector, determine the difference threshold corresponding to the color shift direction of the aforementioned color vector, and then judge Whether the vector difference of the aforementioned color vectors is greater than or equal to the difference threshold corresponding to the aforementioned color shift direction, wherein, if the aforementioned vector difference of the aforementioned color vector is greater than or equal to the aforementioned difference threshold value corresponding to the aforementioned color shift direction, then it is determined that the aforementioned color vector and the aforementioned pre-assigned color
  • the vector has a color shift (here, the aforementioned vector difference and color shift direction are used to characterize it),
  • the image signal processing unit 230 determines that the color vector of the object "fire hydrant" and its pre-assigned color vector have a color shift by identifying the color shift of the object "fire hydrant" in the shooting scene shown in the figure.
  • the arrow shown represents the color shift, wherein the direction of the arrow represents the color shift direction, and the length of the arrow represents the difference threshold, that is, the longer the length, the greater the difference threshold.
  • the image signal processing unit 230 is configured to calculate the difference vector between the color vector and the pre-assigned color vector, and use the difference vector as the color shift vector of the sampling pixel;
  • the color shift vector is interpolated to obtain the color shift vector of the non-sampling pixels in the corrected image; and according to the color shift vector of each pixel in the corrected image, color restoration is performed on each pixel to obtain a restored image.
  • the image signal processing unit 230 is configured to calculate the difference vector between the aforementioned color vector and the aforementioned pre-assigned color vector, and use the difference vector as the color shift vector of the sampling pixel. Then, the image signal processing unit 230 obtains the color shift vector of the non-sampled pixel points in the corrected image by interpolating according to the color shift vector of the sampled pixel points according to the pre-configured interpolation strategy. So far, the color shift vectors of all pixels in the corrected image, including sampling pixels and non-sampling pixels, are known, and each pixel can be color-coded according to the color shift vector of each pixel in the corrected image. Restoration processing to obtain a restored image.
  • the interpolation processing performed in the above embodiments of the present application can be understood as a process of estimating the color shift vectors of other pixel points in the entire corrected image through the known color shift vectors of discrete pixels.
  • the front image signal processor 200 has identified 8 different objects through the neural network processing unit 220 , and the black solid circles shown in FIG. 7 represent the corresponding The sampled pixels of these identified objects, and the arrows represent the corresponding color shift vectors.
  • the image signal processing unit 230 obtains the color shift vectors of all pixels in the corrected image by interpolation according to the color shift vectors of the sampled pixels.
  • interpolation strategy adopted is not specifically limited in the embodiments of the present application, and can be selected by those of ordinary skill in the art according to actual needs, including but not limited to recent field interpolation, bilinear interpolation or bicubic interpolation, etc.
  • the image signal processing unit 230 is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel point, to obtain multiple candidate color shift vectors of the non-sampled pixel point; And according to the multiple candidate color shift vectors, the color shift vectors of the non-sampling pixels are obtained.
  • the neighborhood pixel points selected by the application processor 130 during interpolation according to different interpolation strategies are different.
  • a single interpolation strategy is not used for interpolation processing, but multiple interpolation strategies are combined to perform interpolation processing.
  • interpolation strategy is adopted and the number of interpolation strategies, which can be configured according to the processing capability of the image signal processing unit 230 in the art.
  • the embodiment of the present application does not specifically limit which fusion strategy is adopted, and can be configured by those of ordinary skill in the art according to actual needs.
  • interpolation strategy A three different interpolation strategies are pre-configured in the embodiment of the present application, which are denoted as interpolation strategy A, interpolation strategy B, and interpolation strategy C, respectively.
  • the image signal processing unit 230 uses interpolation strategy A to obtain the candidate color shift vector A of the non-sampling pixel point according to the color shift vector of the sampled pixel point, and uses interpolation strategy B to interpolate the candidate color shift vector A.
  • the image signal processing unit 230 fuses the candidate color shift vector A, the candidate color shift vector B, and the candidate color shift vector C into one vector according to the configured fusion strategy, which is used as the color shift vector of the non-sampling pixel point.
  • the image signal processing unit 230 is configured to calculate the average value of the components of the multiple candidate color shift vectors in each dimension, and obtain the color of the non-sampling pixel point according to the average value of each dimension component. bias vector; or
  • Weighted summation is performed on the components of the multiple candidate color shift vectors in each dimension, and the color shift vector of the non-sampling pixel point is obtained according to the weighted sum value of each dimension component.
  • the image signal processing unit 230 calculates the average value of the components of its multiple candidate color shift vectors in each dimension, and obtains the color shift of the non-sampling pixel according to the average value of each dimension component. quantity.
  • the image signal processing unit 230 performs weighted summation of the components of the multiple candidate color shift vectors of the non-sampling pixel in each dimension according to the weight corresponding to each interpolation strategy, The weighted sum of the components obtains the color shift vector of the unsampled pixel.
  • the image signal processing unit 230 is configured to obtain the recognition confidence corresponding to the aforementioned object, and perform correction processing on the color shift vector of the sampled pixel points according to the recognition confidence degree to obtain the corrected sample pixel point. color shift vector; and performing interpolation processing on the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.
  • the magnitude of the color restoration is determined according to the recognition confidence of the object recognized by the neural network recognition unit 220 .
  • the image signal processing unit 230 first obtains the recognition confidence of the object in the shooting scene recognized by the neural network recognition unit 220, and performs correction processing on the color shift vector of the aforementioned sampling pixel points according to the recognition confidence, which can be expressed as:
  • V' represents the corrected color shift vector of the sampled pixel point
  • V represents the color shift vector of the sampled pixel point obtained by calculation
  • represents the recognition confidence of the aforementioned object.
  • the image signal processing unit 230 After completing the correction of the color shift vector of the sampling pixel, the image signal processing unit 230 further performs interpolation processing according to the corrected color shift vector of the sampling pixel, so as to obtain the color shift vector of the non-sampling pixel in the corrected image , for details, reference may be made to the relevant descriptions in the above embodiments, which will not be repeated here.
  • the embodiment of the present application also provides an image processing method, the method includes:
  • color restoration processing is performed on the corrected image according to the color shift to obtain a restored image.
  • the image processing method further includes:
  • determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference includes:
  • a difference threshold is determined based on the color shift direction between the color vector and the pre-assigned color vector, and whether there is a color shift between the color vector and the pre-assigned color vector is determined based on the difference threshold and the vector difference.
  • performing color restoration processing on the corrected image according to the color shift to obtain a restored image includes:
  • color restoration processing is performed on each pixel to obtain the restored image.
  • performing interpolation processing according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image including:
  • the present application also provides an image processing method, as shown in FIG. 9 , the image processing method includes:
  • execution sequence of 320 and 330 is not affected by the size of the sequence number, it may be that 320 is executed first and then 330 is executed, 330 may be executed first and then 320 is executed, or 320 and 330 may be executed simultaneously.
  • performing white balance correction on the scene image to obtain a corrected image including:
  • the white balance correction is performed on the scene image according to the foregoing state information, and before the corrected image is obtained, the method further includes:
  • the first optimization processing is performed on the scene image
  • identifying objects existing in the shooting scene according to the scene image includes:
  • the object recognition model is used to perform object recognition on the scene image after the second optimization processing, so as to recognize the objects existing in the shooting scene.
  • the image processing method provided by this application further includes:
  • determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference includes:
  • the difference threshold is determined based on the color shift direction of the color vector and the pre-assigned color vector, and whether there is a color shift between the color vector and the pre-assigned color vector is determined based on the difference threshold and the vector difference.
  • performing color restoration processing on the corrected image according to the color shift to obtain a restored image including:
  • color restoration is performed on each pixel to obtain a restored image.
  • interpolation processing is performed according to the color shift vector of the sampled pixels to obtain the color shift vector of the non-sampled pixels in the corrected image, including:
  • the color shift vectors of the non-sampled pixels are obtained.
  • the color shift vector of the non-sampling pixel is obtained according to a plurality of candidate color shift vectors, including:
  • Weighted summation is performed on the components of the multiple candidate color shift vectors in each dimension, and the color shift vector of the non-sampling pixel point is obtained according to the weighted sum value of each dimension component.
  • interpolation processing is performed according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image, including:
  • image processing method provided by this application can be executed by the electronic device provided by this application, and it can also be executed by the pre-image signal processor provided by this application.
  • the relevant description of the device or the front image signal processor will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

Embodiments of the present application provide an electronic device, a front image signal processor, and an image processing method. The method comprises: acquiring a scene image of a photography scene; identifying, according to the scene image, an object existing in the photography scene; performing white balance correction on the scene image to obtain a corrected image; and when a color vector of the object in the photography scene and a pre-assigned color vector of the object have a color cast, performing color reduction processing on the corrected image to obtain a restored image.

Description

电子设备、前置图像信号处理器及图像处理方法Electronic device, front image signal processor and image processing method

本申请要求于2021年01月12日提交中国专利局、申请号为202110035973.9、申请名称为“电子设备、前置图像信号处理器及图像处理方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on January 12, 2021 with the application number 202110035973.9 and the application name "Electronic Equipment, Front Image Signal Processor and Image Processing Method", the entire contents of which are approved by Reference is incorporated in this application.

技术领域technical field

本申请涉及图像处理技术领域,特别涉及一种电子设备、前置图像信号处理器及图像处理方法。The present application relates to the technical field of image processing, and in particular, to an electronic device, a front-end image signal processor, and an image processing method.

背景技术Background technique

目前,用户通常利用具有摄像头的电子设备(如数码相机、智能手机等)拍摄图像,从而随时随地的记录身边发生的事情,看到的景物等。为了提供更高的拍摄体验,不仅要求提高电子设备的摄像头像素,还要求提高电子设备的色彩还原能力。相关技术中,为了使得拍摄的图像能够真实地反映拍摄对象的颜色,提出了自动白平衡技术,旨在使得不同光源照明场景下的拍摄对象具有人眼在相同光源照明场景下所见相符的色彩还原。然而,电子设备基于白平衡的色彩还原能力较差。At present, users usually use electronic devices with cameras (such as digital cameras, smart phones, etc.) to capture images, so as to record what happens around them, the scenery they see, and the like anytime and anywhere. In order to provide a higher shooting experience, it is not only required to improve the camera pixels of the electronic device, but also to improve the color reproduction capability of the electronic device. In the related art, in order to make the photographed image truly reflect the color of the photographed object, an automatic white balance technology is proposed, which aims to make the photographed object under different light source illumination scenes have the same color as the human eye sees under the same light source illumination scene. reduction. However, electronic devices have poor color reproduction capabilities based on white balance.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种电子设备、前置图像信号处理器及图像处理方法,能够提高电子设备的色彩还原能力。Embodiments of the present application provide an electronic device, a front image signal processor, and an image processing method, which can improve the color reproduction capability of the electronic device.

第一方面,本申请实施例提供一种电子设备,包括:摄像头,用于采集拍摄场景的场景图像;前置图像信号处理器,用于根据所述场景图像识别所述拍摄场景中存在的对象;应用处理器,用于对所述场景图像进行白平衡校正,得到校正图像;以及当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。In a first aspect, an embodiment of the present application provides an electronic device, including: a camera for collecting a scene image of a shooting scene; a front image signal processor for recognizing objects existing in the shooting scene according to the scene image ; an application processor for performing white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, according to The color shift performs color restoration processing on the corrected image to obtain a restored image.

第二方面,本申请实施例还提供一种前置图像信号处理器,包括:数据接口,用于从摄像头获取拍摄场景的场景图像;以及将所述场景图像传输至应用处理器进行白平衡校正,并接收所述应用处理器进行白平衡校正后返回的校正图像;神经网络处理单元,用于通过对象识别模型对所述场景图像进行识别,以识别出所述拍摄场景中存在的对象;图像信号处理单元,用于当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。In a second aspect, an embodiment of the present application further provides a front image signal processor, including: a data interface for acquiring a scene image of a shooting scene from a camera; and transmitting the scene image to an application processor for white balance correction , and receive the corrected image returned after the application processor performs white balance correction; a neural network processing unit is used to identify the scene image through an object recognition model, so as to identify the object existing in the shooting scene; image A signal processing unit, configured to perform color restoration processing on the corrected image according to the color shift when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object to obtain a restoration image.

第三方面,本申请实施例还提供一种图像处理方法,获取拍摄场景的场景图像;对所述场景图像进行白平衡校正,得到校正图像;根据所述场景图像识别所述拍摄场景中存在的对象;当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。In a third aspect, the embodiments of the present application further provide an image processing method, which acquires a scene image of a shooting scene; performs white balance correction on the scene image to obtain a corrected image; and identifies images existing in the shooting scene according to the scene image object; when the color vector of the object in the corrected image has a color deviation from the pre-assigned color vector of the object, perform color restoration processing on the corrected image according to the color deviation to obtain a restored image.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative effort.

图1为本申请实施例提供的电子设备的结构示意图。FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

图2为本申请实施例中识别得到场景图像中存在的对象的示例图。FIG. 2 is an example diagram of an object existing in a scene image being recognized and obtained according to an embodiment of the present application.

图3为图1中前置图像信号处理器的细化结构示意图。FIG. 3 is a schematic diagram of a refined structure of the front image signal processor in FIG. 1 .

图4为本申请实施例中确定出的采样像素点的示例图。FIG. 4 is an example diagram of sampling pixel points determined in an embodiment of the present application.

图5为本申请实施例中与预分配颜色向量关联的,色偏方向与预设相似度的对应关系 的示意图。5 is a schematic diagram of the corresponding relationship between the color shift direction and the preset similarity, which is associated with the pre-assigned color vector in the embodiment of the application.

图6为本申请实施例中计算得到的色偏向量的示例图。FIG. 6 is an example diagram of a color shift vector calculated in an embodiment of the present application.

图7为本申请实施例中进行插值处理的示例图。FIG. 7 is an example diagram of interpolation processing in an embodiment of the present application.

图8为本申请实施例提供的前置图像信号处理器的结构示意图。FIG. 8 is a schematic structural diagram of a pre-image signal processor provided by an embodiment of the present application.

图9为本申请实施例提供的图像处理方法的流程示意图。FIG. 9 is a schematic flowchart of an image processing method provided by an embodiment of the present application.

具体实施方式Detailed ways

本申请实施例提供的技术方案可以应用于各种需要进行数据通信的场景,本申请实施例对此并不限定。The technical solutions provided in the embodiments of the present application can be applied to various scenarios where data communication is required, which is not limited in the embodiments of the present application.

本实施例提供一种电子设备,该电子设备包括:This embodiment provides an electronic device, the electronic device includes:

摄像头,用于采集拍摄场景的场景图像;A camera, used to collect scene images of the shooting scene;

前置图像信号处理器,用于根据所述场景图像识别所述拍摄场景中存在的对象;a front image signal processor, configured to identify objects existing in the shooting scene according to the scene image;

应用处理器,用于对所述场景图像进行白平衡校正,得到校正图像;以及当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。An application processor, configured to perform white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, according to the The color cast performs color restoration processing on the corrected image to obtain a restored image.

在一些实施例中,所述前置图像信号处理器用于对所述场景图像进行状态统计,得到所述应用处理器进行白平衡校正所需的状态信息;以及对所述场景图像进行优化处理,得到优化后的场景图像;In some embodiments, the pre-image signal processor is configured to perform state statistics on the scene image to obtain state information required by the application processor to perform white balance correction; and perform optimization processing on the scene image, Get the optimized scene image;

所述应用处理器用于根据所述状态信息对所述优化后的场景图像进行白平衡校正,得到所述校正图像。The application processor is configured to perform white balance correction on the optimized scene image according to the state information to obtain the corrected image.

在一些实施例中,所述前置图像信号处理器包括:In some embodiments, the pre-image signal processor includes:

图像信号处理单元,用于对所述场景图像进行状态统计,得到所述状态信息;以及对所述场景图像进行第一次优化处理;an image signal processing unit, configured to perform state statistics on the scene image to obtain the state information; and perform a first optimization process on the scene image;

神经网络处理单元,用于对第一次优化处理后的场景图像进行第二次优化处理;以及通过对象识别模型对第二次优化处理后的场景图像进行对象识别,以识别出所述拍摄场景中存在的对象。A neural network processing unit for performing a second optimization process on the scene image after the first optimization process; and performing object recognition on the scene image after the second optimization process through an object recognition model, so as to identify the shooting scene objects that exist in .

在一些实施例中,所述应用处理器用于从所述对象在所述校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将所述采样像素点的颜色向量作为所述对象的颜色向量;以及计算所述颜色向量与所述预分配颜色向量的向量差异,并根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏。In some embodiments, the application processor is configured to determine a sampling pixel point for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixel point as the the color vector of the object; and calculating the vector difference between the color vector and the pre-assigned color vector, and determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference.

在一些实施例中,所述应用处理器用于基于所述颜色向量与所述预分配颜色向量的色偏方向确定差异阈值,并基于所述差异阈值以及所述向量差异来判断所述颜色向量与所述预分配颜色向量是否存在色偏。In some embodiments, the application processor is configured to determine a difference threshold based on the color shift direction of the color vector and the pre-assigned color vector, and determine the difference between the color vector and the color vector based on the difference threshold and the vector difference. Whether there is a color cast in the pre-assigned color vector.

在一些实施例中,所述应用处理器用于计算所述颜色向量与所述预分配颜色向量的差值向量,并将所述差值向量作为所述采样像素点的色偏向量;以及根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量;以及根据所述校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到所述还原图像。In some embodiments, the application processor is configured to calculate a difference vector between the color vector and the pre-assigned color vector, and use the difference vector as a color shift vector of the sampled pixel point; and according to the Perform interpolation processing on the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image; A restoration process is performed to obtain the restored image.

在一些实施例中,所述应用处理器用于根据所述采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到所述非采样像素点的多个候选色偏向量;以及根据所述多个候选色偏向量,得到所述非采样像素点的色偏向量。In some embodiments, the application processor is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel point, to obtain a plurality of candidate color shift vectors of the non-sampled pixel point; and According to the plurality of candidate color shift vectors, the color shift vectors of the non-sampled pixels are obtained.

在一些实施例中,所述应用处理器用于计算所述多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到所述非采样像素点的色偏向量;或者In some embodiments, the application processor is configured to calculate the average value of components of the plurality of candidate color shift vectors in each dimension, and obtain the color shift of the non-sampling pixel point according to the average value of each dimension component amount; or

对所述多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到所述非采样像素点的色偏向量。Weighted summation is performed on components of the plurality of candidate color shift vectors in each dimension, and the color shift vector of the non-sampled pixel point is obtained according to the weighted sum value of each dimension component.

在一些实施例中,所述应用处理器用于获取所述对象对应的识别置信度,并根据所述 识别置信度对所述采样像素点的色偏向量进行修正处理,得到所述采样像素点修正后的色偏向量;以及根据所述采样像素点修正后的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量。In some embodiments, the application processor is configured to obtain the recognition confidence level corresponding to the object, and perform correction processing on the color shift vector of the sampling pixel point according to the recognition confidence level, so as to obtain the correction of the sampling pixel point and performing interpolation processing according to the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.

请参照图1,图1为本申请实施例提供的电子设备100的结构示意图。该电子设备100包括摄像头110、前置图像信号处理器120和应用处理器130,其中,Please refer to FIG. 1 , which is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application. The electronic device 100 includes a camera 110, a front image signal processor 120 and an application processor 130, wherein,

摄像头110,用于采集拍摄场景的场景图像;a camera 110, used for collecting scene images of the shooting scene;

前置图像信号处理器120,用于根据场景图像识别拍摄场景中存在的对象;The front image signal processor 120 is used for identifying objects existing in the shooting scene according to the scene image;

应用处理器130,用于对场景图像进行白平衡校正,得到校正图像;以及当前述对象在校正图像中的颜色向量与前述对象的预分配颜色向量存在色偏时,根据色偏对校正图像进行颜色还原处理,得到还原图像。The application processor 130 is configured to perform white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the aforementioned object in the corrected image and the pre-assigned color vector of the aforementioned object, perform a color shift on the corrected image according to the color shift. Color restoration processing to obtain restored images.

应当说明的是,本申请实施例中对电子设备的实体展现形式不做具体限制,电子设备的实体展现形式可以是智能手机、平板电脑、掌上电脑、笔记本电脑等移动式电子设备,也可以是台式电脑、电视等固定式电子设备。It should be noted that, in the embodiments of the present application, the entity presentation form of the electronic device is not specifically limited, and the entity presentation form of the electronic device may be a mobile electronic device such as a smartphone, a tablet computer, a palmtop computer, and a notebook computer, or may be a mobile electronic device. Desktop computers, TVs and other stationary electronic equipment.

如上,本申请所提供的电子设备至少包括摄像头110、前置图像信号处理器120以及应用处理器130。As above, the electronic device provided by this application at least includes the camera 110 , the front image signal processor 120 and the application processor 130 .

摄像头110由多部分组成,主要包括镜头、马达以及图像传感器等。其中,镜头用于将外界的光信号投射至图像传感器;图像传感器用于将镜头投射的光信号进行光电转换,将光信号转换为可用的电信号,得到原始的图像数据;而马达用于驱动镜头移动,从而调整镜头和图像传感器之间的距离,以满足成像公式(或称透镜成像公式、高斯成像公式等),使得成像清晰。The camera 110 is composed of multiple parts, mainly including a lens, a motor, and an image sensor. Among them, the lens is used to project the external light signal to the image sensor; the image sensor is used to photoelectrically convert the light signal projected by the lens to convert the light signal into a usable electrical signal to obtain the original image data; and the motor is used to drive The lens moves, thereby adjusting the distance between the lens and the image sensor to satisfy the imaging formula (or lens imaging formula, Gaussian imaging formula, etc.), so that the image is clear.

基于摄像头110的硬件能力,在本申请实施例中,摄像头110被配置为采集拍摄场景的场景图像。其中,拍摄场景可以理解为摄像头110在使能后所对准的场景,即摄像头110能够将光信号转换为对应图像数据的场景。比如,电子设备在根据用户操作使能摄像头110之后,若用户控制电子设备100的摄像头110对准一包括某对象的场景,则包括该对象的场景即为摄像头110的拍摄场景。Based on the hardware capability of the camera 110, in this embodiment of the present application, the camera 110 is configured to collect a scene image of a shooting scene. The shooting scene can be understood as the scene that the camera 110 is aimed at after being enabled, that is, the scene where the camera 110 can convert the light signal into corresponding image data. For example, after the electronic device enables the camera 110 according to the user operation, if the user controls the camera 110 of the electronic device 100 to aim at a scene including an object, the scene including the object is the shooting scene of the camera 110 .

根据以上描述,本领域普通技术人员应当理解的是,拍摄场景并非特指某一特定场景,而是跟随摄像头110的指向所实时对准的场景。通常的,拍摄场景并不仅仅包括单一的对象,其中可能存在各种各样的对象。比如,当在某拍摄场景进行人像的拍摄时,摄像头110的拍摄场景中不仅包括拍摄的“目标人物”,还可能存在草地、树木、建筑物等其他对象。According to the above description, those skilled in the art should understand that the shooting scene does not refer to a specific scene, but a scene that is aimed in real time following the direction of the camera 110 . Usually, the shooting scene does not include only a single object, and various objects may exist in it. For example, when shooting a portrait in a shooting scene, the shooting scene of the camera 110 includes not only the "target person" to be shot, but also other objects such as grass, trees, and buildings.

通常的,特定的对象存在特定的颜色,比如天空通常为蓝色,云朵通常为白色,消防栓通常为红色等。基于此,本申请实施例中,预先根据经验为不同的对象分配有与之对应的颜色,记为预分配颜色向量,由此建立对象和预分配颜色向量的对应关系。由此,可以对拍摄场景中的对象进行识别,并利用对象和预分配颜色向量的对象关系,将拍摄场景中的对象的预分配颜色向量,与该对象在拍摄出的白平衡之后的图像中的颜色进行对比,从而根据对比结果即可判断白平衡是否出现异常,也即判断白平衡之后的图像是否存色偏。基于此,前置图像信号处理器120被配置为按照配置的识别策略,根据场景图像识别拍摄场景中存在的对象。此处对识别策略的配置不作具体限制,可由本领域普通技术人员根据实际需要进行配置,包括但不限于基于目标的对象识别方式以及基于人工智能的对象识别方式等。比如,请参照图2,示出了一场景图像,前置图像信号处理器120通过对该场景图像进行识别,识别出了相应拍摄场景中存在的一对象“消防栓”。Usually, a specific object has a specific color, such as the sky is usually blue, the clouds are usually white, and the fire hydrant is usually red. Based on this, in the embodiments of the present application, different objects are assigned colors corresponding to them in advance based on experience, which are denoted as pre-assigned color vectors, thereby establishing a correspondence between objects and pre-assigned color vectors. In this way, the object in the shooting scene can be identified, and the pre-assigned color vector of the object in the shooting scene can be compared with the object in the photographed image after white balance by using the object relationship between the object and the pre-assigned color vector. Then, according to the comparison result, it can be judged whether the white balance is abnormal, that is, it can be judged whether the image after the white balance has a color cast. Based on this, the front image signal processor 120 is configured to identify objects existing in the shooting scene according to the scene image according to the configured identification strategy. The configuration of the recognition strategy is not specifically limited here, and can be configured by those of ordinary skill in the art according to actual needs, including but not limited to target-based object recognition methods and artificial intelligence-based object recognition methods. For example, please refer to FIG. 2 , which shows a scene image, and the front image signal processor 120 recognizes an object "fire hydrant" existing in the corresponding shooting scene by identifying the scene image.

应用处理器130按照配置的白平衡策略,对前述场景图像进行白平衡校正,得到白平衡校正后的场景图像,记为校正图像。此处对白平衡策略的配置不作具体限制,可由本领域普通技术人员根据实际需要进行配置,包括但不限于基于灰度世界的白平衡校正方式以及基于色温估计的白平衡校正方式等。The application processor 130 performs white balance correction on the aforementioned scene image according to the configured white balance strategy, and obtains a scene image after the white balance correction, which is recorded as a corrected image. The configuration of the white balance strategy is not specifically limited here, and can be configured by those of ordinary skill in the art according to actual needs, including but not limited to white balance correction methods based on grayscale world and white balance correction methods based on color temperature estimation.

应用处理器130还被配置为获取识别到的拍摄场景中的对象在校正图像中的颜色向量;以及根据对象和预分配颜色向量的对应关系,获取拍摄场景中的对象所对应的预分配颜色向量;以及判断拍摄场景中对象的颜色向量与预分配颜色向量是否存在色偏;以及在拍摄场景中对象的颜色向量与预分配颜色向量存在色偏时,根据拍摄场景中对象的颜色向量与预分配颜色向量的色偏对校正图像进行颜色还原处理,以消除色偏,并将颜色还原处理后的校正图像记为还原图像。The application processor 130 is further configured to obtain the color vector of the object in the identified shooting scene in the corrected image; and obtain the pre-assigned color vector corresponding to the object in the shooting scene according to the correspondence between the object and the pre-assigned color vector. and judge whether the color vector of the object in the shooting scene and the pre-assigned color vector have color shift; and when the color vector of the object in the shooting scene and the pre-assigned color vector have color shift, according to the color vector of the object in the shooting scene and the pre-assigned color vector Color shift of color vector Perform color restoration processing on the corrected image to eliminate color shift, and record the corrected image after color restoration processing as a restored image.

由上可知,本申请提供的电子设备100包括摄像头110、前置图像信号处理器120以及应用处理器130。其中,通过摄像头110采集拍摄场景的场景图像,以及通过前置图像信号处理器120利用场景图像识别拍摄场景中存在的对象,以及通过应用处理器130对场景图像进行白平衡校正,得到校正图像,以及当拍摄场景中的对象在校正图像中的颜色向量与该对象的预分配颜色向量存在色偏时,通过应用处理器130对校正图像进行颜色还原处理,得到还原图像。以此,通过识别白平衡结果存在的色偏,并相应进行颜色还原处理,能够确保电子设备100色彩还原能力的稳定性。As can be seen from the above, the electronic device 100 provided by the present application includes a camera 110 , a front image signal processor 120 and an application processor 130 . Wherein, the scene image of the shooting scene is collected by the camera 110, and the objects existing in the shooting scene are identified by using the scene image by the front image signal processor 120, and the white balance correction is performed on the scene image by the application processor 130 to obtain a corrected image, And when there is a color deviation between the color vector of the object in the shooting scene in the corrected image and the pre-assigned color vector of the object, the application processor 130 performs color restoration processing on the corrected image to obtain a restored image. In this way, by identifying the color shift existing in the white balance result and performing the color restoration processing accordingly, the stability of the color restoration capability of the electronic device 100 can be ensured.

可选地,在一实施例中,为提升图像处理效率,应用处理器130用于在前置图像信号处理器120根据场景图像识别拍摄场景中存在的对象的同时,对场景图像进行白平衡校正,得到校正图像。Optionally, in an embodiment, in order to improve the efficiency of image processing, the application processor 130 is configured to perform white balance correction on the scene image while the front image signal processor 120 recognizes objects existing in the shooting scene according to the scene image. to get the corrected image.

可选地,在一实施例中,前置图像信号处理器120用于对场景图像进行状态统计,得到应用处理器130进行白平衡校正所需的状态信息;以及对场景图像进行优化处理,得到优化后的场景图像;Optionally, in an embodiment, the pre-image signal processor 120 is configured to perform state statistics on the scene image to obtain the state information required by the application processor 130 to perform white balance correction; and perform optimization processing on the scene image to obtain Optimized scene image;

应用处理器130用于根据状态信息对优化后的场景图像进行白平衡校正,得到校正图像。The application processor 130 is configured to perform white balance correction on the optimized scene image according to the state information to obtain a corrected image.

应当说明的是,在本申请实施例中,前置图像信号处理器120还被配置为对场景图像进行状态统计,以得到应用处理器130进行白平衡校正所需的状态信息。此外,前置图像信号处理器120还被配置为在统计得到应用处理器130进行白平衡校正所需的状态信息之后,按照配置的优化策略,对场景图像进行优化处理,得到优化后的场景图像。此处对优化策略的配置不作具体限制,可由本领域普通技术人员根据前置图像信号处理器120的处理性能以及实际需要进行灵活配置,比如,可以配置优化策略为:通过坏点校正处理和线性化处理对场景图像进行优化。It should be noted that, in this embodiment of the present application, the pre-image signal processor 120 is further configured to perform state statistics on the scene image, so as to obtain state information required by the application processor 130 to perform white balance correction. In addition, the pre-image signal processor 120 is further configured to perform optimization processing on the scene image according to the configured optimization strategy after obtaining the state information required by the application processor 130 to perform white balance correction by statistics to obtain an optimized scene image . The configuration of the optimization strategy is not specifically limited here, and can be flexibly configured by those of ordinary skill in the art according to the processing performance of the pre-image signal processor 120 and actual needs. The optimization process optimizes the scene image.

在统计得到前述状态信息以及优化得到优化后的场景图像之后,前置图像信号处理器120还将前述状态信息以及前述优化后的场景图像传输至应用处理器130。After the aforementioned state information and the optimized scene image obtained through statistics are obtained, the pre-image signal processor 120 also transmits the aforementioned state information and the aforementioned optimized scene image to the application processor 130 .

此外,应用处理器130还被配置为根据前述状态信息对优化后的场景图像进行白平衡校正,得到校正图像。In addition, the application processor 130 is further configured to perform white balance correction on the optimized scene image according to the aforementioned state information to obtain a corrected image.

可选地,在一实施例中,请参照图3,前置图像信号处理器120包括:Optionally, in an embodiment, please refer to FIG. 3 , the pre-image signal processor 120 includes:

图像信号处理单元1201,用于对场景图像进行状态统计,得到应用处理器130进行白平衡校正所需的状态信息;以及对场景图像进行第一次优化处理;The image signal processing unit 1201 is used to perform state statistics on the scene image to obtain the state information required by the application processor 130 to perform white balance correction; and perform the first optimization process on the scene image;

神经网络处理单元1202,用于对第一次优化处理后的场景图像进行第二次优化处理;以及通过对象识别模型对第二次优化处理后的场景图像进行对象识别,以识别出拍摄场景中存在的对象。The neural network processing unit 1202 is used to perform a second optimization process on the scene image after the first optimization process; and perform object recognition on the scene image after the second optimization process through an object recognition model, to identify the object that exists.

如图3所示,前置图像信号处理器120包括图像信号处理单元1201和神经网络处理单元1202。其中,图像信号处理单元1201被配置为对场景图像进行状态统计,以得到应用处理器130进行白平衡校正所需的状态信息。此外,图像信号处理单元1201还被配置为在统计得到应用处理器130进行白平衡校正所需的状态信息之后,对前述场景图像进行第一次优化处理,包括但不限于坏点校正处理、时域降噪处理、3D降噪处理、线性化处理以及黑电平校正处理等基于非人工智能的优化处理方式。当然,还可以包括本申请所未列出的 优化处理方式。As shown in FIG. 3 , the pre-image signal processor 120 includes an image signal processing unit 1201 and a neural network processing unit 1202 . The image signal processing unit 1201 is configured to perform state statistics on the scene image to obtain the state information required by the application processor 130 to perform white balance correction. In addition, the image signal processing unit 1201 is further configured to perform a first optimization process on the aforementioned scene image, including but not limited to dead pixel correction processing, Domain noise reduction processing, 3D noise reduction processing, linearization processing and black level correction processing and other non-artificial intelligence-based optimization processing methods. Of course, optimization processing methods not listed in this application may also be included.

此外,神经网络处理单元1202被配置为对图像信号处理单元1201进行第一次优化处理后的场景图像进行第二次优化处理。其中,神经网络处理单元1202处理图像数据的方式可以是按照行的方式读取数据块,并按照行的方式对数据块进行处理。诸如神经网络处理单元1202按照多行的方式读取数据块,并按照多行的方式对数据块进行处理。可以理解的是,一帧图像数据可以具有多行数据块,即神经网络处理单元1202可以对一帧图像数据的一部分诸如n行数据块进行处理,其中n为正整数,诸如2、4、5等。当神经网络处理单元1202对一帧图像数据未全部处理完,则神经网络处理单元1202可以内置缓存来存储神经网络处理单元1202在处理一帧图像数据过程中所处理多行数据块的数据。In addition, the neural network processing unit 1202 is configured to perform a second optimization process on the scene image after the image signal processing unit 1201 performs the first optimization process. The manner in which the neural network processing unit 1202 processes the image data may be to read data blocks in a row manner, and process the data blocks in a row manner. For example, the neural network processing unit 1202 reads the data block in a multi-line manner, and processes the data block in a multi-line manner. It can be understood that one frame of image data may have multiple rows of data blocks, that is, the neural network processing unit 1202 may process a part of one frame of image data, such as n rows of data blocks, where n is a positive integer, such as 2, 4, 5 Wait. When the neural network processing unit 1202 has not completely processed a frame of image data, the neural network processing unit 1202 may have a built-in cache to store the data of the multi-line data blocks processed by the neural network processing unit 1202 in the process of processing one frame of image data.

需要说明的是,神经网络处理单元1202在数据流中,可以按照预设时间处理完成。预设时间诸如为30fps=33ms(毫秒)。或者说神经网络处理单元1202处理一帧图像所预设的时间为33ms,从而可以保证神经网络处理单元1202在快速处理图像数据的基础上,可以实现数据的实时传输。It should be noted that, in the data stream, the neural network processing unit 1202 can complete the processing according to the preset time. The preset time is, for example, 30fps=33ms (milliseconds). In other words, the preset time for the neural network processing unit 1202 to process one frame of image is 33ms, which can ensure that the neural network processing unit 1202 can realize real-time data transmission on the basis of rapidly processing image data.

神经网络处理单元1202进行的第二优化处理包括但不限于基于诸如夜景算法、HDR算法、虚化算法、降噪算法、超分辨率算法等基于人工智能的优化处理方式。当然,还可以包括本申请所未列出的优化处理方式。The second optimization processing performed by the neural network processing unit 1202 includes, but is not limited to, optimization processing methods based on artificial intelligence such as night scene algorithms, HDR algorithms, blurring algorithms, noise reduction algorithms, and super-resolution algorithms. Of course, optimization processing methods not listed in this application may also be included.

由上可知,前置图像信号处理器120进行的优化处理分为两部分,分别为图像信号处理单元1201执行的基于非人工智能的第一次优化处理,和神经网络处理单元1202执行的基于人工智能的第二次优化处理。It can be seen from the above that the optimization process performed by the pre-image signal processor 120 is divided into two parts, namely, the first optimization process based on non-artificial intelligence performed by the image signal processing unit 1201, and the first optimization process based on artificial intelligence performed by the neural network processing unit 1202. Intelligent second optimization processing.

应当说明的是,在本申请实施例中,神经网络处理单元1202还部署有对象识别模型,该对象识别模型被配置为对输入图像中存在的对象进行识别。此处对该对象识别模型的架构以及训练方式不作具体限定,可由本领域普通技术人员根据实际需要进行选择。It should be noted that, in this embodiment of the present application, the neural network processing unit 1202 is further deployed with an object recognition model, and the object recognition model is configured to recognize objects existing in the input image. The architecture and training method of the object recognition model are not specifically limited here, and can be selected by those of ordinary skill in the art according to actual needs.

示例性的,本申请实施例中采用卷积神经网络模型作为训练对象识别模型的基础模型。此外,还获取包括不同对象(比如,可优先选取具有特定颜色的对象)的样本图像,并人工标定样本图像中存在对象的对象标签。之后,利用获取样本对象以及相应标定得到的对象标签,对卷积神经网络模型进行有监督的训练,直至卷积神经网络模型收敛,并将收敛的卷积神经网络模型作为用于对象识别的对象识别模型。Exemplarily, in the embodiments of the present application, a convolutional neural network model is used as the basic model for training the object recognition model. In addition, sample images including different objects (for example, objects with a specific color may be preferentially selected) are also acquired, and object labels of objects existing in the sample images are manually marked. After that, the convolutional neural network model is supervised by using the obtained sample objects and the correspondingly calibrated object labels until the convolutional neural network model converges, and the converged convolutional neural network model is used as the object for object recognition. Identify the model.

可选地,在一实施例中,应用处理器130用于从前述对象在校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将采样像素点的颜色向量作为前述对象的颜色向量;以及计算前述颜色向量与预分配颜色向量的向量差异,并根据计算得到的向量差异判断前述对象的颜色向量与预分配颜色向量是否存在色偏。Optionally, in one embodiment, the application processor 130 is configured to determine sampling pixels for color sampling from the aforementioned objects in the object area in the corrected image, and use the color vectors of the sampling pixels as the color vectors of the aforementioned objects. color vector; and calculating the vector difference between the aforementioned color vector and the pre-assigned color vector, and judging whether there is a color shift between the aforementioned object's color vector and the pre-assigned color vector according to the calculated vector difference.

本申请实施例中,对识别到拍摄场景中的对象进行颜色采样,并利用采样得到的颜色向量识别白平衡校正结果是否存在色偏。In the embodiment of the present application, color sampling is performed on the identified object in the shooting scene, and the color vector obtained by sampling is used to identify whether there is a color shift in the white balance correction result.

其中,应用处理器130首先从前述对象在校正图像中的对象区域内确定出用于颜色采样的采样像素点。此处对采样像素点的选取不作具体限制,可由本领域普通技术人员根据需要进行选取。比如,可以将位于前述对象在校正图像中的对象区域的几何中心的像素点作为采样像素点,也可以随机从前述对象在校正图像的对象区域内选取一像素点作为采样像素点。Wherein, the application processor 130 firstly determines the sampling pixel points for color sampling from the aforementioned object in the object area in the corrected image. The selection of sampling pixel points is not specifically limited here, and can be selected by those of ordinary skill in the art as required. For example, the pixel point located at the geometric center of the object area in the corrected image may be used as the sampling pixel point, or a pixel point may be randomly selected from the aforementioned object in the object area of the corrected image as the sampling pixel point.

在确定出用于颜色采样的采样像素点之后,应用处理器130将该采样像素点的颜色向量作为前述对象的颜色向量。比如,请参照图4,示出了一拍摄场景的场景图像,根据该场景图像,前置图像信号处理器120识别出拍摄场景中存在的一对象“消防栓”,应用处理器130将该对象“消防栓”在图示场景图像中图像区域的几何中心的像素点确定为采样像素点,并将该采样像素点的颜色向量作为对象“消防栓”的颜色向量。After determining the sampled pixel points for color sampling, the application processor 130 uses the color vector of the sampled pixel point as the color vector of the aforementioned object. For example, please refer to FIG. 4, which shows a scene image of a shooting scene. According to the scene image, the front image signal processor 120 identifies an object "fire hydrant" existing in the shooting scene, and the application processor 130 uses the object The pixel point of the geometric center of the image area of the "fire hydrant" in the illustrated scene image is determined as the sampling pixel point, and the color vector of the sampling pixel point is used as the color vector of the object "fire hydrant".

如上,应用处理器130在采样得到前述对象的颜色向量之后,进一步计算前述对象的 颜色向量与其预分配颜色向量的向量差异,可以表示为:As above, after sampling the color vector of the aforementioned object, the application processor 130 further calculates the vector difference between the color vector of the aforementioned object and its pre-allocated color vector, which can be expressed as:

r 3=(r 1-r 2)/256; r 3 =(r 1 -r 2 )/256;

g 3=(g 1-g 2)/256; g 3 =(g 1 -g 2 )/256;

b 3=(b 1-b 2)/256; b 3 =(b 1 -b 2 )/256;

Figure PCTCN2021128536-appb-000001
Figure PCTCN2021128536-appb-000001

其中,diff表示前述对象的颜色向量与其预分配颜色向量的向量差异,r 1表示前述预分配颜色向量在红色通道的分量值,g 1表示前述预分配颜色向量在绿色通道的分量值,b 1表示前述预分配颜色向量在蓝色通道的分量值,r 2表示前述颜色向量在红色通道的分量值,g 2表示前述颜色向量在绿色通道的分量值,b 2表示前述颜色向量在蓝色通道的分量值。 where diff represents the vector difference between the color vector of the aforementioned object and its pre-assigned color vector, r 1 represents the component value of the aforementioned pre-assigned color vector in the red channel, g 1 represents the component value of the aforementioned pre-assigned color vector in the green channel, b 1 represents the component value of the aforementioned pre-assigned color vector in the blue channel, r 2 represents the component value of the aforementioned color vector in the red channel, g 2 represents the component value of the aforementioned color vector in the green channel, and b 2 represents the aforementioned color vector in the blue channel. component value.

如上,应用处理器130在计算得到前述对象的颜色向量与其预分配颜色向量的向量差异之后,即可根据计算得到的向量差异判断前述对象的颜色向量与预分配颜色向量是否存在色偏。As above, after calculating the vector difference between the color vector of the object and the pre-assigned color vector, the application processor 130 can determine whether there is a color shift between the color vector of the object and the pre-assigned color vector according to the calculated vector difference.

比如,可以预先配置用于判定存在色偏的差异阈值,相应的,通过比较该前述向量差异是否大于或等于差异阈值,根据比较结果即可判定是否存在色偏。其中,若前述向量差异大于或等于差异阈值,则判定前述颜色向量与前述预分配颜色向量存在色偏(通过前述颜色向量和前述预分配颜色向量的差值向量表征),若前述向量差异小于差异阈值,则判定前述颜色向量与前述预分配颜色向量不存在色偏。For example, a difference threshold for determining the presence of color shift may be pre-configured, and accordingly, by comparing whether the aforementioned vector difference is greater than or equal to the difference threshold, it can be determined whether there is color shift according to the comparison result. Wherein, if the aforementioned vector difference is greater than or equal to the difference threshold, it is determined that there is a color deviation between the aforementioned color vector and the aforementioned pre-assigned color vector (represented by the difference vector between the aforementioned color vector and the aforementioned pre-assigned color vector), if the aforementioned vector difference is less than the difference. If the threshold is set, it is determined that there is no color shift between the aforementioned color vector and the aforementioned pre-assigned color vector.

应当说明的是,本申请实施例中对于差异阈值的取值不作具体限制,可由本领域普通技术人员根据实际需要进行配置,可以将差异阈值配置为一固定值,也可以动态确定差异阈值的取值。It should be noted that the value of the difference threshold is not specifically limited in the embodiments of the present application, and can be configured by those of ordinary skill in the art according to actual needs. The difference threshold may be configured as a fixed value, or the value of the difference threshold may be dynamically determined. value.

可选地,在一实施例中,应用处理器130用于基于前述颜色向量与前述预分配颜色向量的色偏方向确定差异阈值,并基于该差异阈值以及前述向量差异来判断前述颜色向量与前述预分配颜色向量是否存在色偏。Optionally, in one embodiment, the application processor 130 is configured to determine a difference threshold based on the color shift direction of the aforementioned color vector and the aforementioned pre-assigned color vector, and to judge the aforementioned color vector and the aforementioned color vector based on the difference threshold and the aforementioned vector difference. Whether there is a color cast in the pre-allocated color vector.

在本申请实施例中,考虑人眼对不同颜色的敏感程度不同,利用色偏方向动态确定差异阈值的取值。In the embodiment of the present application, considering that the sensitivity of human eyes to different colors is different, the color shift direction is used to dynamically determine the value of the difference threshold.

其中,针对于不同的预分配颜色向量,根据人眼对不同颜色的敏感程度,本申请实施例中预先建立与每一预分配颜色向量关联的色偏方向和差异阈值的对应关系。比如,请参照图5,图中的椭圆即代表了预分配颜色向量关联的色偏方向与差异阈值的对应关系,其中,存在18个椭圆,即代表了18种预分配颜色向量各自关联的色偏方向与差异阈值的对应关系。以其中编号为“7”的椭圆为例,对于该椭圆关联的预分配颜色向量,当色偏方向为偏向蓝色或者红色时所对应的差异阈值,明显大于色偏方向为偏向绿色时所对应的差异阈值,因为人眼对绿色更为敏感。Wherein, for different pre-assigned color vectors, according to the sensitivity of the human eye to different colors, in the embodiment of the present application, the corresponding relationship between the color shift direction and the difference threshold associated with each pre-assigned color vector is pre-established. For example, please refer to Figure 5. The ellipse in the figure represents the corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vectors. There are 18 ellipses, which represent the colors associated with each of the 18 pre-assigned color vectors. The correspondence between the bias direction and the difference threshold. Taking the ellipse numbered "7" as an example, for the pre-assigned color vector associated with the ellipse, the difference threshold corresponding to when the color shift direction is biased towards blue or red is significantly larger than that corresponding to when the color shift direction is biased towards green. , because the human eye is more sensitive to green.

如上,基于建立的与预分配颜色向量关联的色偏方向和差异阈值的对应关系,应用处理器130在进行色偏的识别时,首先确定识别出的拍摄场景中的对象的颜色向量相较于其预分配颜色向量的色偏方向,然后根据与该预分配颜色向量关联的色偏方向与差异阈值的对应关系,确定出与前述颜色向量的色偏方向所对应的差异阈值,然后再判断前述颜色向量的向量差异是否大于或等于前述色偏方向对应的差异阈值,其中,若前述颜色向量的向量差异大于或等于前述色偏方向对应的差异阈值,则判定前述颜色向量与前述预分配颜色向量存在色偏(此处采用前述向量差异和色偏方向进行表征),否则判定前述颜色向量与前述预分配颜色向量不存色偏。As above, based on the established correspondence between the color shift direction and the difference threshold associated with the pre-assigned color vector, when the application processor 130 identifies the color shift, it first determines that the color vector of the identified object in the shooting scene is compared with It pre-allocates the color shift direction of the color vector, and then determines the difference threshold corresponding to the color shift direction of the aforementioned color vector according to the corresponding relationship between the color shift direction associated with the pre-assigned color vector and the difference threshold, and then judges the aforementioned Whether the vector difference of the color vectors is greater than or equal to the difference threshold corresponding to the aforementioned color shift direction, wherein, if the vector difference of the aforementioned color vector is greater than or equal to the aforementioned difference threshold corresponding to the aforementioned color shift direction, it is determined that the aforementioned color vector and the aforementioned pre-assigned color vector There is a color shift (here, the aforementioned vector difference and color shift direction are used to characterize), otherwise, it is determined that there is no color shift between the aforementioned color vector and the aforementioned pre-assigned color vector.

比如,请参照图6,应用处理器130通过对图示拍摄场景中的对象“消防栓”进行色偏识别,判定该对象“消防栓”的颜色向量与其预分配颜色向量存在色偏,图示箭头即表征了该色偏,其中,箭头的指向表征了色偏方向,箭头的长度表征了差异阈值,即长度越 长,差异阈值越大。For example, referring to FIG. 6 , the application processor 130 determines that the color vector of the object "fire hydrant" and its pre-assigned color vector have a color shift by identifying the color shift of the object "fire hydrant" in the shooting scene shown in the figure. The arrow represents the color shift, wherein the direction of the arrow represents the color shift direction, and the length of the arrow represents the difference threshold, that is, the longer the length, the greater the difference threshold.

可选地,在一实施例中,应用处理器130用于计算前述颜色向量与预分配颜色向量的差值向量,并将前述差值向量作为采样像素点的色偏向量;以及根据采样像素点的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量;以及根据校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到还原图像。Optionally, in one embodiment, the application processor 130 is configured to calculate the difference vector between the aforementioned color vector and the pre-assigned color vector, and use the aforementioned difference vector as the color shift vector of the sampling pixel; and according to the sampling pixel Perform interpolation processing on the color shift vector of the corrected image to obtain the color shift vector of the non-sampling pixel in the corrected image; and perform color restoration processing on each pixel according to the color shift vector of each pixel in the corrected image to obtain a restored image.

本申请实施例中,应用处理器130被配置为计算前述颜色向量与前述预分配颜色向量的差值向量,将该差值向量作为采样像素点的色偏向量。然后,应用处理器130按照预先配置的插值策略,根据采样像素点的色偏向量插值得到校正图像中非采样像素点的色偏向量。至此,校正图像中包括采样像素点和非采样像素点在内的所有像素点的色偏向量均已知,即可根据校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,从而得到还原图像。In this embodiment of the present application, the application processor 130 is configured to calculate a difference vector between the foregoing color vector and the foregoing pre-assigned color vector, and use the difference vector as a color shift vector of the sampling pixel. Then, according to a preconfigured interpolation strategy, the application processor 130 interpolates according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image. So far, the color shift vectors of all pixels in the corrected image, including sampling pixels and non-sampling pixels, are known, and each pixel can be color-coded according to the color shift vector of each pixel in the corrected image. Restoration processing to obtain a restored image.

以上本申请实施例中进行的插值处理可以理解为通过已知的、离散的像素点的色偏向量,在整个校正图像内推求其它像素点的色偏向量的过程。The interpolation processing performed in the above embodiments of the present application can be understood as a process of estimating the color shift vectors of other pixel points in the entire corrected image through the known color shift vectors of discrete pixels.

比如,请参照图7,在图7上侧的校正图像中,前置图像信号处理器120共识别出8个不同的对象,图7中示出的黑色实心圆代表对应这些识别出的对象的采样像素点,箭头代表对应的色偏向量。如图7所示,应用处理器130根据采样像素点的色偏向量插值得到校正图像中所有像素点的色偏向量。For example, referring to FIG. 7 , in the corrected image on the upper side of FIG. 7 , the front image signal processor 120 has identified 8 different objects in total, and the black solid circles shown in FIG. 7 represent the objects corresponding to these identified objects. Sampling pixel points, the arrows represent the corresponding color shift vector. As shown in FIG. 7 , the application processor 130 obtains the color shift vectors of all pixels in the corrected image by interpolation according to the color shift vectors of the sampled pixels.

应当说明的是,本申请实施例中对于采用的插值策略不作具体限定,可由本领域普通技术人员根据实际需要进行选取,包括但不限于最近领域插值、双线性插值或者双三次插值等。It should be noted that the interpolation strategy used in the embodiments of the present application is not specifically limited, and can be selected by those of ordinary skill in the art according to actual needs, including but not limited to recent field interpolation, bilinear interpolation, or bicubic interpolation, etc.

可选地,在一实施例中,应用处理器130用于根据采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到非采样像素点的多个候选色偏向量;以及根据多个候选色偏向量,得到非采样像素点的色偏向量;Optionally, in one embodiment, the application processor 130 is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel points, to obtain a plurality of candidate color shift vectors of the non-sampled pixel points; and According to the multiple candidate color shift vectors, the color shift vectors of the non-sampling pixels are obtained;

其中,对于同一非采样像素点,应用处理器130按照不同的插值策略插值时所选择的邻域像素点不同。Wherein, for the same non-sampling pixel point, the neighborhood pixel points selected by the application processor 130 during interpolation according to different interpolation strategies are different.

应当说明的是,本申请实施例中并不采用单一的插值策略进行插值处理,而是融合多种插值策略进行插值处理。此处对于采用何种插值策略,以及插值策略的数量不做具体限制,可由本领域根据应用处理器130的处理能力进行配置。另外,本申请实施例中对于采用何种融合策略也不做具体限制,可由本领域普通技术人员根据实际需要进行配置。It should be noted that, in the embodiment of the present application, a single interpolation strategy is not used for interpolation processing, but multiple interpolation strategies are combined to perform interpolation processing. There is no specific limitation on which interpolation strategy is adopted and the number of interpolation strategies, which can be configured according to the processing capability of the application processor 130 in the art. In addition, the embodiment of the present application does not specifically limit which fusion strategy is adopted, and can be configured by those of ordinary skill in the art according to actual needs.

比如,本申请实施例中预先配置有3种不同的插值策略,分别记为插值策略A、插值策略B以及插值策略C。在进行插值处理时,对于一非采样像素点,应用处理器130根据采样像素点的色偏向量,采用插值策略A插值得到该非采样像素点的候选色偏向量A,采用插值策略B插值得到该非采样像素点的候选色偏向量B,以及采用插值策略C插值得到该非采样像素点的候选色偏向量C。最后,应用处理器130按照配置的融合策略将候选色偏向量A、候选色偏向量B以及候选色偏向量C融合为一个向量,作为该非采样像素点的色偏向量。For example, three different interpolation strategies are pre-configured in the embodiment of the present application, which are denoted as interpolation strategy A, interpolation strategy B, and interpolation strategy C, respectively. During interpolation processing, for a non-sampling pixel point, the application processor 130 uses interpolation strategy A to obtain the candidate color shift vector A of the non-sampling pixel point according to the color shift vector of the sampled pixel point, and obtains the candidate color shift vector A of the non-sampled pixel point by interpolation strategy B. The candidate color shift vector B of the non-sampling pixel point, and the candidate color shift vector C of the non-sampling pixel point obtained by interpolation using an interpolation strategy C. Finally, the application processor 130 fuses the candidate color shift vector A, the candidate color shift vector B, and the candidate color shift vector C into one vector according to the configured fusion strategy, which is used as the color shift vector of the non-sampled pixel point.

可选地,在一实施例中,应用处理器130用于计算多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到非采样像素点的色偏向量;或者Optionally, in one embodiment, the application processor 130 is configured to calculate the average value of the components of the multiple candidate color shift vectors in each dimension, and obtain the color shift of the non-sampling pixel point according to the average value of each dimension component. amount; or

对多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到非采样像素点的色偏向量。Weighted summation is performed on the components of the multiple candidate color shift vectors in each dimension, and the color shift vector of the non-sampling pixel point is obtained according to the weighted sum value of each dimension component.

本申请实施例中进一步提供两种可选地的融合策略。Two optional fusion strategies are further provided in the embodiments of the present application.

其一,对于一非采样像素点,应用处理器130计算其多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到非采样像素点的色偏向量。First, for a non-sampling pixel, the application processor 130 calculates the average value of the components of its multiple candidate color shift vectors in each dimension, and obtains the color shift vector of the non-sampling pixel according to the average value of each dimension component. .

其二,预先为不同的插值策略分配用于加权求和的权重,比如,以权重和值为1为约 束,若一插值策略的精确度越高,则分配的权重越高。对于一非采样像素点,应用处理器130根据每一插值策略对应的权重,对该非采样像素点的多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到该非采样像素点的色偏向量。Second, assign weights for weighted summation to different interpolation strategies in advance. For example, with the weight sum value being 1 as a constraint, if the accuracy of an interpolation strategy is higher, the assigned weight will be higher. For a non-sampling pixel, the application processor 130 performs a weighted summation of the components of the multiple candidate color shift vectors of the non-sampling pixel in each dimension according to the weight corresponding to each interpolation strategy, The weighted sum value of , obtains the color shift vector of the non-sampled pixel point.

可选地,在一实施例中,应用处理器130用于获取前述对象对应的识别置信度,并根据识别置信度对前述采样像素点的色偏向量进行修正处理,得到采样像素点修正后的色偏向量;以及根据采样像素点修正后的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量。Optionally, in one embodiment, the application processor 130 is configured to obtain the recognition confidence level corresponding to the aforementioned object, and perform correction processing on the color shift vector of the aforementioned sampling pixel point according to the recognition confidence level, to obtain the corrected sample pixel point. color shift vector; and performing interpolation processing on the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.

本申请实施例中,根据前置图像信号处理器120识别到对象的识别置信度来决定颜色还原的幅度大小。In the embodiment of the present application, the magnitude of the color restoration is determined according to the recognition confidence of the object recognized by the pre-image signal processor 120 .

其中,应用处理器130首先获取到前置图像信号处理器120识别到拍摄场景中对象的识别置信度,并根据该识别置信度对前述采样像素点的色偏向量进行修正处理,可以表示为:Wherein, the application processor 130 first obtains the recognition confidence of the pre-image signal processor 120 to identify the object in the shooting scene, and performs correction processing on the color shift vector of the aforementioned sampling pixel points according to the recognition confidence, which can be expressed as:

V’=V*α;V'=V*α;

其中,V’表示采样像素点修正后的色偏向量,V表示计算得到的采样像素点的色偏向量,α表示前述对象的识别置信度。Among them, V' represents the corrected color shift vector of the sampled pixel point, V represents the color shift vector of the sampled pixel point obtained by calculation, and α represents the recognition confidence of the aforementioned object.

在完成对前述采样像素点的色偏向量的修正之后,应用处理器130进一步根据前述采样像素点修正后的色偏向量进行插值处理,以此得到校正图像中非采样像素点的色偏向量,具体可参照以上实施例中的相关描述,此处不再赘述。After completing the correction of the color shift vector of the sampling pixel, the application processor 130 further performs interpolation processing according to the corrected color shift vector of the sampling pixel, so as to obtain the color shift vector of the non-sampling pixel in the corrected image, For details, reference may be made to the relevant descriptions in the above embodiments, which will not be repeated here.

本申请实施例还提供一种前置图像信号处理器,该装置包括:The embodiment of the present application also provides a pre-image signal processor, and the device includes:

数据接口,用于从摄像头获取拍摄场景的场景图像;以及将所述场景图像传输至应用处理器进行白平衡校正,并接收所述应用处理器进行白平衡校正后返回的校正图像;a data interface for acquiring a scene image of a shooting scene from a camera; and transmitting the scene image to an application processor for white balance correction, and receiving a corrected image returned after the application processor performs white balance correction;

神经网络处理单元,用于通过对象识别模型对所述场景图像进行识别,以识别出所述拍摄场景中存在的对象;a neural network processing unit, configured to recognize the scene image through an object recognition model, so as to recognize the object existing in the shooting scene;

图像信号处理单元,用于当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。An image signal processing unit, configured to perform color restoration processing on the corrected image according to the color deviation when the color vector of the object in the corrected image and the pre-assigned color vector of the object have a color deviation, to obtain Restore the image.

在一些实施例中,所述图像信号处理单元用于从所述对象在所述校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将所述采样像素点的颜色向量作为所述对象的颜色向量;以及计算所述颜色向量与所述预分配颜色向量的向量差异,并根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏。In some embodiments, the image signal processing unit is configured to determine a sampling pixel point for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixel point as a the color vector of the object; and calculating the vector difference between the color vector and the pre-assigned color vector, and judging whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference.

在一些实施例中,所述图像信号处理单元用于基于所述颜色向量与所述预分配颜色向量的色偏方向确定差异阈值,并基于所述差异阈值以及所述向量差异来判断所述颜色向量与所述预分配颜色向量是否存在色偏。In some embodiments, the image signal processing unit is configured to determine a difference threshold based on the color shift direction between the color vector and the pre-assigned color vector, and determine the color based on the difference threshold and the vector difference Whether there is a color shift between the vector and the pre-assigned color vector.

在一些实施例中,所述图像信号处理单元用于计算所述颜色向量与所述预分配颜色向量的差值向量,并将所述差值向量作为所述采样像素点的色偏向量;以及根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量;以及根据所述校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到所述还原图像。In some embodiments, the image signal processing unit is configured to calculate a difference vector between the color vector and the pre-assigned color vector, and use the difference vector as a color shift vector of the sampling pixel; and Perform interpolation processing according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image; A color restoration process is performed to obtain the restored image.

在一些实施例中,所述图像信号处理单元用于根据所述采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到所述非采样像素点的多个候选色偏向量;以及根据所述多个候选色偏向量,得到所述非采样像素点的色偏向量。In some embodiments, the image signal processing unit is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vectors of the sampled pixels to obtain multiple candidate color shift vectors of the non-sampled pixels ; and obtaining the color shift vector of the non-sampling pixel point according to the plurality of candidate color shift vectors.

在一些实施例中,所述图像信号处理单元用于获取所述对象对应的识别置信度,并根据所述识别置信度对所述采样像素点的色偏向量进行修正处理,得到所述采样像素点修正后的色偏向量;以及根据所述采样像素点修正后的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量。In some embodiments, the image signal processing unit is configured to obtain the recognition confidence corresponding to the object, and perform correction processing on the color shift vector of the sampling pixel point according to the recognition confidence to obtain the sampling pixel point-corrected color shift vector; and performing interpolation processing according to the corrected color shift vector of the sampled pixel point to obtain the color shift vector of the non-sampled pixel point in the corrected image.

本申请还提供一种前置图像信号处理器,如图8所示,该前置图像信号处理器200包括:The present application also provides a pre-image signal processor. As shown in FIG. 8 , the pre-image signal processor 200 includes:

数据接口210,用于从摄像头获取拍摄场景的场景图像;以及将场景图像传输至应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像;a data interface 210 for acquiring a scene image of the shooting scene from the camera; and transmitting the scene image to the application processor for white balance correction, and receiving the corrected image returned after the application processor performs white balance correction;

神经网络处理单元220,用于通过对象识别模型对场景图像进行识别,以识别出拍摄场景中存在的对象;The neural network processing unit 220 is used to identify the scene image through the object recognition model, to identify the object existing in the shooting scene;

图像信号处理单元230,用于当对象在校正图像中的颜色向量与对象的预分配颜色向量存在色偏时,根据色偏对校正图像进行颜色还原处理,得到还原图像。The image signal processing unit 230 is configured to perform color restoration processing on the corrected image according to the color shift to obtain a restored image when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object.

应当说明的是,本申请提供的前置图像信号处理器可以应用于具备摄像头和应用处理器的电子设备中,用于提高电子设备色彩还原能力。It should be noted that the front image signal processor provided in the present application can be applied to an electronic device having a camera and an application processor to improve the color reproduction capability of the electronic device.

其中,本申请实施例中对于数据接口210的类型不做具体限制,包括但不限于移动产业处理器接口(Mobile Industry Processor Interface,MIPI)以及PCI-E接口等。Wherein, the type of the data interface 210 is not specifically limited in the embodiments of the present application, including but not limited to a mobile industry processor interface (Mobile Industry Processor Interface, MIPI), a PCI-E interface, and the like.

拍摄场景可以理解为摄像头在使能后所对准的场景,即摄像头能够将光信号转换为对应图像数据的场景。比如,电子设备在根据用户操作使能摄像头之后,若用户控制电子设备的摄像头对准一包括某对象的场景,则包括该对象的场景即为摄像头的拍摄场景。The shooting scene can be understood as the scene that the camera is aimed at after being enabled, that is, the scene where the camera can convert the light signal into corresponding image data. For example, after the electronic device enables the camera according to the user operation, if the user controls the camera of the electronic device to aim at a scene including an object, the scene including the object is the shooting scene of the camera.

根据以上描述,本领域普通技术人员应当理解的是,拍摄场景并非特指某一特定场景,而是跟随摄像头的指向所实时对准的场景。通常的,拍摄场景并不仅仅包括单一的对象,其中可能存在各种各样的对象。比如,当在某拍摄场景进行人像的拍摄时,摄像头的拍摄场景中不仅包括拍摄的“目标人物”,还可能存在草地、树木、建筑物等其他对象。From the above description, those of ordinary skill in the art should understand that the shooting scene does not refer to a specific scene, but a scene that is aimed in real time following the direction of the camera. Usually, the shooting scene does not include only a single object, and various objects may exist in it. For example, when shooting a portrait in a shooting scene, the shooting scene of the camera not only includes the "target person", but also other objects such as grass, trees, and buildings.

通常的,特定的对象存在特定的颜色,比如天空通常为蓝色,云朵通常为白色,消防栓通常为红色等。基于此,本申请实施例中,预先根据经验为不同的对象分配有与之对应的颜色,记为预分配颜色向量,由此建立对象和预分配颜色向量的对应关系。由此,可以对拍摄场景中的对象进行识别,并利用对象和预分配颜色向量的对象关系,将拍摄场景中的对象的预分配颜色向量,与该对象在拍摄出的白平衡之后的图像中的颜色进行对比,从而根据对比结果即可判断白平衡是否出现异常,也即判断白平衡之后的图像是否存色偏。基于此,数据接口210被配置为从摄像头获取拍摄场景的场景图像。Usually, a specific object has a specific color, such as the sky is usually blue, the clouds are usually white, and the fire hydrant is usually red. Based on this, in the embodiments of the present application, different objects are assigned colors corresponding to them in advance based on experience, which are denoted as pre-assigned color vectors, thereby establishing a correspondence between objects and pre-assigned color vectors. In this way, the object in the shooting scene can be identified, and the pre-assigned color vector of the object in the shooting scene can be compared with the object in the photographed image after white balance by using the object relationship between the object and the pre-assigned color vector. Then, according to the comparison result, it can be judged whether the white balance is abnormal, that is, it can be judged whether the image after the white balance has a color cast. Based on this, the data interface 210 is configured to acquire the scene image of the shooting scene from the camera.

应当说明的是,在本申请实施例中,神经网络处理单元220部署有对象识别模型,该对象识别模型被配置为对输入图像中存在的对象进行识别。此处对该对象识别模型的架构以及训练方式不作具体限定,可由本领域普通技术人员根据实际需要进行选择。It should be noted that, in this embodiment of the present application, the neural network processing unit 220 is deployed with an object recognition model, and the object recognition model is configured to recognize objects existing in the input image. The architecture and training method of the object recognition model are not specifically limited here, and can be selected by those of ordinary skill in the art according to actual needs.

示例性的,本申请实施例中采用卷积神经网络模型作为训练对象识别模型的基础模型。此外,还获取包括不同对象(比如,可优先选取具有特定颜色的对象)的样本图像,并人工标定样本图像中存在对象的对象标签。之后,利用获取样本对象以及相应标定得到的对象标签,对卷积神经网络模型进行有监督的训练,直至卷积神经网络模型收敛,并将收敛的卷积神经网络模型作为用于对象识别的对象识别模型。Exemplarily, in the embodiments of the present application, a convolutional neural network model is used as the basic model for training the object recognition model. In addition, sample images including different objects (for example, objects with a specific color may be preferentially selected) are also acquired, and object labels of objects existing in the sample images are manually marked. After that, the convolutional neural network model is supervised by using the obtained sample objects and the correspondingly calibrated object labels until the convolutional neural network model converges, and the converged convolutional neural network model is used as the object for object recognition. Identify the model.

相应的,神经网络处理单元220被配置为通过对象识别模型对场景图像进行识别,以识别出拍摄场景中存在的对象。Correspondingly, the neural network processing unit 220 is configured to recognize the scene image through the object recognition model, so as to recognize the object existing in the shooting scene.

比如,请参照图2,示出了一场景图像,前置图像信号处理器200通过神经网络处理单元220对该场景图像进行识别,识别出了相应拍摄场景中存在的一对象“消防栓”。For example, please refer to FIG. 2 , which shows a scene image. The pre-image signal processor 200 recognizes the scene image through the neural network processing unit 220, and identifies an object "fire hydrant" in the corresponding shooting scene.

此外,数据接口210还被配置为将场景图像传输应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像。In addition, the data interface 210 is further configured to transmit the scene image to the application processor to perform white balance correction, and to receive the corrected image returned after the application processor performs the white balance correction.

其中,应用处理器按照配置的白平衡策略,对前述场景图像进行白平衡校正,得到白平衡校正后的场景图像,记为校正图像。此处对白平衡策略的配置不作具体限制,可由本领域普通技术人员根据实际需要进行配置,包括但不限于基于灰度世界的白平衡校正方式以及基于色温估计的白平衡校正方式等。在校正得到校正图像之后,将该校正图像返回至 数据接口210。The application processor performs white balance correction on the aforementioned scene image according to the configured white balance strategy, and obtains the scene image after the white balance correction, which is recorded as a corrected image. The configuration of the white balance strategy is not specifically limited here, and can be configured by those of ordinary skill in the art according to actual needs, including but not limited to white balance correction methods based on grayscale world and white balance correction methods based on color temperature estimation. After the corrected image is obtained from the correction, the corrected image is returned to the data interface 210.

图像信号处理单元被配置为获取识别到的拍摄场景中的对象在校正图像中的颜色向量;以及根据对象和预分配颜色向量的对应关系,获取拍摄场景中的对象所对应的预分配颜色向量;以及判断拍摄场景中对象的颜色向量与预分配颜色向量是否存在色偏;以及在拍摄场景中对象的颜色向量与预分配颜色向量存在色偏时,根据拍摄场景中对象的颜色向量与预分配颜色向量的色偏对校正图像进行颜色还原处理,以消除色偏,并将颜色还原处理后的校正图像记为还原图像。The image signal processing unit is configured to obtain the identified color vector of the object in the shooting scene in the corrected image; and obtain the pre-assigned color vector corresponding to the object in the shooting scene according to the correspondence between the object and the pre-assigned color vector; And judge whether the color vector of the object in the shooting scene and the pre-assigned color vector have color shift; The color cast of the vector performs color restoration processing on the corrected image to eliminate the color cast, and records the corrected image after the color restoration processing as the restored image.

由上可知,本申请提供的前置图像信号处理器200,通过数据接口210从摄像头获取拍摄场景的场景图像;以及将场景图像传输至应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像;通过神经网络处理单元220基于对象识别模型对场景图像进行识别,以识别出拍摄场景中存在的对象;以及通过图像信号处理单元230当对象在校正图像中的颜色向量与对象的预分配颜色向量存在色偏时,根据色偏对校正图像进行颜色还原处理,得到还原图像。以此,通过识别白平衡结果存在的色偏,并相应进行颜色还原处理,能够提高电子设备的色彩还原能力。It can be seen from the above that the front image signal processor 200 provided by this application obtains the scene image of the shooting scene from the camera through the data interface 210; and transmits the scene image to the application processor for white balance correction, and receives the application processor for white balance correction. The corrected image returned after the balance correction; the scene image is recognized based on the object recognition model by the neural network processing unit 220 to identify the object existing in the shooting scene; and the color vector of the object in the corrected image by the image signal processing unit 230 When there is a color shift from the pre-assigned color vector of the object, the corrected image is subjected to color restoration processing according to the color shift to obtain a restored image. In this way, by identifying the color shift existing in the white balance result, and performing color restoration processing accordingly, the color restoration capability of the electronic device can be improved.

可选地,在一实施例中,图像信号处理单元230用于对场景图像进行状态统计,得到应用处理器进行白平衡校正所需的状态信息;Optionally, in an embodiment, the image signal processing unit 230 is configured to perform state statistics on the scene image to obtain state information required by the application processor to perform white balance correction;

数据接口210用于将前述状态信息以及场景图像传输至应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像。The data interface 210 is used to transmit the aforementioned status information and the scene image to the application processor for white balance correction, and receive the corrected image returned after the application processor performs the white balance correction.

应当说明的是,在本申请实施例中,图像信号处理单元230还被配置为对场景图像进行状态统计,以得到应用处理器进行白平衡校正所需的状态信息。此外,数据接口210被配置为将前述状态信息以及前述场景图像传输至应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像。It should be noted that, in this embodiment of the present application, the image signal processing unit 230 is further configured to perform state statistics on the scene image, so as to obtain state information required by the application processor to perform white balance correction. In addition, the data interface 210 is configured to transmit the aforementioned status information and the aforementioned scene image to the application processor for white balance correction, and to receive the corrected image returned after the application processor performs white balance correction.

可选地,在一实施例中,图像信号处理单元230还用于在统计得到状态信息后,对场景图像进行第一次优化处理;Optionally, in an embodiment, the image signal processing unit 230 is further configured to perform a first optimization process on the scene image after obtaining the state information from statistics;

神经网络处理单元220还用于对第一次优化处理后的场景图像进行第二次优化处理;The neural network processing unit 220 is further configured to perform a second optimization process on the scene image after the first optimization process;

数据接口210用于将前述状态信息以及第二次优化处理后的场景图像传输至应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像。The data interface 210 is used to transmit the foregoing status information and the scene image after the second optimization process to the application processor for white balance correction, and receive the corrected image returned after the application processor performs white balance correction.

图像信号处理单元230还被配置为在统计得到应用处理器进行白平衡校正所需的状态信息之后,对前述场景图像进行第一次优化处理,包括但不限于坏点校正处理、时域降噪处理、3D降噪处理、线性化处理以及黑电平校正处理等基于非人工智能的优化处理方式。当然,还可以包括本申请所未列出的优化处理方式。The image signal processing unit 230 is further configured to perform a first optimization process on the aforementioned scene image, including but not limited to dead pixel correction processing, temporal noise reduction, after the state information required by the application processor to perform white balance correction is statistically obtained. Processing, 3D noise reduction processing, linearization processing and black level correction processing and other non-artificial intelligence-based optimization processing methods. Of course, optimization processing methods not listed in this application may also be included.

此外,神经网络处理单元220被配置为对图像信号处理单元230进行第一次优化处理后的场景图像进行第二次优化处理。其中,神经网络处理单元220处理图像数据的方式可以是按照行的方式读取数据块,并按照行的方式对数据块进行处理。诸如神经网络处理单元220按照多行的方式读取数据块,并按照多行的方式对数据块进行处理。可以理解的是,一帧图像数据可以具有多行数据块,即神经网络处理单元220可以对一帧图像数据的一部分诸如n行数据块进行处理,其中n为正整数,诸如2、4、5等。当神经网络处理单元220对一帧图像数据未全部处理完,则神经网络处理单元220可以内置缓存来存储神经网络处理单元220在处理一帧图像数据过程中所处理多行数据块的数据。In addition, the neural network processing unit 220 is configured to perform a second optimization process on the scene image after the image signal processing unit 230 performs the first optimization process. The manner in which the neural network processing unit 220 processes the image data may be to read data blocks in a row manner, and process the data blocks in a row manner. For example, the neural network processing unit 220 reads the data block in a multi-line manner, and processes the data block in a multi-line manner. It can be understood that one frame of image data may have multiple rows of data blocks, that is, the neural network processing unit 220 may process a part of one frame of image data, such as n rows of data blocks, where n is a positive integer, such as 2, 4, and 5. Wait. When the neural network processing unit 220 has not finished processing a frame of image data, the neural network processing unit 220 may have a built-in cache to store the data of the multi-line data blocks processed by the neural network processing unit 220 in the process of processing one frame of image data.

需要说明的是,神经网络处理单元220在数据流中,可以按照预设时间处理完成。预设时间诸如为30fps=33ms(毫秒)。或者说神经网络处理单元220处理一帧图像所预设的时间为33ms,从而可以保证神经网络处理单元220在快速处理图像数据的基础上,可以实现数据的实时传输。It should be noted that, in the data stream, the neural network processing unit 220 can complete the processing according to the preset time. The preset time is, for example, 30fps=33ms (milliseconds). In other words, the preset time for the neural network processing unit 220 to process one frame of image is 33ms, which can ensure that the neural network processing unit 220 can realize real-time data transmission on the basis of fast processing image data.

神经网络处理单元220进行的第二优化处理包括但不限于基于诸如夜景算法、HDR算 法、虚化算法、降噪算法、超分辨率算法等基于人工智能的优化处理方式。当然,还可以包括本申请所未列出的优化处理方式。The second optimization processing performed by the neural network processing unit 220 includes, but is not limited to, optimization processing methods based on artificial intelligence such as night scene algorithms, HDR algorithms, blurring algorithms, noise reduction algorithms, and super-resolution algorithms. Of course, optimization processing methods not listed in this application may also be included.

由上可知,前置图像信号处理器200分别通过图像信号处理单元230和神经网络处理单元220进行两次优化处理,分别为图像信号处理单元230执行的基于非人工智能的第一次优化处理,和神经网络处理单元220执行的基于人工智能的第二次优化处理。It can be seen from the above that the pre-image signal processor 200 performs two optimization processes through the image signal processing unit 230 and the neural network processing unit 220 respectively, which are the first optimization process based on non-artificial intelligence performed by the image signal processing unit 230 respectively, and artificial intelligence-based second optimization processing performed by the neural network processing unit 220 .

数据接口210还被配置为将前述状态信息以及第二次优化处理后的场景图像传输至应用处理器进行白平衡校正,并接收应用处理器进行白平衡校正后返回的校正图像。The data interface 210 is further configured to transmit the foregoing status information and the scene image after the second optimization process to the application processor for white balance correction, and receive a corrected image returned after the application processor performs white balance correction.

可选地,在一实施例中,神经网络处理单元220用于通过对象识别模型对第二次优化处理后的场景图像进行对象识别,以识别出拍摄场景中存在的对象。Optionally, in an embodiment, the neural network processing unit 220 is configured to perform object recognition on the scene image after the second optimization process through the object recognition model, so as to recognize the objects existing in the shooting scene.

可选地,在一实施例中,图像信号处理单元230用于从对象在校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将采样像素点的颜色向量作为对象的颜色向量;以及计算颜色向量与预分配颜色向量的向量差异,并根据向量差异判断颜色向量与预分配颜色向量是否存在色偏。Optionally, in one embodiment, the image signal processing unit 230 is configured to determine sampling pixels for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixels as the color of the object. vector; and calculating the vector difference between the color vector and the pre-allocated color vector, and determining whether there is a color shift between the color vector and the pre-allocated color vector according to the vector difference.

本申请实施例中,对识别到拍摄场景中的对象进行颜色采样,并利用采样得到的颜色向量识别白平衡校正结果是否存在色偏。In the embodiment of the present application, color sampling is performed on the identified object in the shooting scene, and the color vector obtained by sampling is used to identify whether there is a color shift in the white balance correction result.

其中,图像信号处理单元230首先从前述对象在校正图像中的对象区域内确定出用于颜色采样的采样像素点。此处对采样像素点的选取不作具体限制,可由本领域普通技术人员根据需要进行选取。比如,可以将位于前述对象在校正图像中的对象区域的几何中心的像素点作为采样像素点,也可以随机从前述对象在校正图像的对象区域内选取一像素点作为采样像素点。Wherein, the image signal processing unit 230 firstly determines the sampling pixel points for color sampling from the aforementioned object in the object area in the corrected image. The selection of sampling pixel points is not specifically limited here, and can be selected by those of ordinary skill in the art as required. For example, the pixel point located at the geometric center of the object area in the corrected image may be used as the sampling pixel point, or a pixel point may be randomly selected from the aforementioned object in the object area of the corrected image as the sampling pixel point.

在确定出用于颜色采样的采样像素点之后,图像信号处理单元230将该采样像素点的颜色向量作为前述对象的颜色向量。比如,请参照图4,示出了一拍摄场景的场景图像,根据该场景图像,前置图像信号处理器200识别出拍摄场景中存在的一对象“消防栓”,图像信号处理单元230将该对象“消防栓”在图示场景图像中图像区域的几何中心的像素点确定为采样像素点,并将该采样像素点的颜色向量作为对象“消防栓”的颜色向量。After determining the sampled pixel points for color sampling, the image signal processing unit 230 uses the color vector of the sampled pixel point as the color vector of the aforementioned object. For example, please refer to FIG. 4, which shows a scene image of a shooting scene. According to the scene image, the front image signal processor 200 recognizes an object "fire hydrant" existing in the shooting scene, and the image signal processing unit 230 will The pixel point of the object "fire hydrant" in the geometric center of the image area in the illustrated scene image is determined as the sampling pixel point, and the color vector of the sampling pixel point is used as the color vector of the object "fire hydrant".

如上,图像信号处理单元230在采样得到前述对象的颜色向量之后,进一步计算前述对象的颜色向量与其预分配颜色向量的向量差异,可以表示为:As above, after sampling the color vector of the aforementioned object, the image signal processing unit 230 further calculates the vector difference between the color vector of the aforementioned object and its pre-assigned color vector, which can be expressed as:

r 3=(r 1-r 2)/256; r 3 =(r 1 -r 2 )/256;

g 3=(g 1-g 2)/256; g 3 =(g 1 -g 2 )/256;

b 3=(b 1-b 2)/256; b 3 =(b 1 -b 2 )/256;

Figure PCTCN2021128536-appb-000002
Figure PCTCN2021128536-appb-000002

其中,diff表示前述对象的颜色向量与其预分配颜色向量的向量差异,r 1表示前述预分配颜色向量在红色通道的分量值,g 1表示前述预分配颜色向量在绿色通道的分量值,b 1表示前述预分配颜色向量在蓝色通道的分量值,r 2表示前述颜色向量在红色通道的分量值,g 2表示前述颜色向量在绿色通道的分量值,b 2表示前述颜色向量在蓝色通道的分量值。 where diff represents the vector difference between the color vector of the aforementioned object and its pre-assigned color vector, r 1 represents the component value of the aforementioned pre-assigned color vector in the red channel, g 1 represents the component value of the aforementioned pre-assigned color vector in the green channel, b 1 represents the component value of the aforementioned pre-assigned color vector in the blue channel, r 2 represents the component value of the aforementioned color vector in the red channel, g 2 represents the component value of the aforementioned color vector in the green channel, and b 2 represents the aforementioned color vector in the blue channel. component value.

如上,图像信号处理单元230在计算得到前述对象的颜色向量与其预分配颜色向量的向量差异之后,即可根据计算得到的向量差异判断前述对象的颜色向量与预分配颜色向量是否存在色偏。As above, after calculating the vector difference between the color vector of the object and the pre-assigned color vector, the image signal processing unit 230 can determine whether there is a color shift between the color vector of the object and the pre-assigned color vector according to the calculated vector difference.

比如,可以预先配置用于判定存在色偏的差异阈值,相应的,通过比较该前述向量差异是否大于或等于差异阈值,根据比较结果即可判定是否存在色偏。其中,若前述向量差异大于或等于差异阈值,则判定前述颜色向量与前述预分配颜色向量存在色偏(通过前述颜色向量和前述预分配颜色向量的差值向量表征),若前述向量差异小于差异阈值,则判定前述颜色向量与前述预分配颜色向量不存在色偏。For example, a difference threshold for determining the presence of color shift may be pre-configured, and accordingly, by comparing whether the aforementioned vector difference is greater than or equal to the difference threshold, it can be determined whether there is color shift according to the comparison result. Wherein, if the aforementioned vector difference is greater than or equal to the difference threshold, it is determined that there is a color deviation between the aforementioned color vector and the aforementioned pre-assigned color vector (represented by the difference vector between the aforementioned color vector and the aforementioned pre-assigned color vector), if the aforementioned vector difference is less than the difference. If the threshold is set, it is determined that there is no color shift between the aforementioned color vector and the aforementioned pre-assigned color vector.

应当说明的是,本申请实施例中对于差异阈值的取值不作具体限制,可由本领域普通技术人员根据实际需要进行配置,可以将差异阈值配置为一固定值,也可以动态确定差异阈值的取值。It should be noted that the value of the difference threshold is not specifically limited in the embodiments of the present application, and can be configured by those of ordinary skill in the art according to actual needs. The difference threshold may be configured as a fixed value, or the value of the difference threshold may be dynamically determined. value.

可选地,在一实施例中,图像信号处理单元230用于基于颜色向量与预分配颜色向量的色偏方向确定差异阈值,并基于差异阈值以及向量差异来判断颜色向量与预分配颜色向量是否存在色偏。Optionally, in one embodiment, the image signal processing unit 230 is configured to determine a difference threshold based on the color shift direction of the color vector and the pre-assigned color vector, and determine whether the color vector and the pre-assigned color vector are not based on the difference threshold and the vector difference. There is a color cast.

在本申请实施例中,考虑人眼对不同颜色的敏感程度不同,利用色偏方向动态确定差异阈值的取值。In the embodiment of the present application, considering that the sensitivity of human eyes to different colors is different, the color shift direction is used to dynamically determine the value of the difference threshold.

其中,针对于不同的预分配颜色向量,根据人眼对不同颜色的敏感程度,本申请实施例中预先建立与每一预分配颜色向量关联的色偏方向和差异阈值的对应关系。比如,请参照图5,图中的椭圆即代表了预分配颜色向量关联的色偏方向与差异阈值的对应关系,其中,存在18个椭圆,即代表了18种预分配颜色向量各自关联的色偏方向与差异阈值的对应关系。以其中编号为“7”的椭圆为例,对于该椭圆关联的预分配颜色向量,当色偏方向为偏向蓝色或者红色时所对应的差异阈值,明显大于色偏方向为偏向绿色时所对应的差异阈值,因为人眼对绿色更为敏感。Wherein, for different pre-assigned color vectors, according to the sensitivity of the human eye to different colors, in the embodiment of the present application, the corresponding relationship between the color shift direction and the difference threshold associated with each pre-assigned color vector is pre-established. For example, please refer to Figure 5. The ellipse in the figure represents the corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vectors. There are 18 ellipses, which represent the colors associated with each of the 18 pre-assigned color vectors. The correspondence between the bias direction and the difference threshold. Taking the ellipse numbered "7" as an example, for the pre-assigned color vector associated with the ellipse, the difference threshold corresponding to when the color shift direction is biased towards blue or red is significantly larger than that corresponding to when the color shift direction is biased towards green. , because the human eye is more sensitive to green.

如上,基于建立的与预分配颜色向量关联的色偏方向和差异阈值的对应关系,图像信号处理单元230在进行色偏的识别时,首先确定识别出的拍摄场景中的对象的颜色向量相较于其预分配颜色向量的色偏方向,然后根据与该预分配颜色向量关联的色偏方向与差异阈值的对应关系,确定出与前述颜色向量的色偏方向所对应的差异阈值,然后再判断前述颜色向量的向量差异是否大于或等于前述色偏方向对应的差异阈值,其中,若前述颜色向量的向量差异大于或等于前述色偏方向对应的差异阈值,则判定前述颜色向量与前述预分配颜色向量存在色偏(此处采用前述向量差异和色偏方向进行表征),否则判定前述颜色向量与前述预分配颜色向量不存色偏。As above, based on the established corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vector, when the image signal processing unit 230 performs color shift identification, it first determines that the color vector of the identified object in the shooting scene is compared with Based on the color shift direction of its pre-assigned color vector, then according to the corresponding relationship between the color shift direction and the difference threshold associated with the pre-assigned color vector, determine the difference threshold corresponding to the color shift direction of the aforementioned color vector, and then judge Whether the vector difference of the aforementioned color vectors is greater than or equal to the difference threshold corresponding to the aforementioned color shift direction, wherein, if the aforementioned vector difference of the aforementioned color vector is greater than or equal to the aforementioned difference threshold value corresponding to the aforementioned color shift direction, then it is determined that the aforementioned color vector and the aforementioned pre-assigned color The vector has a color shift (here, the aforementioned vector difference and color shift direction are used to characterize it), otherwise, it is determined that the aforementioned color vector and the aforementioned pre-assigned color vector do not have a color shift.

比如,请参照图6,图像信号处理单元230通过对图示拍摄场景中的对象“消防栓”进行色偏识别,判定该对象“消防栓”的颜色向量与其预分配颜色向量存在色偏,图示箭头即表征了该色偏,其中,箭头的指向表征了色偏方向,箭头的长度表征了差异阈值,即长度越长,差异阈值越大。For example, referring to FIG. 6 , the image signal processing unit 230 determines that the color vector of the object "fire hydrant" and its pre-assigned color vector have a color shift by identifying the color shift of the object "fire hydrant" in the shooting scene shown in the figure. The arrow shown represents the color shift, wherein the direction of the arrow represents the color shift direction, and the length of the arrow represents the difference threshold, that is, the longer the length, the greater the difference threshold.

可选地,在一实施例中,图像信号处理单元230用于计算颜色向量与预分配颜色向量的差值向量,并将差值向量作为采样像素点的色偏向量;以及根据采样像素点的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量;以及根据校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到还原图像。Optionally, in one embodiment, the image signal processing unit 230 is configured to calculate the difference vector between the color vector and the pre-assigned color vector, and use the difference vector as the color shift vector of the sampling pixel; The color shift vector is interpolated to obtain the color shift vector of the non-sampling pixels in the corrected image; and according to the color shift vector of each pixel in the corrected image, color restoration is performed on each pixel to obtain a restored image.

本申请实施例中,图像信号处理单元230被配置为计算前述颜色向量与前述预分配颜色向量的差值向量,将该差值向量作为采样像素点的色偏向量。然后,图像信号处理单元230按照预先配置的插值策略,根据采样像素点的色偏向量插值得到校正图像中非采样像素点的色偏向量。至此,校正图像中包括采样像素点和非采样像素点在内的所有像素点的色偏向量均已知,即可根据校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,从而得到还原图像。In this embodiment of the present application, the image signal processing unit 230 is configured to calculate the difference vector between the aforementioned color vector and the aforementioned pre-assigned color vector, and use the difference vector as the color shift vector of the sampling pixel. Then, the image signal processing unit 230 obtains the color shift vector of the non-sampled pixel points in the corrected image by interpolating according to the color shift vector of the sampled pixel points according to the pre-configured interpolation strategy. So far, the color shift vectors of all pixels in the corrected image, including sampling pixels and non-sampling pixels, are known, and each pixel can be color-coded according to the color shift vector of each pixel in the corrected image. Restoration processing to obtain a restored image.

以上本申请实施例中进行的插值处理可以理解为通过已知的、离散的像素点的色偏向量,在整个校正图像内推求其它像素点的色偏向量的过程。The interpolation processing performed in the above embodiments of the present application can be understood as a process of estimating the color shift vectors of other pixel points in the entire corrected image through the known color shift vectors of discrete pixels.

比如,请参照图7,在图7上侧的校正图像中,前置图像信号处理器200通过神经网络处理单元220共识别出8个不同的对象,图7中示出的黑色实心圆代表对应这些识别出的对象的采样像素点,箭头代表对应的色偏向量。如图7所示,图像信号处理单元230根据采样像素点的色偏向量插值得到校正图像中所有像素点的色偏向量。For example, referring to FIG. 7 , in the corrected image on the upper side of FIG. 7 , the front image signal processor 200 has identified 8 different objects through the neural network processing unit 220 , and the black solid circles shown in FIG. 7 represent the corresponding The sampled pixels of these identified objects, and the arrows represent the corresponding color shift vectors. As shown in FIG. 7 , the image signal processing unit 230 obtains the color shift vectors of all pixels in the corrected image by interpolation according to the color shift vectors of the sampled pixels.

应当说明的是,本申请实施例中对于采用的插值策略不作具体限定,可由本领域普通 技术人员根据实际需要进行选取,包括但不限于最近领域插值、双线性插值或者双三次插值等。It should be noted that the interpolation strategy adopted is not specifically limited in the embodiments of the present application, and can be selected by those of ordinary skill in the art according to actual needs, including but not limited to recent field interpolation, bilinear interpolation or bicubic interpolation, etc.

可选地,在一实施例中,图像信号处理单元230用于根据采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到非采样像素点的多个候选色偏向量;以及根据多个候选色偏向量,得到非采样像素点的色偏向量。Optionally, in one embodiment, the image signal processing unit 230 is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel point, to obtain multiple candidate color shift vectors of the non-sampled pixel point; And according to the multiple candidate color shift vectors, the color shift vectors of the non-sampling pixels are obtained.

其中,对于同一非采样像素点,应用处理器130按照不同的插值策略插值时所选择的邻域像素点不同。Wherein, for the same non-sampling pixel point, the neighborhood pixel points selected by the application processor 130 during interpolation according to different interpolation strategies are different.

应当说明的是,本申请实施例中并不采用单一的插值策略进行插值处理,而是融合多种插值策略进行插值处理。此处对于采用何种插值策略,以及插值策略的数量不做具体限制,可由本领域根据图像信号处理单元230的处理能力进行配置。另外,本申请实施例中对于采用何种融合策略也不做具体限制,可由本领域普通技术人员根据实际需要进行配置。It should be noted that, in the embodiment of the present application, a single interpolation strategy is not used for interpolation processing, but multiple interpolation strategies are combined to perform interpolation processing. There is no specific limitation on which interpolation strategy is adopted and the number of interpolation strategies, which can be configured according to the processing capability of the image signal processing unit 230 in the art. In addition, the embodiment of the present application does not specifically limit which fusion strategy is adopted, and can be configured by those of ordinary skill in the art according to actual needs.

比如,本申请实施例中预先配置有3种不同的插值策略,分别记为插值策略A、插值策略B以及插值策略C。在进行插值处理时,对于一非采样像素点,图像信号处理单元230根据采样像素点的色偏向量,采用插值策略A插值得到该非采样像素点的候选色偏向量A,采用插值策略B插值得到该非采样像素点的候选色偏向量B,以及采用插值策略C插值得到该非采样像素点的候选色偏向量C。最后,图像信号处理单元230按照配置的融合策略将候选色偏向量A、候选色偏向量B以及候选色偏向量C融合为一个向量,作为该非采样像素点的色偏向量。For example, three different interpolation strategies are pre-configured in the embodiment of the present application, which are denoted as interpolation strategy A, interpolation strategy B, and interpolation strategy C, respectively. When performing interpolation processing, for a non-sampling pixel point, the image signal processing unit 230 uses interpolation strategy A to obtain the candidate color shift vector A of the non-sampling pixel point according to the color shift vector of the sampled pixel point, and uses interpolation strategy B to interpolate the candidate color shift vector A. Obtain the candidate color shift vector B of the non-sampling pixel point, and use the interpolation strategy C to interpolate to obtain the candidate color shift vector C of the non-sampling pixel point. Finally, the image signal processing unit 230 fuses the candidate color shift vector A, the candidate color shift vector B, and the candidate color shift vector C into one vector according to the configured fusion strategy, which is used as the color shift vector of the non-sampling pixel point.

可选地,在一实施例中,图像信号处理单元230用于计算多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到非采样像素点的色偏向量;或者Optionally, in one embodiment, the image signal processing unit 230 is configured to calculate the average value of the components of the multiple candidate color shift vectors in each dimension, and obtain the color of the non-sampling pixel point according to the average value of each dimension component. bias vector; or

对多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到非采样像素点的色偏向量。Weighted summation is performed on the components of the multiple candidate color shift vectors in each dimension, and the color shift vector of the non-sampling pixel point is obtained according to the weighted sum value of each dimension component.

本申请实施例中进一步提供两种可选地的融合策略。Two optional fusion strategies are further provided in the embodiments of the present application.

其一,对于一非采样像素点,图像信号处理单元230计算其多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到非采样像素点的色偏向量。First, for a non-sampling pixel, the image signal processing unit 230 calculates the average value of the components of its multiple candidate color shift vectors in each dimension, and obtains the color shift of the non-sampling pixel according to the average value of each dimension component. quantity.

其二,预先为不同的插值策略分配用于加权求和的权重,比如,以权重和值为1为约束,若一插值策略的精确度越高,则分配的权重越高。对于一非采样像素点,图像信号处理单元230根据每一插值策略对应的权重,对该非采样像素点的多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到该非采样像素点的色偏向量。Second, different interpolation strategies are pre-allocated with weights for weighted summation. For example, with the weight sum value being 1 as a constraint, if the accuracy of an interpolation strategy is higher, the assigned weight will be higher. For a non-sampling pixel, the image signal processing unit 230 performs weighted summation of the components of the multiple candidate color shift vectors of the non-sampling pixel in each dimension according to the weight corresponding to each interpolation strategy, The weighted sum of the components obtains the color shift vector of the unsampled pixel.

可选地,在一实施例中,图像信号处理单元230用于获取前述对象对应的识别置信度,并根据识别置信度对采样像素点的色偏向量进行修正处理,得到采样像素点修正后的色偏向量;以及根据采样像素点修正后的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量。Optionally, in one embodiment, the image signal processing unit 230 is configured to obtain the recognition confidence corresponding to the aforementioned object, and perform correction processing on the color shift vector of the sampled pixel points according to the recognition confidence degree to obtain the corrected sample pixel point. color shift vector; and performing interpolation processing on the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.

本申请实施例中,根据神经网络识别单元220识别到对象的识别置信度来决定颜色还原的幅度大小。In the embodiment of the present application, the magnitude of the color restoration is determined according to the recognition confidence of the object recognized by the neural network recognition unit 220 .

其中,图像信号处理单元230首先获取到神经网络识别单元220识别到拍摄场景中对象的识别置信度,并根据该识别置信度对前述采样像素点的色偏向量进行修正处理,可以表示为:Wherein, the image signal processing unit 230 first obtains the recognition confidence of the object in the shooting scene recognized by the neural network recognition unit 220, and performs correction processing on the color shift vector of the aforementioned sampling pixel points according to the recognition confidence, which can be expressed as:

V’=V*α;V'=V*α;

其中,V’表示采样像素点修正后的色偏向量,V表示计算得到的采样像素点的色偏向量,α表示前述对象的识别置信度。Among them, V' represents the corrected color shift vector of the sampled pixel point, V represents the color shift vector of the sampled pixel point obtained by calculation, and α represents the recognition confidence of the aforementioned object.

在完成对前述采样像素点的色偏向量的修正之后,图像信号处理单元230进一步根据前述采样像素点修正后的色偏向量进行插值处理,以此得到校正图像中非采样像素点的色偏向量,具体可参照以上实施例中的相关描述,此处不再赘述。After completing the correction of the color shift vector of the sampling pixel, the image signal processing unit 230 further performs interpolation processing according to the corrected color shift vector of the sampling pixel, so as to obtain the color shift vector of the non-sampling pixel in the corrected image , for details, reference may be made to the relevant descriptions in the above embodiments, which will not be repeated here.

本申请实施例还提供一种图像处理方法,该方法包括:The embodiment of the present application also provides an image processing method, the method includes:

获取拍摄场景的场景图像;Get the scene image of the shooting scene;

对所述场景图像进行白平衡校正,得到校正图像;performing white balance correction on the scene image to obtain a corrected image;

根据所述场景图像识别所述拍摄场景中存在的对象;Identify objects existing in the shooting scene according to the scene image;

当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。When there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, color restoration processing is performed on the corrected image according to the color shift to obtain a restored image.

在一些实施例中,所述图像处理方法还包括:In some embodiments, the image processing method further includes:

从所述对象在所述校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将所述采样像素点的颜色向量作为所述对象的颜色向量;Determine the sampling pixel points for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixel point as the color vector of the object;

计算所述颜色向量与所述预分配颜色向量的向量差异,并根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏。Calculate the vector difference between the color vector and the pre-assigned color vector, and determine whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference.

在一些实施例中,所述根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏,包括:In some embodiments, determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference includes:

基于所述颜色向量与所述预分配颜色向量的色偏方向确定差异阈值,并基于所述差异阈值以及所述向量差异来判断所述颜色向量与所述预分配颜色向量是否存在色偏。A difference threshold is determined based on the color shift direction between the color vector and the pre-assigned color vector, and whether there is a color shift between the color vector and the pre-assigned color vector is determined based on the difference threshold and the vector difference.

在一些实施例中,所述根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像,包括:In some embodiments, performing color restoration processing on the corrected image according to the color shift to obtain a restored image includes:

计算所述颜色向量与所述预分配颜色向量的差值向量,并将所述差值向量作为所述采样像素点的色偏向量;Calculate the difference vector between the color vector and the pre-assigned color vector, and use the difference vector as the color shift vector of the sampling pixel;

根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量;Perform interpolation processing according to the color shift vector of the sampling pixel to obtain the color shift vector of the non-sampling pixel in the corrected image;

根据所述校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到所述还原图像。According to the color shift vector of each pixel in the corrected image, color restoration processing is performed on each pixel to obtain the restored image.

在一些实施例中,所述根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量,包括:In some embodiments, performing interpolation processing according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image, including:

获取所述对象对应的识别置信度,并根据所述识别置信度对所述采样像素点的色偏向量进行修正处理,得到所述采样像素点修正后的色偏向量;Obtaining the recognition confidence level corresponding to the object, and performing correction processing on the color shift vector of the sampling pixel point according to the recognition confidence level, to obtain the corrected color shift vector of the sampling pixel point;

根据所述采样像素点修正后的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量。Perform interpolation processing according to the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.

请参照图9,本申请还提供一种图像处理方法,如图9所示,该图像处理方法包括:Please refer to FIG. 9 , the present application also provides an image processing method, as shown in FIG. 9 , the image processing method includes:

在310中,获取拍摄场景的场景图像;In 310, a scene image of the shooting scene is obtained;

在320中,对场景图像进行白平衡校正,得到校正图像;In 320, performing white balance correction on the scene image to obtain a corrected image;

在330中,根据场景图像识别拍摄场景中存在的对象;In 330, identifying objects existing in the shooting scene according to the scene image;

在340中,当前述对象在校正图像中的颜色向量与前述对象的预分配颜色向量存在色偏时,根据色偏对校正图像进行颜色还原处理,得到还原图像。In 340, when there is a color shift between the color vector of the aforementioned object in the corrected image and the pre-assigned color vector of the aforementioned object, perform color restoration processing on the corrected image according to the color shift to obtain a restored image.

应当说明的是,320和330的执行先后顺序不受序号大小的影响,可以是先执行320再执行330,可以是先执行330再执行320,还可以同时执行320和330。It should be noted that the execution sequence of 320 and 330 is not affected by the size of the sequence number, it may be that 320 is executed first and then 330 is executed, 330 may be executed first and then 320 is executed, or 320 and 330 may be executed simultaneously.

可选地,在一实施例中,对场景图像进行白平衡校正,得到校正图像,包括:Optionally, in an embodiment, performing white balance correction on the scene image to obtain a corrected image, including:

对场景图像进行状态统计,得到进行白平衡校正所需的状态信息;Perform state statistics on the scene image to obtain the state information required for white balance correction;

根据前述状态信息对场景图像进行白平衡校正,得到校正图像。Perform white balance correction on the scene image according to the aforementioned state information to obtain a corrected image.

可选地,在一实施例中,根据前述状态信息对场景图像进行白平衡校正,得到校正图像之前,还包括:Optionally, in an embodiment, the white balance correction is performed on the scene image according to the foregoing state information, and before the corrected image is obtained, the method further includes:

在统计得到前述状态信息后,对场景图像进行第一次优化处理;After the aforementioned state information is obtained by statistics, the first optimization processing is performed on the scene image;

对第一次优化处理后的场景图像进行第二次优化处理;Perform a second optimization process on the scene image after the first optimization process;

根据前述状态信息对场景图像进行白平衡校正,得到校正图像,包括:Perform white balance correction on the scene image according to the foregoing state information to obtain a corrected image, including:

根据前述状态信息对第二次优化处理后的场景图像进行白平衡校正,得到校正图像。Perform white balance correction on the scene image after the second optimization process according to the aforementioned state information to obtain a corrected image.

可选地,在一实施例中,根据场景图像识别拍摄场景中存在的对象,包括:Optionally, in an embodiment, identifying objects existing in the shooting scene according to the scene image includes:

通过对象识别模型对第二次优化处理后的场景图像进行对象识别,以识别出拍摄场景中存在的对象。The object recognition model is used to perform object recognition on the scene image after the second optimization processing, so as to recognize the objects existing in the shooting scene.

可选地,在一实施例中,本申请提供的图像处理方法还包括:Optionally, in an embodiment, the image processing method provided by this application further includes:

从前述对象在校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将采样像素点的颜色向量作为对象的颜色向量;Determine the sampling pixel points for color sampling from the aforementioned object in the object area in the corrected image, and use the color vector of the sampling pixel point as the color vector of the object;

计算颜色向量与预分配颜色向量的向量差异,并根据向量差异判断颜色向量与预分配颜色向量是否存在色偏。Calculate the vector difference between the color vector and the pre-assigned color vector, and judge whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference.

可选地,在一实施例中,根据向量差异判断颜色向量与预分配颜色向量是否存在色偏,包括:Optionally, in one embodiment, determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference includes:

基于颜色向量与预分配颜色向量的色偏方向确定差异阈值,并基于差异阈值以及向量差异来判断颜色向量与预分配颜色向量是否存在色偏。The difference threshold is determined based on the color shift direction of the color vector and the pre-assigned color vector, and whether there is a color shift between the color vector and the pre-assigned color vector is determined based on the difference threshold and the vector difference.

可选地,在一实施例中,根据色偏对校正图像进行颜色还原处理,得到还原图像,包括:Optionally, in one embodiment, performing color restoration processing on the corrected image according to the color shift to obtain a restored image, including:

计算颜色向量与预分配颜色向量的差值向量,并将差值向量作为采样像素点的色偏向量;Calculate the difference vector between the color vector and the pre-allocated color vector, and use the difference vector as the color shift vector of the sampling pixel;

根据采样像素点的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量;Perform interpolation processing according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image;

根据校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到还原图像。According to the color shift vector of each pixel in the corrected image, color restoration is performed on each pixel to obtain a restored image.

可选地,在一实施例中,根据采样像素点的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量,包括:Optionally, in an embodiment, interpolation processing is performed according to the color shift vector of the sampled pixels to obtain the color shift vector of the non-sampled pixels in the corrected image, including:

根据采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到非采样像素点的多个候选色偏向量;Perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel point to obtain a plurality of candidate color shift vectors of the non-sampled pixel point;

根据多个候选色偏向量,得到非采样像素点的色偏向量。According to the multiple candidate color shift vectors, the color shift vectors of the non-sampled pixels are obtained.

可选地,在一实施例中,根据多个候选色偏向量,得到非采样像素点的色偏向量,包括:Optionally, in an embodiment, the color shift vector of the non-sampling pixel is obtained according to a plurality of candidate color shift vectors, including:

计算多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到非采样像素点的色偏向量;或者Calculate the average value of the components of multiple candidate color shift vectors in each dimension, and obtain the color shift vector of the non-sampling pixel point according to the average value of each dimension component; or

对多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到非采样像素点的色偏向量。Weighted summation is performed on the components of the multiple candidate color shift vectors in each dimension, and the color shift vector of the non-sampling pixel point is obtained according to the weighted sum value of each dimension component.

可选地,在一实施例中,根据采样像素点的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量,包括:Optionally, in one embodiment, interpolation processing is performed according to the color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image, including:

获取对象对应的识别置信度,并根据识别置信度对采样像素点的色偏向量进行修正处理,得到采样像素点修正后的色偏向量;Obtaining the recognition confidence level corresponding to the object, and correcting the color shift vector of the sampled pixel points according to the recognition confidence level to obtain the corrected color shift vector of the sampled pixel point;

根据采样像素点修正后的色偏向量进行插值处理,得到校正图像中非采样像素点的色偏向量。Interpolate according to the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.

应当说明的是,本申请提供的图像处理方法可由本申请提供的电子设备执行,也可由本申请提供的前置图像信号处理器执行,关于图像处理方法的详细说明请参照以上实施例中对于电子设备或前置图像信号处理器的相关说明,在此不再赘述。It should be noted that the image processing method provided by this application can be executed by the electronic device provided by this application, and it can also be executed by the pre-image signal processor provided by this application. The relevant description of the device or the front image signal processor will not be repeated here.

以上对本申请实施例提供的电子设备、前置图像信号处理器及图像处理方法进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请。同时,对于本领域的技术人员,依据本申请的思想,在具体 实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The electronic device, the front image signal processor, and the image processing method provided by the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described herein by using specific examples, and the descriptions of the above embodiments are only used to help the understanding of the present application. At the same time, for those skilled in the art, according to the idea of the application, there will be changes in the specific embodiments and application scope. In summary, the content of this specification should not be construed as a limitation to the application.

Claims (20)

一种电子设备,其中,包括:An electronic device comprising: 摄像头,用于采集拍摄场景的场景图像;A camera, used to collect scene images of the shooting scene; 前置图像信号处理器,用于根据所述场景图像识别所述拍摄场景中存在的对象;a front image signal processor, configured to identify objects existing in the shooting scene according to the scene image; 应用处理器,用于对所述场景图像进行白平衡校正,得到校正图像;以及当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。An application processor, configured to perform white balance correction on the scene image to obtain a corrected image; and when there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, according to the The color cast performs color restoration processing on the corrected image to obtain a restored image. 根据权利要求1所述的电子设备,其中,所述前置图像信号处理器用于对所述场景图像进行状态统计,得到所述应用处理器进行白平衡校正所需的状态信息;以及对所述场景图像进行优化处理,得到优化后的场景图像;The electronic device according to claim 1, wherein the pre-image signal processor is configured to perform state statistics on the scene image to obtain state information required by the application processor to perform white balance correction; and The scene image is optimized to obtain an optimized scene image; 所述应用处理器用于根据所述状态信息对所述优化后的场景图像进行白平衡校正,得到所述校正图像。The application processor is configured to perform white balance correction on the optimized scene image according to the state information to obtain the corrected image. 根据权利要求2所述的电子设备,其中,所述前置图像信号处理器包括:The electronic device according to claim 2, wherein the front image signal processor comprises: 图像信号处理单元,用于对所述场景图像进行状态统计,得到所述状态信息;以及对所述场景图像进行第一次优化处理;an image signal processing unit, configured to perform state statistics on the scene image to obtain the state information; and perform a first optimization process on the scene image; 神经网络处理单元,用于对第一次优化处理后的场景图像进行第二次优化处理;以及通过对象识别模型对第二次优化处理后的场景图像进行对象识别,以识别出所述拍摄场景中存在的对象。A neural network processing unit for performing a second optimization process on the scene image after the first optimization process; and performing object recognition on the scene image after the second optimization process through an object recognition model, so as to identify the shooting scene objects that exist in . 根据权利要求1所述的电子设备,其中,所述应用处理器用于从所述对象在所述校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将所述采样像素点的颜色向量作为所述对象的颜色向量;以及计算所述颜色向量与所述预分配颜色向量的向量差异,并根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏。1. The electronic device according to claim 1, wherein the application processor is configured to determine sampling pixels for color sampling from the object within the object area in the corrected image, and use the sampling pixels to The color vector of the object is used as the color vector of the object; and the vector difference between the color vector and the pre-assigned color vector is calculated, and whether there is a color shift between the color vector and the pre-assigned color vector is judged according to the vector difference. . 根据权利要求4所述的电子设备,其中,所述应用处理器用于基于所述颜色向量与所述预分配颜色向量的色偏方向确定差异阈值,并基于所述差异阈值以及所述向量差异来判断所述颜色向量与所述预分配颜色向量是否存在色偏。4. The electronic device of claim 4, wherein the application processor is configured to determine a difference threshold based on a color shift direction of the color vector and the pre-assigned color vector, and to determine a difference threshold based on the difference threshold and the vector difference Determine whether there is a color deviation between the color vector and the pre-assigned color vector. 根据权利要求4所述的电子设备,其中,所述应用处理器用于计算所述颜色向量与所述预分配颜色向量的差值向量,并将所述差值向量作为所述采样像素点的色偏向量;以及根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量;以及根据所述校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到所述还原图像。The electronic device according to claim 4, wherein the application processor is configured to calculate a difference vector between the color vector and the pre-assigned color vector, and use the difference vector as the color of the sampled pixel. and performing interpolation processing according to the color shift vector of the sampled pixels to obtain the color shift vector of the non-sampled pixels in the corrected image; and according to the color shift vector of each pixel in the corrected image, to Each pixel is subjected to color restoration processing to obtain the restored image. 根据权利要求6所述的电子设备,其中,所述应用处理器用于根据所述采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到所述非采样像素点的多个候选色偏向量;以及根据所述多个候选色偏向量,得到所述非采样像素点的色偏向量。The electronic device according to claim 6, wherein the application processor is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel points, to obtain a plurality of the non-sampled pixel points candidate color shift vectors; and obtaining color shift vectors of the non-sampled pixel points according to the plurality of candidate color shift vectors. 根据权利要求7所述的电子设备,其中,所述应用处理器用于计算所述多个候选色偏向量在每一维度的分量的平均值,并根据每一维度分量的平均值得到所述非采样像素点的色偏向量;或者The electronic device according to claim 7, wherein the application processor is configured to calculate an average value of components of the plurality of candidate color shift vectors in each dimension, and obtain the The color shift vector of the sampled pixel; or 对所述多个候选色偏向量在每一维度的分量进行加权求和,并根据每一维度分量的加权和值得到所述非采样像素点的色偏向量。Weighted summation is performed on components of the plurality of candidate color shift vectors in each dimension, and the color shift vector of the non-sampled pixel point is obtained according to the weighted sum value of each dimension component. 根据权利要求6所述的电子设备,其中,所述应用处理器用于获取所述对象对应的识别置信度,并根据所述识别置信度对所述采样像素点的色偏向量进行修正处理,得到所述采样像素点修正后的色偏向量;以及根据所述采样像素点修正后的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量。The electronic device according to claim 6, wherein the application processor is configured to obtain the recognition confidence corresponding to the object, and perform correction processing on the color shift vector of the sampling pixel point according to the recognition confidence, to obtain the corrected color shift vector of the sampling pixel; and performing interpolation processing according to the corrected color shift vector of the sampling pixel to obtain the color shift vector of the non-sampling pixel in the corrected image. 一种前置图像信号处理器,其中,包括:A front image signal processor, comprising: 数据接口,用于从摄像头获取拍摄场景的场景图像;以及将所述场景图像传输至应用 处理器进行白平衡校正,并接收所述应用处理器进行白平衡校正后返回的校正图像;A data interface for obtaining a scene image of a shooting scene from a camera; and transmitting the scene image to an application processor for white balance correction, and receiving a corrected image returned after the application processor performs white balance correction; 神经网络处理单元,用于通过对象识别模型对所述场景图像进行识别,以识别出所述拍摄场景中存在的对象;a neural network processing unit, configured to recognize the scene image through an object recognition model, so as to recognize the object existing in the shooting scene; 图像信号处理单元,用于当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。An image signal processing unit, configured to perform color restoration processing on the corrected image according to the color deviation when the color vector of the object in the corrected image and the pre-assigned color vector of the object have a color deviation, to obtain Restore the image. 根据权利要求10所述的前置图像信号处理器,其中,所述图像信号处理单元用于从所述对象在所述校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将所述采样像素点的颜色向量作为所述对象的颜色向量;以及计算所述颜色向量与所述预分配颜色向量的向量差异,并根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏。The front-end image signal processor according to claim 10, wherein the image signal processing unit is configured to determine the sampling pixel points for color sampling from the object in the object area in the corrected image, and Taking the color vector of the sampling pixel as the color vector of the object; and calculating the vector difference between the color vector and the pre-allocated color vector, and judging the color vector and the pre-allocation according to the vector difference Whether the color vector has a color cast. 根据权利要求11所述的前置图像信号处理器,其中,所述图像信号处理单元用于基于所述颜色向量与所述预分配颜色向量的色偏方向确定差异阈值,并基于所述差异阈值以及所述向量差异来判断所述颜色向量与所述预分配颜色向量是否存在色偏。The front-end image signal processor according to claim 11, wherein the image signal processing unit is configured to determine a difference threshold based on the color shift direction of the color vector and the pre-assigned color vector, and based on the difference threshold and the vector difference to determine whether there is a color shift between the color vector and the pre-assigned color vector. 根据权利要求10所述的前置图像信号处理器,其中,所述图像信号处理单元用于计算所述颜色向量与所述预分配颜色向量的差值向量,并将所述差值向量作为所述采样像素点的色偏向量;以及根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量;以及根据所述校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到所述还原图像。The front-end image signal processor according to claim 10, wherein the image signal processing unit is configured to calculate a difference vector between the color vector and the pre-assigned color vector, and use the difference vector as the The color shift vector of the sampled pixels; and performing interpolation processing according to the color shift vector of the sampled pixels to obtain the color shift vector of the non-sampled pixels in the corrected image; and according to each pixel in the corrected image The color shift vector of , and performing color restoration processing on each pixel to obtain the restored image. 根据权利要求13所述的前置图像信号处理器,其中,所述图像信号处理单元用于根据所述采样像素点的色偏向量,按照一种以上的插值算法进行插值处理,得到所述非采样像素点的多个候选色偏向量;以及根据所述多个候选色偏向量,得到所述非采样像素点的色偏向量。The front-end image signal processor according to claim 13, wherein the image signal processing unit is configured to perform interpolation processing according to more than one interpolation algorithm according to the color shift vector of the sampled pixel points to obtain the non- multiple candidate color shift vectors of the sampling pixel; and obtaining the color shift vector of the non-sampled pixel according to the multiple candidate color shift vectors. 根据权利要求13所述的前置图像信号处理器,其中,所述图像信号处理单元用于获取所述对象对应的识别置信度,并根据所述识别置信度对所述采样像素点的色偏向量进行修正处理,得到所述采样像素点修正后的色偏向量;以及根据所述采样像素点修正后的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量。The front-end image signal processor according to claim 13, wherein the image signal processing unit is configured to obtain the recognition confidence corresponding to the object, and to determine the color deviation of the sampling pixel according to the recognition confidence. performing correction processing on the sampled pixel point to obtain the corrected color shift vector of the sampled pixel point; and performing interpolation processing according to the corrected color shift vector of the sampled pixel point to obtain the color shift vector of the non-sampled pixel point in the corrected image. 一种图像处理方法,其中,包括:An image processing method, comprising: 获取拍摄场景的场景图像;Get the scene image of the shooting scene; 对所述场景图像进行白平衡校正,得到校正图像;performing white balance correction on the scene image to obtain a corrected image; 根据所述场景图像识别所述拍摄场景中存在的对象;Identify objects existing in the shooting scene according to the scene image; 当所述对象在所述校正图像中的颜色向量与所述对象的预分配颜色向量存在色偏时,根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像。When there is a color shift between the color vector of the object in the corrected image and the pre-assigned color vector of the object, a color restoration process is performed on the corrected image according to the color shift to obtain a restored image. 根据权利要求16所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to claim 16, wherein the image processing method further comprises: 从所述对象在所述校正图像中的对象区域内确定出用于颜色采样的采样像素点,并将所述采样像素点的颜色向量作为所述对象的颜色向量;Determine the sampling pixel points for color sampling from the object in the object area in the corrected image, and use the color vector of the sampling pixel point as the color vector of the object; 计算所述颜色向量与所述预分配颜色向量的向量差异,并根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏。Calculate the vector difference between the color vector and the pre-assigned color vector, and determine whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference. 根据权利要求17所述的图像处理方法,其中,所述根据所述向量差异判断所述颜色向量与所述预分配颜色向量是否存在色偏,包括:The image processing method according to claim 17, wherein the determining whether there is a color shift between the color vector and the pre-assigned color vector according to the vector difference comprises: 基于所述颜色向量与所述预分配颜色向量的色偏方向确定差异阈值,并基于所述差异阈值以及所述向量差异来判断所述颜色向量与所述预分配颜色向量是否存在色偏。A difference threshold is determined based on the color shift direction of the color vector and the pre-assigned color vector, and whether there is a color shift between the color vector and the pre-assigned color vector is determined based on the difference threshold and the vector difference. 根据权利要求16所述的图像处理方法,其中,所述根据所述色偏对所述校正图像进行颜色还原处理,得到还原图像,包括:The image processing method according to claim 16, wherein the performing color restoration processing on the corrected image according to the color shift to obtain a restored image comprises: 计算所述颜色向量与所述预分配颜色向量的差值向量,并将所述差值向量作为所述采 样像素点的色偏向量;Calculate the difference vector of the color vector and the pre-assigned color vector, and use the difference vector as the color shift vector of the sampling pixel; 根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量;Perform interpolation processing according to the color shift vector of the sampling pixel to obtain the color shift vector of the non-sampling pixel in the corrected image; 根据所述校正图像中每一像素点的色偏向量,对每一像素点进行颜色还原处理,得到所述还原图像。According to the color shift vector of each pixel in the corrected image, color restoration processing is performed on each pixel to obtain the restored image. 根据权利要求19所述的图像处理方法,其中,所述根据所述采样像素点的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量,包括:The image processing method according to claim 19, wherein the performing interpolation processing according to the color shift vector of the sampling pixel points to obtain the color shift vector of the non-sampling pixel points in the corrected image, comprising: 获取所述对象对应的识别置信度,并根据所述识别置信度对所述采样像素点的色偏向量进行修正处理,得到所述采样像素点修正后的色偏向量;Obtaining the recognition confidence level corresponding to the object, and performing correction processing on the color shift vector of the sampling pixel point according to the recognition confidence level, to obtain the corrected color shift vector of the sampling pixel point; 根据所述采样像素点修正后的色偏向量进行插值处理,得到所述校正图像中非采样像素点的色偏向量。Perform interpolation processing according to the corrected color shift vector of the sampled pixel points to obtain the color shift vector of the non-sampled pixel points in the corrected image.
PCT/CN2021/128536 2021-01-12 2021-11-04 Electronic device, front image signal processor, and image processing method Ceased WO2022151813A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110035973.9A CN112822370B (en) 2021-01-12 2021-01-12 Electronic equipment, front image signal processor and image processing method
CN202110035973.9 2021-01-12

Publications (1)

Publication Number Publication Date
WO2022151813A1 true WO2022151813A1 (en) 2022-07-21

Family

ID=75868876

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/128536 Ceased WO2022151813A1 (en) 2021-01-12 2021-11-04 Electronic device, front image signal processor, and image processing method

Country Status (2)

Country Link
CN (1) CN112822370B (en)
WO (1) WO2022151813A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230177665A1 (en) * 2021-12-06 2023-06-08 Canon Kabushiki Kaisha Color correction data generating apparatus capable of performing color matching that does not depend on changes in photographing position of camera and color tone of light source, control method for color correction data generating apparatus, and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822370B (en) * 2021-01-12 2022-11-15 Oppo广东移动通信有限公司 Electronic equipment, front image signal processor and image processing method
CN115460333B (en) * 2021-06-08 2024-05-28 Oppo广东移动通信有限公司 Image signal processing module, chip, electronic device and method
CN114630045A (en) * 2022-02-11 2022-06-14 珠海格力电器股份有限公司 Photographing method and device, readable storage medium and electronic equipment
CN115620869A (en) * 2022-11-09 2023-01-17 武汉市武昌医院 An evaluation and training system based on hybrid vision and mirror image virtualization of affected limbs
CN119183003A (en) * 2024-09-25 2024-12-24 维沃移动通信有限公司 Shooting method, shooting device, electronic equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1659590A (en) * 2002-09-25 2005-08-24 日本电气株式会社 Image color correcting device, image color correcting method, and image color correcting program
US20150029359A1 (en) * 2013-07-24 2015-01-29 Nokia Corporation Colour balance processor
CN108024107A (en) * 2017-12-06 2018-05-11 广东欧珀移动通信有限公司 Image processing method, device, electronic equipment and computer-readable recording medium
CN108200347A (en) * 2018-01-30 2018-06-22 努比亚技术有限公司 A kind of image processing method, terminal and computer readable storage medium
US20190066336A1 (en) * 2017-08-28 2019-02-28 Facebook, Inc. Systems and methods for automated color correction
WO2020159149A1 (en) * 2019-01-31 2020-08-06 Samsung Electronics Co., Ltd. Electronic device and method for processing image
CN112822370A (en) * 2021-01-12 2021-05-18 Oppo广东移动通信有限公司 Electronic device, pre-image signal processor and image processing method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4235903B2 (en) * 2003-09-10 2009-03-11 ソニー株式会社 Imaging device
EP1855486B1 (en) * 2005-03-04 2017-09-20 Nikon Corporation Image processor correcting color misregistration, image processing program, image processing method, and electronic camera
JP4244063B2 (en) * 2006-11-06 2009-03-25 ソニー株式会社 Image processing apparatus, image processing method, and program
US9270961B2 (en) * 2014-07-21 2016-02-23 Samsung Electronics Co., Ltd. Color shading correction using color channel consistency
CN107277481A (en) * 2017-07-14 2017-10-20 维沃移动通信有限公司 A kind of image processing method and mobile terminal
KR102581679B1 (en) * 2018-08-08 2023-09-25 삼성전자주식회사 An elelctronic device and method for processing an image in the same
CN110602473B (en) * 2019-10-24 2021-11-16 维沃移动通信有限公司 White balance calibration method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1659590A (en) * 2002-09-25 2005-08-24 日本电气株式会社 Image color correcting device, image color correcting method, and image color correcting program
US20150029359A1 (en) * 2013-07-24 2015-01-29 Nokia Corporation Colour balance processor
US20190066336A1 (en) * 2017-08-28 2019-02-28 Facebook, Inc. Systems and methods for automated color correction
CN108024107A (en) * 2017-12-06 2018-05-11 广东欧珀移动通信有限公司 Image processing method, device, electronic equipment and computer-readable recording medium
CN108200347A (en) * 2018-01-30 2018-06-22 努比亚技术有限公司 A kind of image processing method, terminal and computer readable storage medium
WO2020159149A1 (en) * 2019-01-31 2020-08-06 Samsung Electronics Co., Ltd. Electronic device and method for processing image
CN112822370A (en) * 2021-01-12 2021-05-18 Oppo广东移动通信有限公司 Electronic device, pre-image signal processor and image processing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230177665A1 (en) * 2021-12-06 2023-06-08 Canon Kabushiki Kaisha Color correction data generating apparatus capable of performing color matching that does not depend on changes in photographing position of camera and color tone of light source, control method for color correction data generating apparatus, and storage medium

Also Published As

Publication number Publication date
CN112822370A (en) 2021-05-18
CN112822370B (en) 2022-11-15

Similar Documents

Publication Publication Date Title
CN112822370B (en) Electronic equipment, front image signal processor and image processing method
CN107948519B (en) Image processing method, device and equipment
CN108055452B (en) Image processing method, device and equipment
CN107925751B (en) System and method for multi-view noise reduction and high dynamic range
US9558543B2 (en) Image fusion method and image processing apparatus
US9288392B2 (en) Image capturing device capable of blending images and image processing method for blending images thereof
KR101657039B1 (en) Image processing apparatus, image processing method, and imaging system
CN106713755B (en) Panoramic image processing method and device
CN113313626B (en) Image processing method, device, electronic device and storage medium
CN110022469A (en) Image processing method, image processing device, storage medium and electronic equipment
CN108337447A (en) High dynamic range image exposure compensation value acquisition method, device, equipment and medium
CN108712608A (en) Terminal equipment shooting method and device
CN112261292B (en) Image acquisition method, terminal, chip and storage medium
TWI374664B (en) Focusing apparatus and method
CN110349163A (en) Image processing method and apparatus, electronic device, computer-readable storage medium
CN107465903A (en) Image white balance method, device and computer-readable storage medium
CN112866552A (en) Focusing method and device, electronic equipment and computer readable storage medium
CN103118226A (en) Light source estimation device, light source estimation method, light source estimation program, and imaging apparatus
WO2017080348A2 (en) Scene-based photographing device and method, and computer storage medium
CN110868547A (en) Photographing control method, photographing control device, electronic equipment and storage medium
CN111866369B (en) Image processing method and device
JP6977483B2 (en) Image processing equipment, image processing methods, image processing systems and programs
CN113691724A (en) HDR scene detection method and device, terminal and readable storage medium
CN110365897B (en) Image correction method and device, electronic equipment and computer readable storage medium
CN117560480B (en) Image depth estimation method and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21919004

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21919004

Country of ref document: EP

Kind code of ref document: A1