WO2023077431A1 - Image processing method and apparatus, and image collection device and storage medium - Google Patents

Image processing method and apparatus, and image collection device and storage medium Download PDF

Info

Publication number
WO2023077431A1
WO2023077431A1 PCT/CN2021/129018 CN2021129018W WO2023077431A1 WO 2023077431 A1 WO2023077431 A1 WO 2023077431A1 CN 2021129018 W CN2021129018 W CN 2021129018W WO 2023077431 A1 WO2023077431 A1 WO 2023077431A1
Authority
WO
WIPO (PCT)
Prior art keywords
white balance
image
camera
color
balance gain
Prior art date
Application number
PCT/CN2021/129018
Other languages
French (fr)
Chinese (zh)
Inventor
吴伟霖
王雯琪
郑子翔
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2021/129018 priority Critical patent/WO2023077431A1/en
Publication of WO2023077431A1 publication Critical patent/WO2023077431A1/en

Links

Images

Classifications

    • 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

Definitions

  • the present application relates to the technical field of image processing, and in particular, to an image processing method, device, image acquisition device, and storage medium.
  • the obtained image is still relatively clear.
  • many image acquisition devices are equipped with multiple cameras with different focal lengths.
  • the zoom magnification reaches the corresponding zoom magnification of the next camera, the The camera switches from the current camera to the next camera, and uses the next camera to collect images to achieve optical zoom and obtain clear images.
  • the colors of the same scene in the images output by different cameras before and after camera switching are quite different, which affects user experience.
  • the present application provides an image processing method, device, image acquisition device and storage medium.
  • an image processing method comprising:
  • the color information of the first image captured by the first camera before the optical zoom to perform color processing on the second image captured by the second camera after the optical zoom to obtain a target image, wherein the color information is based on the first Acquiring a target pixel area in the image, where the target pixel area has the same field of view as all or part of the pixel area of the second image;
  • an image processing device the device includes a processor, a memory, and a computer program stored in the memory for execution by the processor, when the processor executes the computer program.
  • the color information of the first image captured by the first camera before the optical zoom to perform color processing on the second image captured by the second camera after the optical zoom to obtain a target image, wherein the color information is based on the first Acquiring a target pixel area in the image, where the target pixel area has the same field of view as all or part of the pixel area of the second image;
  • an image acquisition device is provided, and the image acquisition includes a first camera, a second camera, and the image processing device mentioned in the second aspect above.
  • a computer-readable storage medium wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed, the method mentioned in the above-mentioned first aspect is implemented .
  • the target pixel area can be determined from the first image captured by the first camera, and the target pixel area and all or part of the pixels in the second image captured by the second camera The regions have the same field of view, and then use the color information obtained based on the target pixel region to perform color processing on the second image, and perform color processing on the second image by using the color information of the target pixel region that has the same field of view as the pixel region of the second image
  • Color processing can eliminate the color difference of the images output by the two cameras caused by the difference in the field of view, so that the colors of the images output by the two cameras for the same scene can be consistent before and after switching.
  • FIG. 1 is a schematic diagram of images output before and after camera switching according to an embodiment of the present application.
  • Fig. 2 is a schematic diagram of an image processing method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an expanded pixel area obtained by extending a target pixel area according to an embodiment of the present application.
  • Fig. 4(a) is a schematic diagram of an image processing method according to an embodiment of the present application.
  • Fig. 4(b) is a schematic diagram of an image processing method according to another embodiment of the present application.
  • Fig. 5 is a schematic diagram of a logical structure of an image processing device according to an embodiment of the present application.
  • a multi-camera relay zoom technology is currently provided, that is, one image acquisition device can be equipped with multiple cameras, and the focal lengths of these cameras can be different.
  • the camera can be switched to the camera whose focal length matches the zoom ratio based on the zoom ratio, so as to use the switched camera for image acquisition.
  • the image acquisition device can support larger The focal length range, and the images obtained during the zooming process have relatively high definition and good quality.
  • the field of view of the camera is constantly changing. For example, assume that the first camera is a short-focus camera with a larger field of view, and the second camera is a telephoto camera with a smaller field of view that is only a part of the field of view of the first camera.
  • digital zooming is first performed using images captured by the first camera, and when the zoom ratio matches the focal length of the second camera, the camera is switched to the second camera.
  • the embodiment of the present application provides an image processing method.
  • the target pixel area can be determined from the first image captured by the first camera, and the target pixel area and the first image captured by the second camera can be determined.
  • All or part of the pixel areas in the second image have the same field of view, and then use the color information obtained based on the target pixel area to perform color processing on the second image, by using the target pixel area that has the same field of view as the pixel area of the second image
  • the color information of the second image is color processed, which can eliminate the influence of the field of view difference on the color of the image output by the two cameras, so as to avoid the large deviation in the color of the image output for the same scene before and after the switching of the two cameras .
  • the image processing method of the embodiment of the present application can be used to process images collected by various image acquisition devices equipped with at least two cameras, and the method can be executed by the image acquisition device or by a specialized image processing device.
  • the image acquisition device can be a mobile phone, a camera, a cloud platform, a drone, an unmanned car, and the like.
  • the image acquisition device may include a user interaction interface, and images acquired by the image acquisition device may be displayed on the user interaction interface for viewing by the user.
  • the image acquisition device may be communicatively connected with the control terminal, and the image acquisition device may send the acquired image to the control terminal to be displayed on the interactive interface of the control terminal for the user to view. For example, the image collected by the drone is sent to the user's mobile phone for the user to view.
  • the image acquisition device includes at least a first camera and a second camera, and the focal length supported by the first camera is not exactly the same as that supported by the second camera.
  • the first camera and the second camera can both be fixed-focus cameras, or both can be zoom cameras, or one can be a fixed-focus camera and the other can be a zoom camera.
  • Not completely the same focal length means that the focal lengths supported by the first camera and the second camera are partly the same or completely different.
  • the image processing method may include the following steps:
  • step S202 when using the image acquisition device to take pictures of the target shooting scene, the user may input a zoom command to perform zoom processing on the captured image.
  • the first image captured by the first camera can be digitally zoomed, and when the zoom ratio matches the focal length of the second camera, the first camera is switched to the second camera to realize optical zoom.
  • step S204 since the focal lengths of the first camera and the second camera are different, the fields of view are also different. Therefore, after the switching of the cameras is completed, the target pixel area can be determined from the first image captured by the first camera, and the target pixel area can have the same field of view as all or part of the pixel areas in the second image captured by the second camera , where having the same field of view means that the content of the scene displayed by the two image areas is the same, but the magnification is different. Then, color processing is performed on the second image by using the color information of the target pixel area to obtain the target image.
  • the color processing can be white balance correction (AWB) processing on the image, or color correction (CCM) processing on the image, or color uniformity (Color Shading) processing on the image, etc. It is not difficult to understand that any Image processing to make the color of the image meet the needs of human eyes is within the protection scope of this application.
  • AVB white balance correction
  • CCM color correction
  • Color uniformity Color Shading
  • the color deviation of the image caused by the difference in the field of view of the two cameras can be eliminated, and the output image before and after camera switching can be guaranteed.
  • the same scene in the same color is consistent.
  • the first image may be the last frame of image taken by the first camera before zooming
  • the second image may be the first frame of image taken by the second camera after zooming
  • the first image may be taken by the first camera before zooming
  • the second image is the zoomed image of the first frame.
  • the first image may be the last frame image captured by the first camera before zooming
  • the second image may be all frame images captured by the second camera after zooming.
  • S206 Output the target image, wherein the image output by the first camera before optical zooming is in the same color as the image area in the target image having the same field of view.
  • step S206 after performing color processing on the second image to obtain the target image, the target image may be output, wherein the processed target image is consistent with the color of the image area having the same field of view in the image output by the first camera, Therefore, there is no jump in the color of images output by the two cameras for the same scene, thereby improving user experience.
  • the consistent color can mean that the colors of the image areas with the same field of view are exactly the same, or roughly the same, that is, there may be a certain deviation between the two, but the deviation is controlled within a small range to ensure the visual perception of the human eye. It seems that there is no color jump phenomenon.
  • the white balance gain of the first image may be corrected based on the white balance gain of the first image.
  • the second image undergoes white balance correction.
  • parameters for other color processing such as color correction, color uniformity processing, etc.
  • the image can be processed more in line with the needs of the human eye.
  • the focal length of the first camera may be shorter than the focal length of the second camera, and the angle of view of the first camera covers the angle of view of the second camera, that is, the second image shows the enlarged content of some pixel areas in the first image . Therefore, the target pixel area may have the same field of view as all pixel areas of the second image.
  • the focal length of the first camera may be greater than the focal length of the second camera, and the angle of view of the second camera covers the angle of view of the first camera, that is, the first image is the enlarged content of some pixel areas in the second image. Therefore, The target pixel area may have the same field of view as the part of the pixel area in the second image.
  • the fields of view of the first camera and the second camera may not be exactly the same, that is, there is a certain overlapping field of view, and the target pixel area may be the image area corresponding to the overlapping field of view in the first image, which is different from the overlapping field of view in the second image.
  • the corresponding image areas have the same field of view.
  • the target pixel area may be determined from the first image based on the current zoom ratio and the relative positional relationship between the first camera and the second camera. As the zoom ratio changes, the content of the image output and displayed to the user will also change. Since the image captured by the second camera corresponds to the zoomed image, the content of the image captured by the second camera can be determined based on the zoom ratio. In addition, because there is a certain deviation in the center positions of the two cameras, the output content of the second camera is not completely the content of the center position of the first image, so it is necessary to determine the image captured by the second camera based on the deviation of the center position of the cameras. A corresponding area in the image to obtain the target pixel area.
  • the first white balance gain when performing white balance correction on the second image based on the white balance gain of the first image, can be determined based on the target pixel area, for example, the target pixel area can be obtained The RGB value of the area, and the first white balance gain is determined based on the RGB value.
  • the method for determining the white balance gain may adopt a grayscale world method, a white balance algorithm based on machine learning, etc., which are not limited in this embodiment of the present disclosure.
  • the sensitivity of the two cameras to red light is different, resulting in the same amount of red light incident on the two cameras.
  • the intensity of the light signals sensed by the image sensors of the two cameras will be different, resulting in color deviation in the images captured by the two cameras.
  • the color mapping relationship between the two cameras can be calibrated in advance.
  • the first white balance gain can be mapped to the color space of the second camera according to the color mapping relationship between the first camera and the second camera, and the second White balance gain. Then use the second white balance gain to perform white balance correction on the second image to obtain and output the target image.
  • white balance correction processing may be performed on the first image based on the first white balance gain, and then the white balance processed first
  • the image is digitally zoomed and output.
  • digital zooming the change of field of view brought about by the change of zoom ratio is not considered, and the color of the scene has always maintained the overall color, and the output image during digital zooming is not its real field of view Corresponds to the true color.
  • the embodiment of the present application can dynamically determine the target pixel area based on the magnification, and use the target pixel area to determine the first white
  • the balance gain is used to correct the white balance of the image output by the first camera, so that the image output during the digital zoom process is more in line with the real color, ensuring that the perceived field of view is consistent before and after the camera is switched.
  • the shooting scene may be complicated, if the target pixel area consistent with the display content of the second image is determined in the first image directly according to the zoom ratio and the relative positional relationship of the two cameras, and based on the target pixel area Determine the first white balance gain.
  • a certain range can be extended around the target pixel area according to the preset expansion ratio, and the surrounding area of the target pixel area
  • the pixel area is expanded to obtain the expanded pixel area, and then the first white balance gain can be determined based on the RGB values of the expanded pixel area.
  • the expansion ratio can be set based on actual requirements, for example, it can be set to 5%, 7% and so on.
  • the field of view of the expanded pixel area is relatively similar to that of the second image as a whole, and can ensure that the determined first white balance gain is more accurate.
  • the white balance gain for performing white balance correction on the image will be different, and the corresponding relationship between the color temperature and the white balance gain can be determined in advance.
  • the first color temperature corresponding to the first white balance gain can be determined first, and then according to the first white balance gain
  • the color mapping relationship between the first camera and the second camera maps the first color temperature to the color space of the second camera to obtain the second color temperature, and then determines the white balance gain corresponding to the second color temperature as the second white balance gain.
  • the color mapping relationship is related to the spectral response characteristics of the two cameras, which can be established during the tuning process, or can be determined according to the spectral response deviations of the image sensors, lenses, and filters of the two cameras. Based on the established color mapping relationship, the photographing device can automatically look up a table to determine the second color temperature corresponding to the first color temperature.
  • the third white balance gain can be further determined based on the RGB value of the second image, and then the second white balance gain and the third white balance gain can be combined to adjust the second camera
  • the multi-frame second images collected are output after white balance correction to obtain multi-frame target images, so that the color of the multi-frame target images output by the second camera changes from the color corrected by the second white balance gain to the color corrected by the third white balance gain. After the color transition.
  • the third white balance gain for example, two white balance gains can be mixed according to a certain ratio, gradually reduce the ratio of the second white balance gain, increase The ratio of the third white
  • the target pixel area may have the same field of view as the reference pixel area in the second image, where the reference pixel area may be the entire pixel area of the second image, or a partial pixel area in the second image .
  • the fourth white balance gain can be determined based on the first image
  • the fifth white balance gain can be determined based on the second image, according to
  • the color deviation between the target pixel area after white balance correction using the fourth white balance gain and the reference pixel area after white balance correction using the fifth white balance gain determines the offset coefficient, which is used to characterize the acquisition of the two cameras In the image with the same field of view, there is color deviation after white balance correction, and then the fifth white balance gain can be adjusted based on the offset coefficient to obtain the sixth white balance gain, and then use the sixth white balance Gain performs white balance correction on the second image to obtain the target image and output it.
  • the target pixel area and the reference pixel area can be pre-calibrated according to the relative positional relationship between the first camera and the second camera.
  • the regions in the images captured by the two cameras that are completely aligned with the real scene are used as the target pixel region and the reference pixel region.
  • the fourth white balance gain when determining the fourth white balance gain based on the first image, may be determined directly based on the RGB values of the full image of the first image. In some embodiments, in order to eliminate the influence of field of view difference when determining the fourth white balance gain, the fourth white balance gain may be determined only according to the RGB values of the target pixel area.
  • the fifth white balance gain in some embodiments, it may be determined according to RGB values of the full image of the second image. In some embodiments, it may also be determined according to the RGB values of the reference pixel area, so as to eliminate the influence of the difference in the field of view.
  • color correction may be further performed on the white balance corrected target pixel area, and after using the fifth white balance gain to perform white balance correction on the reference pixel area, The color correction can be further performed on the reference pixel area after white balance correction, and then the offset coefficient can be determined according to the color deviation between the target pixel area after color correction and the reference pixel area after color correction.
  • the offset coefficient By determining the offset coefficient in this way, it can be more It truly reflects the deviation between the final output image of the first camera and the final output image of the second camera, so that after correcting the second image with the white balance gain adjusted by the offset coefficient, the obtained target image is different from the first The color of the same scene in the image output by the camera is closer.
  • the correction matrix and color temperature for color correction of an image are also interrelated. In order to ensure the accuracy of the correction result, the correction matrix is often different under different color temperatures. Therefore, in some embodiments, when performing color correction on the target pixel area, a correction matrix may be determined based on the third color temperature corresponding to the fourth white balance gain, and then use the correction matrix to perform color correction on the target pixel area. Similarly, when performing color correction on the reference pixel area, a correction matrix may be determined based on the fourth color temperature corresponding to the fifth white balance gain, and then use the correction matrix to perform color correction on the reference pixel area.
  • the presented color is the real color of the image output by the second camera, that is, only corrected by the sixth white balance gain. In this way, it can avoid that the first camera needs to work all the time, and the fourth white balance gain is determined based on the collected first image and sent to the second camera.
  • the image acquisition device includes a short-focus camera 1 and a telephoto camera 2
  • the zooming process when switching from camera 1 to camera 2 (similar to switching from camera 2 to camera 1), due to the angle of view and contrast of camera 1 and camera 2
  • There are differences in the response characteristics of light resulting in a large difference in the color of the image area with the same field of view in the output image before and after the camera is switched.
  • the following image processing methods are provided to make the output image color consistent before and after camera switching.
  • the image area with the same field of view as image 2 can be determined from image 1 collected by camera 1 based on the zoom ratio, and the white balance gain can be determined based on the image area to correct image 2, so that the two images caused by different fields of view can be eliminated.
  • the image output by the camera is different.
  • the camera 1 After the camera 1 captures the image 1, it can determine the ROI area in the image 1 based on the current zoom ratio and the positional relationship between the two cameras, wherein the ROI area and the image 2 captured by the camera 2 have the same viewing angle. field.
  • the white balance correction of image 1 can be performed by using the white balance gain 1, and then based on the zoom ratio, after sampling from the central area of the white balance corrected image 1, a digital zoom image is obtained and output .
  • the camera 2 can also determine the white balance gain 3 and the color temperature 3 based on the RGB values of the image 2 .
  • White balance correction can be performed on the multi-frame image 2 output by the camera in combination with white balance gain 2 and white balance gain 3, so that the color of the output optical zoom image is corrected from the color corrected by white balance gain 2 to white balance gain 3
  • the final color transition is consistent with the color of image 1 captured by camera 1 when the camera first switches, and then gradually transitions to the real color of image 2 captured by camera 2, so that there will be no color jump, but a slow transition .
  • the ROI area whose field of view is completely aligned can be selected from the images collected by the two cameras, and the offset coefficient is determined based on the color deviation of the ROI area after the camera performs balance correction on the ROI area, and the image color is adjusted using the offset coefficient. Adjust to make the color of the images output by the two cameras consistent for the same scene. As shown in Figure 4(b), it specifically includes the following steps:
  • ROI area 1 can be determined from image 1 collected by camera 1
  • ROI area 2 can be determined from image 2 collected by camera 2, wherein ROI area 1 and ROI Region 2 has the same field of view and is a completely aligned region of the two cameras.
  • ROI region 1 and ROI region can be pre-calibrated based on the positional relationship of the two cameras.
  • White balance gain 1 and color temperature 1 can be determined based on the RGB value of ROI area 1, and the white balance correction of ROI area 1 can be performed using white balance gain 1, and then the color correction matrix CCM1 corresponding to color temperature 1 can be determined, and white balance correction can be performed using CCM1 ROI area 1 is further color corrected.
  • White balance gain 2 and color temperature 2 can be determined based on the RGB value of ROI area 2, and the white balance correction of ROI area 2 can be performed using white balance gain 2, and then the color correction matrix CCM2 corresponding to color temperature 2 can be determined, and white balance correction can be performed using CCM2 ROI area 2 for further color correction.
  • the embodiment of the present application also provides an image processing device.
  • the processor 51 can implement the following steps when executing the computer program:
  • the color information of the first image captured by the first camera to perform color processing on the second image captured by the second camera to obtain a target image, wherein the color information is based on the target pixel area in the first image Acquiring that the target pixel area has the same field of view as all or part of the pixel area of the second image;
  • the processor is configured to use the color information of the first image captured by the first camera to perform color processing on the second image captured by the second camera, specifically for:
  • the processor when the processor is configured to perform white balance correction on the second image based on the white balance gain for performing white balance correction on the first image, it is specifically used to:
  • the second white balance gain is obtained based on the color mapping relationship between the first camera and the second camera and the first white balance gain, wherein the color mapping relationship is based on the spectral response characteristic of the first camera and the first white balance gain.
  • the spectral response characteristics of the second camera are determined;
  • the processor is configured to use the target pixel area to determine the first white balance gain, specifically for:
  • the extended pixel area includes the target pixel area and pixel areas around the target pixel area;
  • the first white balance gain is determined by using RGB values of the extended pixel area.
  • the processor when the processor is configured to obtain the second white balance gain based on the color mapping relationship between the first camera and the second camera and the first white balance gain, it is specifically configured to:
  • a white balance gain corresponding to the second color temperature is determined as the second white balance gain.
  • the processor is further configured to:
  • white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the second white balance gain to the color corrected by the third white balance gain.
  • the viewing angle of the first camera covers the viewing angle of the second camera, and the target pixel area has the same field of view as all pixel areas of the second image;
  • the viewing angle of the second camera covers the viewing angle of the first camera, and the target pixel area has the same field of view as a partial pixel area of the second image.
  • the target pixel area is determined based on a zoom factor and a relative positional relationship between the first camera and the second camera.
  • the target pixel area has the same field of view as the reference pixel area in the second image
  • the processor When the processor is used to perform white balance correction on the second image based on the white balance gain for performing white balance correction on the first image, it is specifically used to:
  • the processor when the processor is configured to determine the fourth white balance gain based on the first image, it is specifically configured to:
  • determining a fifth white balance gain based on the second image comprising:
  • the fifth white balance gain is determined based on RGB values of the reference pixel region in the second image.
  • the processor is configured to use the fourth white balance gain to perform white balance correction based on the color deviation between the target pixel area after white balance correction and the fifth white balance gain.
  • the offset coefficient it is specifically used for:
  • the offset coefficient is determined based on a color deviation between the color-corrected target pixel area and the color-corrected reference pixel area.
  • the correction matrix for performing color correction on the target pixel area is determined based on a third color temperature, and the third color temperature is determined based on the fourth white balance gain;
  • a correction matrix for performing color correction on the white balance corrected reference pixel area is determined based on a fourth color temperature, and the fourth color temperature is determined based on a fifth white balance gain.
  • the target pixel area and the reference pixel area are pre-calibrated and obtained based on the relative positional relationship between the first camera and the second camera.
  • the processor is further configured to:
  • white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the sixth white balance gain to the color corrected by the fifth white balance gain.
  • an image acquisition device is provided in an embodiment of the present application, and the image acquisition device includes a first camera, a second camera, and the image processing apparatus according to any one of the above embodiments.
  • the image acquisition device can hold various devices equipped with at least two cameras, such as a pan-tilt camera, a mobile phone, and a drone.
  • the embodiments of this specification further provide a computer storage medium, where a program is stored in the storage medium, and when the program is executed by a processor, the method in any of the foregoing embodiments is implemented.
  • Embodiments of the present description may take the form of a computer program product embodied on one or more storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) having program code embodied therein.
  • Computer usable storage media includes both volatile and non-permanent, removable and non-removable media, and may be implemented by any method or technology for information storage.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of storage media for computers include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • Flash memory or other memory technology
  • CD-ROM Compact Disc Read-Only Memory
  • DVD Digital Versatile Disc
  • Magnetic tape cartridge tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to
  • the device embodiment since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.

Landscapes

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

Abstract

An image processing method and apparatus, and an image collection device and a storage medium. The method comprises: for the same target photographing scene, switching a first camera of an image collection device to a second camera, so as to realize optical zoom (S202); performing, by using color information of a first image collected by the first camera, color processing on a second image collected by the second camera, so as to obtain a target image, wherein the color information is acquired on the basis of a target pixel area in the first image, and the target pixel area has the same field of view as all or some pixel areas of the second image (S204); and outputting the target image, wherein image areas having the same field of view in an image output before optical zoom by the first camera and the target image have the same color (S206). By means of the method, the effect of a field of view difference on an image color can be eliminated, thereby ensuring that identical scenes in images output before and after the switching of a camera have the same color.

Description

图像处理方法、装置、图像采集设备及存储介质Image processing method, device, image acquisition device and storage medium 技术领域technical field
本申请涉及图像处理技术领域,具体而言,涉及一种图像处理方法、装置、图像采集设备及存储介质。The present application relates to the technical field of image processing, and in particular, to an image processing method, device, image acquisition device, and storage medium.
背景技术Background technique
为了可以实现图像采集设备进行不同倍率的变焦之后,得到的图像仍然比较清晰,目前,很多图像采集设备都设置多个不同焦距的摄像头,在变焦倍率达到下一个摄像头对应的变焦倍率时,可以将摄像头从当前摄像头切换至下一个摄像头,利用下一个摄像头采集图像,以实现光学变焦,得到清晰的图像。但是由于不同摄像头之间存在差异,导致摄像头切换前后由不同摄像头输出的图像中同样的场景的色彩存在较大的差异,影响用户的体验。In order to realize that after the image acquisition device zooms with different magnifications, the obtained image is still relatively clear. At present, many image acquisition devices are equipped with multiple cameras with different focal lengths. When the zoom magnification reaches the corresponding zoom magnification of the next camera, the The camera switches from the current camera to the next camera, and uses the next camera to collect images to achieve optical zoom and obtain clear images. However, due to the differences between different cameras, the colors of the same scene in the images output by different cameras before and after camera switching are quite different, which affects user experience.
发明内容Contents of the invention
有鉴于此,本申请提供一种图像处理方法、装置、图像采集设备及存储介质。In view of this, the present application provides an image processing method, device, image acquisition device and storage medium.
根据本申请的第一方面,提供一种图像处理方法,所述方法包括:According to a first aspect of the present application, an image processing method is provided, the method comprising:
对同一目标拍摄场景,将图像采集设备的第一摄像头切换至第二摄像头以实现光学变焦;For the same target shooting scene, switch the first camera of the image acquisition device to the second camera to achieve optical zoom;
利用光学变焦前所述第一摄像头采集的第一图像的色彩信息对光学变焦后所述第二摄像头采集的第二图像进行色彩处理,得到目标图像,其中,所述色彩信息基于所述第一图像中的目标像素区域获取,所述目标像素区域与所述第二图像的全部或部分像素区域具有相同的视场;Using the color information of the first image captured by the first camera before the optical zoom to perform color processing on the second image captured by the second camera after the optical zoom to obtain a target image, wherein the color information is based on the first Acquiring a target pixel area in the image, where the target pixel area has the same field of view as all or part of the pixel area of the second image;
输出所述目标图像,其中,光学变焦前所述第一摄像头输出的图像和所述目标图像中具有相同视场的图像区域色彩一致。Outputting the target image, wherein the image output by the first camera before the optical zoom is in the same color as the image area in the target image having the same field of view.
根据本申请的第二方面,提供一种图像处理装置,所述装置包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时可实现以下步骤:According to the second aspect of the present application, there is provided an image processing device, the device includes a processor, a memory, and a computer program stored in the memory for execution by the processor, when the processor executes the computer program The following steps can be implemented:
对同一目标拍摄场景,将图像采集设备的第一摄像头切换至第二摄像头以实现光学变焦;For the same target shooting scene, switch the first camera of the image acquisition device to the second camera to achieve optical zoom;
利用光学变焦前所述第一摄像头采集的第一图像的色彩信息对光学变焦后所述第二摄像头采集的第二图像进行色彩处理,得到目标图像,其中,所述色彩信息基于所述第一图像中的目标像素区域获取,所述目标像素区域与所述第二图像的全部或部分像素区域具有相同的视场;Using the color information of the first image captured by the first camera before the optical zoom to perform color processing on the second image captured by the second camera after the optical zoom to obtain a target image, wherein the color information is based on the first Acquiring a target pixel area in the image, where the target pixel area has the same field of view as all or part of the pixel area of the second image;
输出所述目标图像,其中,光学变焦前所述第一摄像头输出的图像和所述目标图像中具有相同视场的图像区域色彩一致。Outputting the target image, wherein the image output by the first camera before the optical zoom is in the same color as the image area in the target image having the same field of view.
根据本申请的第三方面,提供一种图像采集设备,所述图像采集包括第一摄像头、第二摄像头和上述第二方面提及的图像处理装置。According to a third aspect of the present application, an image acquisition device is provided, and the image acquisition includes a first camera, a second camera, and the image processing device mentioned in the second aspect above.
根据本申请的第四方面,提供一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被执行时实现上述第一方面提及的方法。According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed, the method mentioned in the above-mentioned first aspect is implemented .
应用本申请提供的方案,在切换摄像头实现光学变焦的场景,可以从第一摄像头采集的第一图像中确定目标像素区域,目标像素区域与第二摄像头采集的第二图像中的全部或部分像素区域具有相同的视场,然后利用基于目标像素区域得到的色彩信息对第二图像进行色彩处理,通过利用和第二图像的像素区域具有相同视场的目标像素区域的色彩信息对第二图像进行色彩处理,可以消除视场差异造成两个摄像头输出的图像的色彩差异,从而可以使得两个摄像头切换前后,针对同样的场景输出的图像的色彩一致。Applying the solution provided by this application, in the scene where the camera is switched to achieve optical zoom, the target pixel area can be determined from the first image captured by the first camera, and the target pixel area and all or part of the pixels in the second image captured by the second camera The regions have the same field of view, and then use the color information obtained based on the target pixel region to perform color processing on the second image, and perform color processing on the second image by using the color information of the target pixel region that has the same field of view as the pixel region of the second image Color processing can eliminate the color difference of the images output by the two cameras caused by the difference in the field of view, so that the colors of the images output by the two cameras for the same scene can be consistent before and after switching.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述 中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本申请一个实施例的摄像头切换前后输出的图像的示意图。FIG. 1 is a schematic diagram of images output before and after camera switching according to an embodiment of the present application.
图2是本申请一个实施例的一种图像处理方法的示意图图。Fig. 2 is a schematic diagram of an image processing method according to an embodiment of the present application.
图3是本申请一个实施例的对目标像素区域进行扩展得到扩展像素区域的示意图。FIG. 3 is a schematic diagram of an expanded pixel area obtained by extending a target pixel area according to an embodiment of the present application.
图4(a)是本申请一个实施例的图像处理方法的示意图。Fig. 4(a) is a schematic diagram of an image processing method according to an embodiment of the present application.
图4(b)是本申请另一个实施例的图像处理方法的示意图。Fig. 4(b) is a schematic diagram of an image processing method according to another embodiment of the present application.
图5是本申请一个实施例的图像处理装置的逻辑结构的示意图。Fig. 5 is a schematic diagram of a logical structure of an image processing device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
为了解决采用数码变焦得到的图像画质很差的问题,目前提供了一种多个摄像头接力变焦的技术,即一个图像采集设备中可以设有多个摄像头,这些摄像头的焦距可以不同,在用户对图像采集设备进行变焦的过程中,可以基于变焦倍率将摄像头切换至焦距与该变焦倍率匹配的摄像头,以利用切换后的摄像头进行图像采集,通过这种方式,使得图像采集设备可以支持较大的焦距范围,并且变焦过程中得到的图像清晰度比较高,画质较好。In order to solve the problem of poor image quality obtained by digital zooming, a multi-camera relay zoom technology is currently provided, that is, one image acquisition device can be equipped with multiple cameras, and the focal lengths of these cameras can be different. In the process of zooming the image acquisition device, the camera can be switched to the camera whose focal length matches the zoom ratio based on the zoom ratio, so as to use the switched camera for image acquisition. In this way, the image acquisition device can support larger The focal length range, and the images obtained during the zooming process have relatively high definition and good quality.
针对光学变焦场景下的摄像头切换,由于两个摄像头焦距不同,视野也不同,在变焦过程中,摄像头视野是不断变化的。比如,假设第一摄像头是短焦摄像头,其具有更大的视野范围,第二摄像头是长焦摄像头,其 视野范围更小,仅是第一摄像头视野范围的一部分。在变焦过程中,先是利用第一摄像头采集的图像进行数码变焦,当变焦倍率与第二摄像头的焦距匹配时,则切换至第二摄像头。For camera switching in the optical zoom scene, since the focal lengths of the two cameras are different, the field of view is also different. During the zooming process, the field of view of the camera is constantly changing. For example, assume that the first camera is a short-focus camera with a larger field of view, and the second camera is a telephoto camera with a smaller field of view that is only a part of the field of view of the first camera. During the zooming process, digital zooming is first performed using images captured by the first camera, and when the zoom ratio matches the focal length of the second camera, the camera is switched to the second camera.
而相关技术中,在对两个摄像头输出的图像进行色彩处理时,并没有考虑摄像头视场的差异对输出图像色彩的影响,导致最后两个摄像头输出的图像中同样的场景的色彩存在较大的偏差,如图1所示,图像采集设备从摄像头1切换至摄像2时,摄像头1输出的图像1与摄像头2输出的图像2中具有相同视场的图像区域的色彩存在较大差异。从而当摄像头切换前后,输出的图像的色彩可能存在跳变的问题,严重影响用户的体验。However, in the related art, when color processing the images output by the two cameras, the influence of the difference in the field of view of the cameras on the color of the output image is not considered, resulting in a large difference in the color of the same scene in the images output by the last two cameras. As shown in Figure 1, when the image acquisition device switches from camera 1 to camera 2, there is a large difference in the color of the image area with the same field of view in image 1 output by camera 1 and image 2 output by camera 2. Therefore, when the camera is switched, the color of the output image may jump, which seriously affects the user's experience.
此外,由于不同的摄像设备中图像传感器、滤光片、以及镜头对光的响应特性均存在一定的差异,导致最后摄像头输出的图像中相同视场也会存在较大的色彩偏差。In addition, due to the differences in the response characteristics of image sensors, filters, and lenses to light in different camera devices, there will be a large color deviation in the same field of view in the final image output by the camera.
基于此,本申请实施例提供了一种图像处理方法,在切换摄像头实现光学变焦的场景,可以从第一摄像头采集的第一图像中确定目标像素区域,目标像素区域与第二摄像头采集的第二图像中的全部或部分像素区域具有相同的视场,然后利用基于目标像素区域得到的色彩信息对第二图像进行色彩处理,通过利用和第二图像的像素区域具有相同视场的目标像素区域的色彩信息对第二图像进行色彩处理,可以消除视场差异对两个摄像头输出的图像的色彩的影响,从而可以避免两个摄像头切换前后,针对同样的场景输出的图像的色彩存在较大偏差。Based on this, the embodiment of the present application provides an image processing method. In the scene where the camera is switched to realize optical zoom, the target pixel area can be determined from the first image captured by the first camera, and the target pixel area and the first image captured by the second camera can be determined. All or part of the pixel areas in the second image have the same field of view, and then use the color information obtained based on the target pixel area to perform color processing on the second image, by using the target pixel area that has the same field of view as the pixel area of the second image The color information of the second image is color processed, which can eliminate the influence of the field of view difference on the color of the image output by the two cameras, so as to avoid the large deviation in the color of the image output for the same scene before and after the switching of the two cameras .
本申请实施例的图像处理方法可以用于对各种搭载有至少两个摄像头的图像采集设备采集的图像进行处理,该方法可以由图像采集设备执行,也可以由专门的图像处理设备执行。The image processing method of the embodiment of the present application can be used to process images collected by various image acquisition devices equipped with at least two cameras, and the method can be executed by the image acquisition device or by a specialized image processing device.
该图像采集设备可以是手机、相机、云台、无人机、无人小车等等。在一些实施例中,图像采集设备中可以包括用户交互界面,图像采集设备采集的图像可以在用户交互界面显示,以供用户查看。在一些实施例中,图像采集设备可以与控制终端通信连接,图像采集设备可以将采集的图像 发送给控制终端,以在控制终端的交互界面进行显示,以供用户查看。比如,无人机采集的图像发送到用户的手机当中,供用户查看。The image acquisition device can be a mobile phone, a camera, a cloud platform, a drone, an unmanned car, and the like. In some embodiments, the image acquisition device may include a user interaction interface, and images acquired by the image acquisition device may be displayed on the user interaction interface for viewing by the user. In some embodiments, the image acquisition device may be communicatively connected with the control terminal, and the image acquisition device may send the acquired image to the control terminal to be displayed on the interactive interface of the control terminal for the user to view. For example, the image collected by the drone is sent to the user's mobile phone for the user to view.
图像采集设备中至少包括第一摄像头和第二摄像头,第一摄像头支持的焦距与第二摄像头支持的焦距不完全相同。其中,第一摄像头和第二摄像可以是均为定焦摄像头,也可以是均为变焦摄像头,或者一个是定焦摄像头,一个变焦摄像头。焦距不完全相同是指第一摄像头和第二摄像头支持的焦距部分相同或者完全不同。The image acquisition device includes at least a first camera and a second camera, and the focal length supported by the first camera is not exactly the same as that supported by the second camera. Wherein, the first camera and the second camera can both be fixed-focus cameras, or both can be zoom cameras, or one can be a fixed-focus camera and the other can be a zoom camera. Not completely the same focal length means that the focal lengths supported by the first camera and the second camera are partly the same or completely different.
具体的,如图2所示,所述图像处理方法可以包括以下步骤:Specifically, as shown in Figure 2, the image processing method may include the following steps:
S202、对同一目标拍摄场景,将图像采集设备的第一摄像头切换至第二摄像头以实现光学变焦;S202. For the same target shooting scene, switch the first camera of the image acquisition device to the second camera to achieve optical zoom;
在步骤S202中,在使用图像采集设备对目标拍摄场景进行拍照时,用户可以输入变焦指令,对采集的图像进行变焦处理。在变焦过程中,可以先对第一摄像采集的第一图像进行数码变焦,当变焦倍率与第二摄像头的焦距匹配时,则将第一摄像头切换至第二摄像头,以实现光学变焦。In step S202, when using the image acquisition device to take pictures of the target shooting scene, the user may input a zoom command to perform zoom processing on the captured image. During the zooming process, the first image captured by the first camera can be digitally zoomed, and when the zoom ratio matches the focal length of the second camera, the first camera is switched to the second camera to realize optical zoom.
S204、利用光学变焦前所述第一摄像头采集的第一图像的色彩信息对光学变焦后所述第二摄像头采集的第二图像进行色彩处理,得到目标图像,其中,所述色彩信息基于所述第一图像中的目标像素区域获取,所述目标像素区域与所述第二图像的全部或部分像素区域具有相同的视场;S204. Use the color information of the first image captured by the first camera before optical zoom to perform color processing on the second image captured by the second camera after optical zoom to obtain a target image, wherein the color information is based on the Obtaining a target pixel area in the first image, where the target pixel area has the same field of view as all or part of the pixel area in the second image;
在步骤S204中,由于第一摄像头和第二摄像头焦距不同,视野也不同。因而,在完成摄像头的切换后,可以从第一摄像头采集的第一图像中确定目标像素区域,目标像素区域可以和第二摄像头采集的第二图像中的全部或者部分像素区域具有相同的视场,其中,具有相同的视场是指两个图像区域展示的场景内容一致,只是放大倍率不同。然后利用目标像素区域的色彩信息对第二图像进行颜色处理,得到目标图像。其中,颜色处理可以是对图像进行白平衡校正(AWB)处理,或者是对图像进行颜色校正(CCM)处理,或者是对图像进行色彩均匀性(Color Shading)处理等,不难理解,任意对图像进行处理使得图像的颜色符合人眼需求的色彩处理 均在本申请保护范围内。In step S204, since the focal lengths of the first camera and the second camera are different, the fields of view are also different. Therefore, after the switching of the cameras is completed, the target pixel area can be determined from the first image captured by the first camera, and the target pixel area can have the same field of view as all or part of the pixel areas in the second image captured by the second camera , where having the same field of view means that the content of the scene displayed by the two image areas is the same, but the magnification is different. Then, color processing is performed on the second image by using the color information of the target pixel area to obtain the target image. Among them, the color processing can be white balance correction (AWB) processing on the image, or color correction (CCM) processing on the image, or color uniformity (Color Shading) processing on the image, etc. It is not difficult to understand that any Image processing to make the color of the image meet the needs of human eyes is within the protection scope of this application.
通过利用和第二图像中的像素区域具有相同视场的目标像素区域的颜色信息对第二图像进行色彩处理,可以消除两个摄像头视场差异造成图像的色彩偏差,保证摄像头切换前后输出的图像中相同的场景色彩一致。By using the color information of the target pixel area that has the same field of view as the pixel area in the second image to perform color processing on the second image, the color deviation of the image caused by the difference in the field of view of the two cameras can be eliminated, and the output image before and after camera switching can be guaranteed. The same scene in the same color is consistent.
其中,第一图像可以是变焦前第一摄像头拍摄的最后一帧图像,第二图像可以是变焦后第二摄像头拍摄的第一帧图像,或者,第一图像可以是变焦前第一摄像头拍摄的除最后一帧图像以外的其他图像,第二图像是变焦后的第一帧图像。或者,第一图像可以是变焦前第一摄像头拍摄的最后一帧图像,第二图像可以是变焦后第二摄像头拍摄的所有帧图像。只要第一图像中可以找到和第二摄像头的部分或者全部像素区域具有相同视场的像素区域即可,本公开实施例不做限制。Wherein, the first image may be the last frame of image taken by the first camera before zooming, the second image may be the first frame of image taken by the second camera after zooming, or the first image may be taken by the first camera before zooming For images other than the last image, the second image is the zoomed image of the first frame. Alternatively, the first image may be the last frame image captured by the first camera before zooming, and the second image may be all frame images captured by the second camera after zooming. As long as a pixel area having the same field of view as part or all of the pixel area of the second camera can be found in the first image, this embodiment of the present disclosure does not make a limitation.
S206、输出所述目标图像,其中,光学变焦前所述第一摄像头输出的图像和所述目标图像中具有相同视场的图像区域色彩一致。S206. Output the target image, wherein the image output by the first camera before optical zooming is in the same color as the image area in the target image having the same field of view.
在步骤S206中,在对第二图像进行颜色处理得到目标图像后,可以将目标图像输出,其中,处理得到的目标图像和第一摄像头输出的图像中具有相同视场的图像区域的颜色一致,使得两个摄像头中针对相同的场景输出的图像的色彩不存在跳变,提升用户体验。In step S206, after performing color processing on the second image to obtain the target image, the target image may be output, wherein the processed target image is consistent with the color of the image area having the same field of view in the image output by the first camera, Therefore, there is no jump in the color of images output by the two cameras for the same scene, thereby improving user experience.
其中,颜色一致可以是指具有相同视场的图像区域的颜色完全相同,也可以是大致相同,即两者可以存在一定的偏差,但该偏差控制在较小的范围内,保证人眼视觉感官上看来不存在色彩跳变现象即可。Among them, the consistent color can mean that the colors of the image areas with the same field of view are exactly the same, or roughly the same, that is, there may be a certain deviation between the two, but the deviation is controlled within a small range to ensure the visual perception of the human eye. It seems that there is no color jump phenomenon.
在一些实施例中,在利用第一摄像头采集的第一图像的色彩信息对第二摄像头采集的第二图像进行色彩处理时,可以是基于对第一图像进行白平衡校正的白平衡增益对第二图像进行白平衡校正。当然,也可以是利用对第一图像进行其他颜色处理(比如,颜色校正、颜色均匀性处理等)的参数确定对第二图像进行颜色处理的参数等,只要是对图像进行色彩处理,使得输出的图像更加符合人眼需求的处理即可。In some embodiments, when using the color information of the first image captured by the first camera to perform color processing on the second image captured by the second camera, the white balance gain of the first image may be corrected based on the white balance gain of the first image. The second image undergoes white balance correction. Of course, it is also possible to use parameters for other color processing (such as color correction, color uniformity processing, etc.) The image can be processed more in line with the needs of the human eye.
在一些实施例中,第一摄像头的焦距可以小于第二摄像头的焦距,第 一摄像头的视角覆盖第二摄像头的视角,即第二图像展示的是第一图像中部分像素区域的放大后的内容。因此,目标像素区域可以是与第二图像的全部像素区域具有相同的视场。In some embodiments, the focal length of the first camera may be shorter than the focal length of the second camera, and the angle of view of the first camera covers the angle of view of the second camera, that is, the second image shows the enlarged content of some pixel areas in the first image . Therefore, the target pixel area may have the same field of view as all pixel areas of the second image.
在一些实施例中,第一摄像头的焦距可以大于第二摄像头的焦距,第二摄像头的视角覆盖第一摄像头的视角,即第一图像是第二图像中部分像素区域放大后的内容,因而,目标像素区域可以与第二图像中的该部分像素区域具有相同的视场。In some embodiments, the focal length of the first camera may be greater than the focal length of the second camera, and the angle of view of the second camera covers the angle of view of the first camera, that is, the first image is the enlarged content of some pixel areas in the second image. Therefore, The target pixel area may have the same field of view as the part of the pixel area in the second image.
当然,第一摄像头和第二摄像头的视野也可以是不完全相同,即存在一定的重叠视野,目标像素区域可以是第一图像中该重叠视野对应的图像区域,与第二图像中该重叠视野对应的图像区域视野一致。Of course, the fields of view of the first camera and the second camera may not be exactly the same, that is, there is a certain overlapping field of view, and the target pixel area may be the image area corresponding to the overlapping field of view in the first image, which is different from the overlapping field of view in the second image. The corresponding image areas have the same field of view.
在一些实施例中,目标像素区域可以基于当前的变焦倍率,以及第一摄像头和第二摄像头的相对位置关系从第一图像中确定。随着变焦倍率的变化,输出并展示给用户的图像内容也会发生变化,由于第二摄像头采集的图像对应于变焦后的图像,因而可以基于变焦倍率确定第二摄像头采集的图像的内容。此外,由于两个摄像头的中心位置存在一定的偏差,第二摄像头输出的内容并非完全是第一图像中心位置的内容,因而还需结合摄像头中心位置的偏差来确定第二摄像头采集的图像在第一图像中的对应区域,得到目标像素区域。In some embodiments, the target pixel area may be determined from the first image based on the current zoom ratio and the relative positional relationship between the first camera and the second camera. As the zoom ratio changes, the content of the image output and displayed to the user will also change. Since the image captured by the second camera corresponds to the zoomed image, the content of the image captured by the second camera can be determined based on the zoom ratio. In addition, because there is a certain deviation in the center positions of the two cameras, the output content of the second camera is not completely the content of the center position of the first image, so it is necessary to determine the image captured by the second camera based on the deviation of the center position of the cameras. A corresponding area in the image to obtain the target pixel area.
在一些实施例中,在基于对第一图像进行白平衡校正的白平衡增益对第二图像进行白平衡校正时,可以先基于该目标像素区域确定第一白平衡增益,比如,可以获取目标像素区域的RGB值,基于该RGB值确定第一白平衡增益。其中,确定白平衡增益的方法可以采用灰度世界法、基于机器学习的白平衡算法等,本公开实施例不做限制。In some embodiments, when performing white balance correction on the second image based on the white balance gain of the first image, the first white balance gain can be determined based on the target pixel area, for example, the target pixel area can be obtained The RGB value of the area, and the first white balance gain is determined based on the RGB value. Wherein, the method for determining the white balance gain may adopt a grayscale world method, a white balance algorithm based on machine learning, etc., which are not limited in this embodiment of the present disclosure.
由于第一摄像头和第二摄像头中的图像传感器、滤光片以及镜头对光的响应特性存在一定的差异,比如,两个摄像头对红光的敏感程度不同,导致同等量的红光入射到两个摄像头中后,两个摄像头图像传感器感应到的光信号强度会不同,从而导致两个摄像头采集的图像存在色彩偏差。为 了消除两个摄像头对光响应特性的差异导致的色彩偏差,可以预先标定两个摄像头之间的色彩映射关系。在基于第一图像中的目标像素区域确定第一白平衡增益后,可以根据第一摄像头和第二摄像头的色彩映射关系将第一白平衡增益映射到第二摄像头的色彩空间中,得到第二白平衡增益。然后利用第二白平衡增益对第二图像进行白平衡校正,得到目标图像并输出。Because there are certain differences in the response characteristics of the image sensors, filters, and lenses in the first camera and the second camera to light, for example, the sensitivity of the two cameras to red light is different, resulting in the same amount of red light incident on the two cameras. After the two cameras are integrated, the intensity of the light signals sensed by the image sensors of the two cameras will be different, resulting in color deviation in the images captured by the two cameras. In order to eliminate the color deviation caused by the difference of the light response characteristics of the two cameras, the color mapping relationship between the two cameras can be calibrated in advance. After determining the first white balance gain based on the target pixel area in the first image, the first white balance gain can be mapped to the color space of the second camera according to the color mapping relationship between the first camera and the second camera, and the second White balance gain. Then use the second white balance gain to perform white balance correction on the second image to obtain and output the target image.
通过上述方式,既可以消除两个摄像头视场的差异造成的图像色彩偏差,也可以消除两个摄像头对光响应特性的差异造成的图像色彩的偏差,使得摄像头切换前后输出的图像中相同的场景颜色一致。Through the above method, it can not only eliminate the image color deviation caused by the difference in the field of view of the two cameras, but also eliminate the image color deviation caused by the difference in the light response characteristics of the two cameras, so that the same scene in the image output before and after the camera is switched The color is consistent.
此外,在一些实施例中,在基于目标像素区域确定第一白平衡增益后,可以基于第一白平衡增益对第一图像进行白平衡校正处理,然后基于变焦倍率将白平衡处理后的第一图像进行数码变焦后输出。相关技术中,在数码变焦时,并没有考虑随着变焦倍率的变化带来的视场的变化,场景的色彩一直都是维持全局的色彩,对于数码变焦时输出的图像并非是其真实视场对应的真实的色彩。相比于直接基于第一图像的全图确定白平衡校正增益,对第一摄像头输出的图像进行校正,本申请实施例可以基于放大倍率动态的确定目标像素区域,利用目标像素区域确定第一白平衡增益来对第一摄像头输出的图像进行白平衡校正,使得数码变焦过程输出的图像也更加符合真实色彩,保证摄像头切换前后感知的视场一致。In addition, in some embodiments, after the first white balance gain is determined based on the target pixel area, white balance correction processing may be performed on the first image based on the first white balance gain, and then the white balance processed first The image is digitally zoomed and output. In related technologies, when digital zooming, the change of field of view brought about by the change of zoom ratio is not considered, and the color of the scene has always maintained the overall color, and the output image during digital zooming is not its real field of view Corresponds to the true color. Compared with directly determining the white balance correction gain based on the full image of the first image and correcting the image output by the first camera, the embodiment of the present application can dynamically determine the target pixel area based on the magnification, and use the target pixel area to determine the first white The balance gain is used to correct the white balance of the image output by the first camera, so that the image output during the digital zoom process is more in line with the real color, ensuring that the perceived field of view is consistent before and after the camera is switched.
在一些实施例中,由于拍摄场景可能比较复杂,如果直接根据变焦倍率和两个摄像头的相对位置关系在在第一图像中确定与第二图像展示内容一致的目标像素区域,并基于目标像素区域确定第一白平衡增益,可能存在确定的目标像素区域对应的场景不太适合用于确定白平衡增益,比如,是一面白墙,或者说确定的目标像素区域不够精准,和第二图像展示的内容存在一定的偏差,从而最终基于目标像素区域得到的白平衡增益不太准确。为了尽量避免上述问题,如图3所示,在确定白平衡增益时,可以在目标像素区域的基础上按照预设的扩展比例向目标像素区域的周围扩展一定的范围,将目标像素区域周围的像素区域扩充进来,得到扩展像素区域, 然后可以基于扩展像素区域的RGB值确定第一白平衡增益。其中,扩展比例可以基于实际需求设定,比如,可以设置为5%、7%等。扩展像素区域的视场和第二图像整体较为相似,并且可以确保确定的第一白平衡增益更加准确。In some embodiments, since the shooting scene may be complicated, if the target pixel area consistent with the display content of the second image is determined in the first image directly according to the zoom ratio and the relative positional relationship of the two cameras, and based on the target pixel area Determine the first white balance gain. There may be scenes corresponding to the determined target pixel area that are not suitable for determining the white balance gain. For example, it is a white wall, or the determined target pixel area is not accurate enough, and the second image shows There is a certain deviation in the content, so the final white balance gain based on the target pixel area is not very accurate. In order to avoid the above problems as much as possible, as shown in Figure 3, when determining the white balance gain, based on the target pixel area, a certain range can be extended around the target pixel area according to the preset expansion ratio, and the surrounding area of the target pixel area The pixel area is expanded to obtain the expanded pixel area, and then the first white balance gain can be determined based on the RGB values of the expanded pixel area. Wherein, the expansion ratio can be set based on actual requirements, for example, it can be set to 5%, 7% and so on. The field of view of the expanded pixel area is relatively similar to that of the second image as a whole, and can ensure that the determined first white balance gain is more accurate.
通常,不同色温下,对图像进行白平衡校正的白平衡增益会不同,可以预先确定色温和白平衡增益的对应关系。在一些实施例中,在基于第一摄像头和第二摄像头的色彩映射关系以及第一白平衡增益得到第二白平衡增益时,可以先确定第一白平衡增益对应的第一色温,然后根据第一摄像头和第二摄像头的色彩映射关系将第一色温映射到第二摄像头的色彩空间,得到第二色温,然后将第二色温对应的白平衡增益确定为第二白平衡增益。色彩映射关系与两个摄像头的光谱响应特性相关,可以在调试(tuning)的过程中建立,也可以根据两个摄像头的图像传感器、镜头、滤光片的光谱响应偏差确定上述的色彩映射关系。基于建立的色彩映射关系,拍摄设备自动查表可以确定第一色温对应的第二色温。Generally, at different color temperatures, the white balance gain for performing white balance correction on the image will be different, and the corresponding relationship between the color temperature and the white balance gain can be determined in advance. In some embodiments, when the second white balance gain is obtained based on the color mapping relationship between the first camera and the second camera and the first white balance gain, the first color temperature corresponding to the first white balance gain can be determined first, and then according to the first white balance gain The color mapping relationship between the first camera and the second camera maps the first color temperature to the color space of the second camera to obtain the second color temperature, and then determines the white balance gain corresponding to the second color temperature as the second white balance gain. The color mapping relationship is related to the spectral response characteristics of the two cameras, which can be established during the tuning process, or can be determined according to the spectral response deviations of the image sensors, lenses, and filters of the two cameras. Based on the established color mapping relationship, the photographing device can automatically look up a table to determine the second color temperature corresponding to the first color temperature.
在一些实施例中,在确定第二白平衡增益后,还可以进一步基于第二图像的RGB值确定第三白平衡增益,然后可以结合第二白平衡增益和第三白平衡增益对第二摄像头采集的多帧第二图像进行白平衡校正后输出,得到多帧目标图像,使得第二摄像头输出的多帧目标图像的色彩由第二白平衡增益校正后的色彩向由第三白平衡增益校正后的色彩过渡。In some embodiments, after determining the second white balance gain, the third white balance gain can be further determined based on the RGB value of the second image, and then the second white balance gain and the third white balance gain can be combined to adjust the second camera The multi-frame second images collected are output after white balance correction to obtain multi-frame target images, so that the color of the multi-frame target images output by the second camera changes from the color corrected by the second white balance gain to the color corrected by the third white balance gain. After the color transition.
举个例子,为了避免摄像头切换前后输出的两帧图像的色彩存在太大偏差,存在色彩突变的现象,可以先让第二摄像头输出的第一帧图像和第一摄像头输出的图像色彩一致,比如,仅用第二白平衡增益对其进行校正,然后逐渐加入第三白平衡增益的影响(比如,两个白平衡增益可以按照一定比例混合,逐渐减小第二白平衡增益的比例,增大第三白平衡增益的比例,至仅用第三白平衡增益对第二图像进行校正),使得后续输出的图像逐渐由第一摄像头输出的图像的色彩渐渐向第二摄像头输出图像的色彩过渡,直至最后呈现的色彩为第二摄像头输出的图像的真实色彩,即仅通过第三白 平衡增益校正。如此,便可以避免第一摄像头需要一直工作,基于采集的第一图像确定第一白平衡增益,并发送给第二摄像头。For example, in order to avoid the color deviation of the two frames of images output before and after camera switching, and the phenomenon of color mutation, you can first make the first frame image output by the second camera consistent with the image output by the first camera, for example , only use the second white balance gain to correct it, and then gradually add the influence of the third white balance gain (for example, two white balance gains can be mixed according to a certain ratio, gradually reduce the ratio of the second white balance gain, increase The ratio of the third white balance gain, to only use the third white balance gain to correct the second image), so that the subsequent output image gradually transitions from the color of the image output by the first camera to the color transition of the image output by the second camera, Until the final presented color is the real color of the image output by the second camera, that is, it is only corrected by the third white balance gain. In this way, it is possible to avoid the need for the first camera to work all the time, and to determine the first white balance gain based on the collected first image and send it to the second camera.
在一些实施中,目标像素区域可以和第二图像中的参考像素区域具有相同的视场,其中,参考像素区域可以是第二图像的整个像素区域,也可以是第二图像中的部分像素区域。在基于对第一图像进行白平衡校正的白平衡增益对第二图像进行白平衡校正时,可以先基于第一图像确定第四白平衡增益,然后基于第二图像确定第五白平衡增益,根据利用第四白平衡增益进行白平衡校正后的目标像素区域与利用第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数,该偏移系数用于表征两个摄像头采集的图像中具有相同视场的图像区域各自进行白平衡校正后色彩存在的偏差,进而可以基于该偏移系数对第五白平衡增益进行调整,得到第六白平衡增益,然后利用第六白平衡增益对第二图像进行白平衡校正,得到目标图像并输出。In some implementations, the target pixel area may have the same field of view as the reference pixel area in the second image, where the reference pixel area may be the entire pixel area of the second image, or a partial pixel area in the second image . When performing white balance correction on the second image based on the white balance gain of the first image, the fourth white balance gain can be determined based on the first image, and then the fifth white balance gain can be determined based on the second image, according to The color deviation between the target pixel area after white balance correction using the fourth white balance gain and the reference pixel area after white balance correction using the fifth white balance gain determines the offset coefficient, which is used to characterize the acquisition of the two cameras In the image with the same field of view, there is color deviation after white balance correction, and then the fifth white balance gain can be adjusted based on the offset coefficient to obtain the sixth white balance gain, and then use the sixth white balance Gain performs white balance correction on the second image to obtain the target image and output it.
在一些实施例中,目标像素区域和参考像素区域可以根据第一摄像头和第二摄像头的相对位置关系预先标定得到,比如,在图像采集设备在生产组装时,可以利用棋盘格等图卡标定出两个摄像头采集的图像中完全对齐真实场景的区域,作为该目标像素区域和参考像素区域。In some embodiments, the target pixel area and the reference pixel area can be pre-calibrated according to the relative positional relationship between the first camera and the second camera. The regions in the images captured by the two cameras that are completely aligned with the real scene are used as the target pixel region and the reference pixel region.
在一些实施例中,在基于第一图像确定第四白平衡增益时,可以直接基于第一图像全图的RGB值确定第四白平衡增益。在一些实施例中,为了在确定第四白平衡增益时,可以消除视场差异的影响,第四白平衡增益可以仅根据目标像素区域的RGB值确定。In some embodiments, when determining the fourth white balance gain based on the first image, the fourth white balance gain may be determined directly based on the RGB values of the full image of the first image. In some embodiments, in order to eliminate the influence of field of view difference when determining the fourth white balance gain, the fourth white balance gain may be determined only according to the RGB values of the target pixel area.
同样的,对于第五白平衡增益,在一些实施例中,其可以根据第二图像全图的RGB值确定。在一些实施例中,也可以根据参考像素区域的RGB值确定,以消除视场差异的影响。Likewise, for the fifth white balance gain, in some embodiments, it may be determined according to RGB values of the full image of the second image. In some embodiments, it may also be determined according to the RGB values of the reference pixel area, so as to eliminate the influence of the difference in the field of view.
当然,由于摄像头采集的图像在进行白平衡校正后,通常还需进一步进行颜色校正,以消除白平衡校正对图像色彩带来的影响,比如,白平衡校正后图像的饱和度往往偏低。为了使得两个摄像头最终输出的图像中具 有相同视场的图像区域颜色尽可能接近,在确定偏移系数时,可以同时考虑颜色校正对图像色彩的影响。比如,在利用第四白平衡增益对目标像素区域进行白平衡校正后,可以进一步对白平衡校正后的目标像素区域进行颜色校正,在利用第五白平衡增益对参考像素区域进行白平衡校正后,可以进一步对白平衡校正后的参考像素区域进行颜色校正,然后根据颜色校正后的目标像素区域和颜色校正后的参考像素区域的色彩偏差确定偏移系数,通过这种方式确定偏移系数,可以更加真实反映第一摄像头最终输出的图像和第二摄像头最终输出的图像之间存在的偏差,从而利用该偏移系数调整后的白平衡增益对第二图像进行校正后,得到的目标图像与第一摄像头输出的图像中相同场景的色彩更加接近。Of course, after the white balance correction is performed on the image captured by the camera, further color correction is usually required to eliminate the influence of the white balance correction on the color of the image. For example, the saturation of the image after the white balance correction is often low. In order to make the color of the image area with the same field of view in the final output image of the two cameras as close as possible, when determining the offset coefficient, the influence of color correction on the image color can be considered at the same time. For example, after using the fourth white balance gain to perform white balance correction on the target pixel area, color correction may be further performed on the white balance corrected target pixel area, and after using the fifth white balance gain to perform white balance correction on the reference pixel area, The color correction can be further performed on the reference pixel area after white balance correction, and then the offset coefficient can be determined according to the color deviation between the target pixel area after color correction and the reference pixel area after color correction. By determining the offset coefficient in this way, it can be more It truly reflects the deviation between the final output image of the first camera and the final output image of the second camera, so that after correcting the second image with the white balance gain adjusted by the offset coefficient, the obtained target image is different from the first The color of the same scene in the image output by the camera is closer.
对图像进行颜色校正的校正矩阵和色温也是相互关联的,为了保证校正结果的准确性,不同色温下的校正矩阵往往也不同。所以,在一些实施例中,对目标像素区域进行颜色校正时,可以基于第四白平衡增益对应的第三色温确定校正矩阵,然后利用该校正矩阵对目标像素区域进行颜色校正。同样的,对参考像素区域进行颜色校正时,可以基于第五白平衡增益对应的第四色温确定校正矩阵,然后利用该校正矩阵对参考像素区域进行颜色校正。The correction matrix and color temperature for color correction of an image are also interrelated. In order to ensure the accuracy of the correction result, the correction matrix is often different under different color temperatures. Therefore, in some embodiments, when performing color correction on the target pixel area, a correction matrix may be determined based on the third color temperature corresponding to the fourth white balance gain, and then use the correction matrix to perform color correction on the target pixel area. Similarly, when performing color correction on the reference pixel area, a correction matrix may be determined based on the fourth color temperature corresponding to the fifth white balance gain, and then use the correction matrix to perform color correction on the reference pixel area.
在一些实施例中,还可以结合基于第五白平衡增益和第六白平衡增益对第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得第二摄像头输出的多帧目标图像的色彩由第六白平衡增益校正后的色彩向由第五白平衡增益校正后的色彩过渡。In some embodiments, it is also possible to perform white balance correction on multiple frames of second images collected by the second camera based on the fifth white balance gain and the sixth white balance gain to obtain multiple frames of target images; so that the multiple frames output by the second camera The color of the frame target image transitions from the color corrected by the sixth white balance gain to the color corrected by the fifth white balance gain.
比如,为了避免摄像头切换前后输出的两帧图像的色彩存在太大偏差,存在色彩突变的现象,可以先让第二摄像头输出的第一帧图像和第一摄像头输出的图像色彩一致,比如,仅用第六白平衡增益对其进行校正,然后逐渐加入第五白平衡增益的影响(比如,两个白平衡增益可以按照一定比例混合,逐渐减小第六白平衡增益的比例,增大第五白平衡增益的比例,至仅用第五白平衡增益对第二图像进行校正),使得后续输出的图像逐渐由第 一摄像头输出的图像的色彩渐渐向第二摄像头输出图像的色彩过渡,直至最后呈现的色彩为第二摄像头输出的图像的真实色彩,即仅通过第六白平衡增益校正。如此,便可以避免第一摄像头需要一直工作,基于采集的第一图像确定第四白平衡增益,并发送给第二摄像头。For example, in order to avoid the color deviation of the two frames of images output before and after camera switching, and the phenomenon of color mutation, you can first make the first frame image output by the second camera consistent with the image color output by the first camera, for example, only Use the sixth white balance gain to correct it, and then gradually add the influence of the fifth white balance gain (for example, two white balance gains can be mixed in a certain proportion, gradually reduce the proportion of the sixth white balance gain, increase the fifth white balance gain, until only the fifth white balance gain is used to correct the second image), so that the subsequent output image gradually transitions from the color of the image output by the first camera to the color of the output image of the second camera, until finally The presented color is the real color of the image output by the second camera, that is, only corrected by the sixth white balance gain. In this way, it can avoid that the first camera needs to work all the time, and the fourth white balance gain is determined based on the collected first image and sent to the second camera.
为了进一步解释本实施例的图像处理方法,以下结合几个具体的实施例加以解释。In order to further explain the image processing method of this embodiment, it will be explained in conjunction with several specific embodiments below.
假设图像采集设备包括短焦摄像头1和长焦摄像头2,在变焦过程中,当从摄像头1切换至摄像头2时(从摄像头2切换至摄像头1类似),由于摄像头1和摄像头2的视角和对光的响应特性存在差异,导致摄像头切换前后,输出的图像中具有相同视场的图像区域的色彩存在较大差异。为了解决上述问题,提供了以下几种图像处理方法,使得摄像头切换前后输出的图像色彩一致。Assuming that the image acquisition device includes a short-focus camera 1 and a telephoto camera 2, during the zooming process, when switching from camera 1 to camera 2 (similar to switching from camera 2 to camera 1), due to the angle of view and contrast of camera 1 and camera 2 There are differences in the response characteristics of light, resulting in a large difference in the color of the image area with the same field of view in the output image before and after the camera is switched. In order to solve the above problems, the following image processing methods are provided to make the output image color consistent before and after camera switching.
实施例一:Embodiment one:
可以基于变焦倍率从摄像头1采集的图像1中确定和图像2视场相同的图像区域,基于该图像区域确定白平衡增益,用于对图像2进行校正,从而可以消除因视场不同导致两个摄像头输出的图像存在差异。The image area with the same field of view as image 2 can be determined from image 1 collected by camera 1 based on the zoom ratio, and the white balance gain can be determined based on the image area to correct image 2, so that the two images caused by different fields of view can be eliminated. The image output by the camera is different.
如图4(a)所示,具体包括以下步骤:As shown in Figure 4(a), it specifically includes the following steps:
(1)摄像头1在采集到图像1后,可以基于当前的变焦倍率、两个摄像头之间的位置关系在图像1中确定ROI区域,其中ROI区域和摄像头2采集的图像2的具有相同的视场。(1) After the camera 1 captures the image 1, it can determine the ROI area in the image 1 based on the current zoom ratio and the positional relationship between the two cameras, wherein the ROI area and the image 2 captured by the camera 2 have the same viewing angle. field.
(2)按照预设的比例(比如5%)在图像1中对ROI区域进行扩展,得到扩展后的ROI区域,扩展后的ROI区域和图像2的视场相比稍微增大,但整体较为接近。(2) Expand the ROI area in image 1 according to a preset ratio (such as 5%) to obtain the expanded ROI area. The expanded ROI area is slightly larger than the field of view of image 2, but the overall near.
(3)基于扩展后的ROI区域的RGB值确定白平衡增益1和色温1。相比于直接利用ROI区域确定白平衡增益,将ROI区域扩展后再用于确定白平衡增益,得到的结果会更加准确。(3) Determine white balance gain 1 and color temperature 1 based on the RGB values of the expanded ROI area. Compared with directly using the ROI area to determine the white balance gain, the result obtained by expanding the ROI area and then using it to determine the white balance gain will be more accurate.
(4)在确定白平衡增益1后,可以利用白平衡增益1对图像1进行白 平衡校正,然后基于变焦倍率从白平衡校正后的图像1的中心区域上采样后,得到数码变焦图像并输出。(4) After the white balance gain 1 is determined, the white balance correction of image 1 can be performed by using the white balance gain 1, and then based on the zoom ratio, after sampling from the central area of the white balance corrected image 1, a digital zoom image is obtained and output .
(5)将白平衡增益1和色温1发送给摄像头2,摄像头2可以基于摄像头1和摄像头2之间的色彩映射关系将色温1映射到摄像头2的色彩空间中,得到色温2,并确定色温2下的白平衡增益2。(5) Send white balance gain 1 and color temperature 1 to camera 2, and camera 2 can map color temperature 1 to the color space of camera 2 based on the color mapping relationship between camera 1 and camera 2, obtain color temperature 2, and determine the color temperature White balance gain of 2 under 2.
(6)摄像头2还可以基于图像2的RGB值确定白平衡增益3和色温3。(6) The camera 2 can also determine the white balance gain 3 and the color temperature 3 based on the RGB values of the image 2 .
(7)可以结合白平衡增益2和白平衡增益3对摄像头输出的多帧图像2进行白平衡校正,使得输出的光学变焦图像的色彩由白平衡增益2校正后的色彩向白平衡增益3校正后的色彩过渡,达到摄像头刚开始切换时,和摄像头1采集的图像1的色彩保持一致,然后逐渐过渡到摄像头2采集的图像2的真实色彩,从而不会出现颜色跳变,而是缓慢过渡。(7) White balance correction can be performed on the multi-frame image 2 output by the camera in combination with white balance gain 2 and white balance gain 3, so that the color of the output optical zoom image is corrected from the color corrected by white balance gain 2 to white balance gain 3 The final color transition is consistent with the color of image 1 captured by camera 1 when the camera first switches, and then gradually transitions to the real color of image 2 captured by camera 2, so that there will be no color jump, but a slow transition .
实施例二:Embodiment two:
可以从两个摄像头采集的图像中选取视场完全对齐的ROI区域,基于该摄像头对该ROI区域各自进行平衡校正后该ROI区域的色彩偏差确定偏移系数,利用该偏移系数对图像色彩进行调整,使得两个摄像头针对相同场景输出的图像色彩一致。如图4(b)所示,具体包括以下步骤:The ROI area whose field of view is completely aligned can be selected from the images collected by the two cameras, and the offset coefficient is determined based on the color deviation of the ROI area after the camera performs balance correction on the ROI area, and the image color is adjusted using the offset coefficient. Adjust to make the color of the images output by the two cameras consistent for the same scene. As shown in Figure 4(b), it specifically includes the following steps:
(1)当基于变焦倍率将摄像头1切换至摄像头2时,可以从摄像头1采集的图像1中确定ROI区域1,从摄像头2采集的图像2中确定ROI区域2,其中,ROI区域1和ROI区域2具有相同视场,为两个摄像头中完全对齐的区域,ROI区域1和ROI区域可以基于两个摄像头的位置关系预先标定得到。(1) When camera 1 is switched to camera 2 based on the zoom ratio, ROI area 1 can be determined from image 1 collected by camera 1, and ROI area 2 can be determined from image 2 collected by camera 2, wherein ROI area 1 and ROI Region 2 has the same field of view and is a completely aligned region of the two cameras. ROI region 1 and ROI region can be pre-calibrated based on the positional relationship of the two cameras.
(2)可以基于ROI区域1的RGB值确定白平衡增益1和色温1,利用白平衡增益1对ROI区域1进行白平衡校正,然后确定色温1对应的颜色校正矩阵CCM1,利用CCM1对白平衡校正ROI区域1进行进一步的颜色校正。(2) White balance gain 1 and color temperature 1 can be determined based on the RGB value of ROI area 1, and the white balance correction of ROI area 1 can be performed using white balance gain 1, and then the color correction matrix CCM1 corresponding to color temperature 1 can be determined, and white balance correction can be performed using CCM1 ROI area 1 is further color corrected.
(3)可以基于ROI区域2的RGB值确定白平衡增益2和色温2,利 用白平衡增益2对ROI区域2进行白平衡校正,然后确定色温2对应的颜色校正矩阵CCM2,利用CCM2对白平衡校正ROI区域2进行进一步的颜色校正。(3) White balance gain 2 and color temperature 2 can be determined based on the RGB value of ROI area 2, and the white balance correction of ROI area 2 can be performed using white balance gain 2, and then the color correction matrix CCM2 corresponding to color temperature 2 can be determined, and white balance correction can be performed using CCM2 ROI area 2 for further color correction.
(4)根据白平衡校正+颜色校正后的ROI区域1,以及白平衡校正+颜色校正后的ROI区域2的色彩差异确定偏移系数。(4) Determine the offset coefficient according to the color difference between ROI region 1 after white balance correction+color correction and ROI region 2 after white balance correction+color correction.
(5)利用该偏移系数对白平衡增益2进行校正,得到白平衡增益3,利用白平衡增益3对摄像头2采集的图像2进行白平衡校正后输出,使得图像2与图像1中具有相同视场的图像区域色彩一致。(5) Use the offset coefficient to correct the white balance gain 2 to obtain the white balance gain 3, and use the white balance gain 3 to correct the white balance of the image 2 collected by the camera 2 and output it, so that the image 2 and the image 1 have the same visual The image area of the field is uniform in color.
(6)此外,对于摄像头2后续输出的多帧图像,也可以结合白平衡增益2和白平衡增益3对其进行校正,使得摄像头2输出的图像逐渐由白平衡增益3校正后的颜色(即第一摄像头输出的图像的颜色)逐渐向由白平衡增益2校正后的颜色过渡,直至最后完全呈现摄像头2采集的图像的真实颜色。如此,便可以避免摄像头1需要一直工作,将基于图像1确定的白平衡增益1发送给摄像头2.(6) In addition, for the subsequent multi-frame images output by camera 2, it can also be corrected in combination with white balance gain 2 and white balance gain 3, so that the image output by camera 2 gradually changes from the corrected color of white balance gain 3 (that is, The color of the image output by the first camera gradually transitions to the color corrected by the white balance gain 2, until finally the real color of the image captured by the camera 2 is completely presented. In this way, camera 1 can be prevented from working all the time, and the white balance gain 1 determined based on image 1 can be sent to camera 2.
与上述方法相对应,本申请实施例还提供了一种图像处理装置,如图5所示,所述装置包括处理器51、存储器52、存储于所述存储器52可供所述处理器51执行的计算机程序,所述处理器51执行所述计算机程序时可实现以下步骤:Corresponding to the above method, the embodiment of the present application also provides an image processing device. As shown in FIG. computer program, the processor 51 can implement the following steps when executing the computer program:
对同一目标拍摄场景,将图像采集设备的第一摄像头切换至第二摄像头以实现光学变焦;For the same target shooting scene, switch the first camera of the image acquisition device to the second camera to achieve optical zoom;
利用所述第一摄像头采集的第一图像的色彩信息对所述第二摄像头采集的第二图像进行色彩处理,得到目标图像,其中,所述色彩信息基于所述第一图像中的目标像素区域获取,所述目标像素区域与所述第二图像的全部或部分像素区域具有相同的视场;Using the color information of the first image captured by the first camera to perform color processing on the second image captured by the second camera to obtain a target image, wherein the color information is based on the target pixel area in the first image Acquiring that the target pixel area has the same field of view as all or part of the pixel area of the second image;
输出所述目标图像,其中,光学变焦前所述第一摄像头输出的图像和所述目标图像中具有相同视场的图像区域色彩一致。Outputting the target image, wherein the image output by the first camera before the optical zoom is in the same color as the image area in the target image having the same field of view.
在一些实施例中,所述处理器用于利用所述第一摄像头采集的第一图 像的色彩信息对所述第二摄像头采集的第二图像进行色彩处理,具体用于:In some embodiments, the processor is configured to use the color information of the first image captured by the first camera to perform color processing on the second image captured by the second camera, specifically for:
基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正。Performing white balance correction on the second image based on the white balance gain for performing white balance correction on the first image.
在一些实施例中,所述处理器用于基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正时,具体用于:In some embodiments, when the processor is configured to perform white balance correction on the second image based on the white balance gain for performing white balance correction on the first image, it is specifically used to:
基于所述目标像素区域确定第一白平衡增益;determining a first white balance gain based on the target pixel area;
基于所述第一摄像头和所述第二摄像头的色彩映射关系以及所述第一白平衡增益得到第二白平衡增益,其中,所述色彩映射关系基于所述第一摄像头的光谱响应特性与所述第二摄像头的光谱响应特性确定;The second white balance gain is obtained based on the color mapping relationship between the first camera and the second camera and the first white balance gain, wherein the color mapping relationship is based on the spectral response characteristic of the first camera and the first white balance gain. The spectral response characteristics of the second camera are determined;
利用所述第二白平衡增益对所述第二图像进行白平衡校正。Perform white balance correction on the second image by using the second white balance gain.
在一些实施例中,所述处理器用于利用所述目标像素区域确定所述第一白平衡增益,具体用于:In some embodiments, the processor is configured to use the target pixel area to determine the first white balance gain, specifically for:
基于预设的扩展比例和所述目标像素区域得到扩展像素区域,所述扩展像素区域包括所述目标像素区域以及所述目标像素区域周围的像素区域;obtaining an extended pixel area based on a preset expansion ratio and the target pixel area, where the extended pixel area includes the target pixel area and pixel areas around the target pixel area;
利用所述扩展像素区域的RGB值确定所述第一白平衡增益。The first white balance gain is determined by using RGB values of the extended pixel area.
在一些实施例中,所述处理器用于基于所述第一摄像头和所述第二摄像头的色彩映射关系以及所述第一白平衡增益得到所述第二白平衡增益时,具体用于:In some embodiments, when the processor is configured to obtain the second white balance gain based on the color mapping relationship between the first camera and the second camera and the first white balance gain, it is specifically configured to:
确定所述第一白平衡增益对应的第一色温;determining a first color temperature corresponding to the first white balance gain;
基于所述色彩映射关系和所述第一色温确定第二色温;determining a second color temperature based on the color mapping relationship and the first color temperature;
将所述第二色温对应的白平衡增益确定为所述第二白平衡增益。A white balance gain corresponding to the second color temperature is determined as the second white balance gain.
在一些实施例中,所述处理器还用于:In some embodiments, the processor is further configured to:
基于所述第二图像的RGB值确定第三白平衡增益;determining a third white balance gain based on the RGB values of the second image;
基于所述第二白平衡增益和所述第三白平衡增益对所述第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得所述第二摄像头输出的所述多帧目标图像的色彩由所述第二白平衡增益校正后的色彩向由所述第三白平衡增益校正后的色彩过渡。Based on the second white balance gain and the third white balance gain, white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the second white balance gain to the color corrected by the third white balance gain.
在一些实施例中,所述第一摄像头的视角覆盖所述第二摄像头的视角,所述目标像素区域与所述第二图像的全部像素区域具有相同的视场;或In some embodiments, the viewing angle of the first camera covers the viewing angle of the second camera, and the target pixel area has the same field of view as all pixel areas of the second image; or
所述第二摄像头的视角覆盖所述第一摄像头的视角,所述目标像素区域与所述第二图像的部分像素区域具有相同的视场。The viewing angle of the second camera covers the viewing angle of the first camera, and the target pixel area has the same field of view as a partial pixel area of the second image.
在一些实施例中,所述目标像素区域基于变焦倍率,以及所述第一摄像头和所述第二摄像头的相对位置关系确定。In some embodiments, the target pixel area is determined based on a zoom factor and a relative positional relationship between the first camera and the second camera.
在一些实施例中,所述目标像素区域与所述第二图像中的参考像素区域具有相同的视场;In some embodiments, the target pixel area has the same field of view as the reference pixel area in the second image;
所述处理器用于基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正时,具体用于:When the processor is used to perform white balance correction on the second image based on the white balance gain for performing white balance correction on the first image, it is specifically used to:
基于所述第一图像确定第四白平衡增益;determining a fourth white balance gain based on the first image;
基于所述第二图像确定第五白平衡增益;determining a fifth white balance gain based on the second image;
基于利用所述第四白平衡增益进行白平衡校正后的目标像素区域与利用所述第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数;determining an offset coefficient based on a color deviation between a target pixel area after white balance correction by using the fourth white balance gain and a reference pixel area after white balance correction by using the fifth white balance gain;
基于所述第五白平衡增益和所述偏移系数确定所述第六白平衡增益;determining the sixth white balance gain based on the fifth white balance gain and the offset coefficient;
利用所述第六白平衡增益对所述第二图像进行白平衡校正。Perform white balance correction on the second image by using the sixth white balance gain.
在一些实施例中,所述处理器用于基于所述第一图像确定第四白平衡增益时,具体用于:In some embodiments, when the processor is configured to determine the fourth white balance gain based on the first image, it is specifically configured to:
基于所述第一图像中的所述目标像素区域的RGB值确定所述第四白平衡增益;和/或determining the fourth white balance gain based on RGB values of the target pixel region in the first image; and/or
基于所述第二图像确定第五白平衡增益,包括:determining a fifth white balance gain based on the second image, comprising:
基于所述第二图像中的所述参考像素区域的RGB值确定所述第五白平衡增益。The fifth white balance gain is determined based on RGB values of the reference pixel region in the second image.
在一些实施例中,所述处理器用于基于利用所述第四白平衡增益进行白平衡校正后的目标像素区域与利用所述第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数时,具体用于:In some embodiments, the processor is configured to use the fourth white balance gain to perform white balance correction based on the color deviation between the target pixel area after white balance correction and the fifth white balance gain. When determining the offset coefficient, it is specifically used for:
分别对所述白平衡校正后的目标像素区域和所述白平衡校正后的参考像素区域进行颜色校正;performing color correction on the target pixel area after white balance correction and the reference pixel area after white balance correction;
基于颜色校正后的目标像素区域和颜色校正后的参考像素区域的色彩偏差确定所述偏移系数。The offset coefficient is determined based on a color deviation between the color-corrected target pixel area and the color-corrected reference pixel area.
在一些实施例中,对所述目标像素区域进行颜色校正的校正矩阵基于第三色温确定,所述第三色温基于所述第四白平衡增益确定;In some embodiments, the correction matrix for performing color correction on the target pixel area is determined based on a third color temperature, and the third color temperature is determined based on the fourth white balance gain;
对所述白平衡校正后的参考像素区域进行颜色校正的校正矩阵基于第四色温确定,所述第四色温基于第五白平衡增益确定。A correction matrix for performing color correction on the white balance corrected reference pixel area is determined based on a fourth color temperature, and the fourth color temperature is determined based on a fifth white balance gain.
在一些实施例中,所述目标像素区域和所述参考像素区域基于所述第一摄像头和所述第二摄像头的相对位置关系预先标定得到。In some embodiments, the target pixel area and the reference pixel area are pre-calibrated and obtained based on the relative positional relationship between the first camera and the second camera.
在一些实施例中,所述处理器还用于:In some embodiments, the processor is further configured to:
基于所述第五白平衡增益和所述第六白平衡增益对所述第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得所述第二摄像头输出的所述多帧目标图像的色彩由所述第六白平衡增益校正后的色彩向由所述第五白平衡增益校正后的色彩过渡。Based on the fifth white balance gain and the sixth white balance gain, white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the sixth white balance gain to the color corrected by the fifth white balance gain.
进一步地,本申请实施例中还提供了一种图像采集设备,该图像采集设备包括第一摄像头、第二摄像头以及如上述实施例中任一项所述的图像处理装置。该图像采集设备可以手持云台相机、手机、无人机等各种搭载了至少两个摄像头的设备。Further, an image acquisition device is provided in an embodiment of the present application, and the image acquisition device includes a first camera, a second camera, and the image processing apparatus according to any one of the above embodiments. The image acquisition device can hold various devices equipped with at least two cameras, such as a pan-tilt camera, a mobile phone, and a drone.
相应地,本说明书实施例还提供一种计算机存储介质,所述存储介质中存储有程序,所述程序被处理器执行时实现上述任一实施例中的方法。Correspondingly, the embodiments of this specification further provide a computer storage medium, where a program is stored in the storage medium, and when the program is executed by a processor, the method in any of the foregoing embodiments is implemented.
本说明书实施例可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可用存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存 储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。Embodiments of the present description may take the form of a computer program product embodied on one or more storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) having program code embodied therein. Computer usable storage media includes both volatile and non-permanent, removable and non-removable media, and may be implemented by any method or technology for information storage. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for computers include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment. The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. The term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements but also other elements not expressly listed elements, or also elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
以上对本发明实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The methods and devices provided by the embodiments of the present invention have been described in detail above. The principles and implementation methods of the present invention have been explained by using specific examples in this paper. The descriptions of the above embodiments are only used to help understand the methods and methods of the present invention. core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be construed as limiting the present invention .

Claims (30)

  1. 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:
    对同一目标拍摄场景,将图像采集设备的第一摄像头切换至第二摄像头以实现光学变焦;For the same target shooting scene, switch the first camera of the image acquisition device to the second camera to achieve optical zoom;
    利用光学变焦前所述第一摄像头采集的第一图像的色彩信息对光学变焦后所述第二摄像头采集的第二图像进行色彩处理,得到目标图像,其中,所述色彩信息基于所述第一图像中的目标像素区域获取,所述目标像素区域与所述第二图像的全部或部分像素区域具有相同的视场;Using the color information of the first image captured by the first camera before the optical zoom to perform color processing on the second image captured by the second camera after the optical zoom to obtain a target image, wherein the color information is based on the first Acquiring a target pixel area in the image, where the target pixel area has the same field of view as all or part of the pixel area of the second image;
    输出所述目标图像,其中,光学变焦前所述第一摄像头输出的图像和所述目标图像中具有相同视场的图像区域色彩一致。Outputting the target image, wherein the image output by the first camera before the optical zoom is in the same color as the image area in the target image having the same field of view.
  2. 根据权利要求1所述的方法,其特征在于,利用所述第一摄像头采集的第一图像的色彩信息对所述第二摄像头采集的第二图像进行色彩处理包括:The method according to claim 1, wherein the color processing of the second image captured by the second camera using the color information of the first image captured by the first camera comprises:
    基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正。Performing white balance correction on the second image based on the white balance gain for performing white balance correction on the first image.
  3. 根据权利要求2所述的方法,其特征在于,基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正,包括:The method according to claim 2, wherein performing white balance correction on the second image based on a white balance gain for performing white balance correction on the first image comprises:
    基于所述目标像素区域确定第一白平衡增益;determining a first white balance gain based on the target pixel area;
    基于所述第一摄像头和所述第二摄像头的色彩映射关系以及所述第一白平衡增益得到第二白平衡增益,其中,所述色彩映射关系基于所述第一摄像头的光谱响应特性与所述第二摄像头的光谱响应特性确定;The second white balance gain is obtained based on the color mapping relationship between the first camera and the second camera and the first white balance gain, wherein the color mapping relationship is based on the spectral response characteristic of the first camera and the first white balance gain. The spectral response characteristics of the second camera are determined;
    利用所述第二白平衡增益对所述第二图像进行白平衡校正。Perform white balance correction on the second image by using the second white balance gain.
  4. 根据权利要求3所述的方法,其特征在于,基于所述目标像素区域确定所述第一白平衡增益,包括:The method according to claim 3, wherein determining the first white balance gain based on the target pixel area comprises:
    基于预设的扩展比例和所述目标像素区域得到扩展像素区域,所述扩展像素区域包括所述目标像素区域以及所述目标像素区域周围的像素区域;obtaining an extended pixel area based on a preset expansion ratio and the target pixel area, where the extended pixel area includes the target pixel area and pixel areas around the target pixel area;
    利用所述扩展像素区域的RGB值确定所述第一白平衡增益。The first white balance gain is determined by using RGB values of the extended pixel area.
  5. 根据权利要求3所述的方法,其特征在于,基于所述第一摄像头和所述第二摄像头的色彩映射关系以及所述第一白平衡增益得到所述第二白平衡增益,包括:The method according to claim 3, wherein obtaining the second white balance gain based on the color mapping relationship between the first camera and the second camera and the first white balance gain comprises:
    确定所述第一白平衡增益对应的第一色温;determining a first color temperature corresponding to the first white balance gain;
    基于所述色彩映射关系和所述第一色温确定第二色温;determining a second color temperature based on the color mapping relationship and the first color temperature;
    将所述第二色温对应的白平衡增益确定为所述第二白平衡增益。A white balance gain corresponding to the second color temperature is determined as the second white balance gain.
  6. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, further comprising:
    基于所述第二图像的RGB值确定第三白平衡增益;determining a third white balance gain based on the RGB values of the second image;
    基于所述第二白平衡增益和所述第三白平衡增益对所述第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得所述第二摄像头输出的所述多帧目标图像的色彩由所述第二白平衡增益校正后的色彩向由所述第三白平衡增益校正后的色彩过渡。Based on the second white balance gain and the third white balance gain, white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the second white balance gain to the color corrected by the third white balance gain.
  7. 根据权利要求3所述的方法,其特征在于,所述第一摄像头的视角覆盖所述第二摄像头的视角,所述目标像素区域与所述第二图像的全部像素区域具有相同的视场;或The method according to claim 3, wherein the viewing angle of the first camera covers the viewing angle of the second camera, and the target pixel area has the same field of view as all pixel areas of the second image; or
    所述第二摄像头的视角覆盖所述第一摄像头的视角,所述目标像素区域与所述第二图像的部分像素区域具有相同的视场。The viewing angle of the second camera covers the viewing angle of the first camera, and the target pixel area has the same field of view as a partial pixel area of the second image.
  8. 根据权利要求3-7任一项所述的方法,其特征在于,所述目标像素区域基于变焦倍率,以及所述第一摄像头和所述第二摄像头的相对位置关系确定。The method according to any one of claims 3-7, wherein the target pixel area is determined based on a zoom magnification and a relative positional relationship between the first camera and the second camera.
  9. 根据权利要求2所述的方法,其特征在于,所述目标像素区域与所述第二图像中的参考像素区域具有相同的视场;The method according to claim 2, wherein the target pixel area has the same field of view as the reference pixel area in the second image;
    基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正,包括:Performing white balance correction on the second image based on a white balance gain for performing white balance correction on the first image, including:
    基于所述第一图像确定第四白平衡增益;determining a fourth white balance gain based on the first image;
    基于所述第二图像确定第五白平衡增益;determining a fifth white balance gain based on the second image;
    基于利用所述第四白平衡增益进行白平衡校正后的目标像素区域与利 用所述第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数;determining an offset coefficient based on the color deviation between the target pixel area after white balance correction by using the fourth white balance gain and the reference pixel area after white balance correction by using the fifth white balance gain;
    基于所述第五白平衡增益和所述偏移系数确定第六白平衡增益;determining a sixth white balance gain based on the fifth white balance gain and the offset coefficient;
    利用所述第六白平衡增益对所述第二图像进行白平衡校正。Perform white balance correction on the second image by using the sixth white balance gain.
  10. 根据权利要求9所述的方法,其特征在于,基于所述第一图像确定第四白平衡增益,包括:The method according to claim 9, wherein determining a fourth white balance gain based on the first image comprises:
    基于所述第一图像中的所述目标像素区域的RGB值确定所述第四白平衡增益;和/或determining the fourth white balance gain based on RGB values of the target pixel region in the first image; and/or
    基于所述第二图像确定第五白平衡增益,包括:determining a fifth white balance gain based on the second image, comprising:
    基于所述第二图像中的所述参考像素区域的RGB值确定所述第五白平衡增益。The fifth white balance gain is determined based on RGB values of the reference pixel region in the second image.
  11. 根据权利要求9所述的方法,其特征在于,基于利用所述第四白平衡增益进行白平衡校正后的目标像素区域与利用所述第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数,包括:The method according to claim 9, characterized in that based on the difference between the target pixel area after white balance correction using the fourth white balance gain and the reference pixel area after white balance correction using the fifth white balance gain Color Bias determines offset factors, including:
    分别对所述白平衡校正后的目标像素区域和所述白平衡校正后的参考像素区域进行颜色校正;performing color correction on the target pixel area after white balance correction and the reference pixel area after white balance correction;
    基于颜色校正后的目标像素区域和颜色校正后的参考像素区域的色彩偏差确定所述偏移系数。The offset coefficient is determined based on a color deviation between the color-corrected target pixel area and the color-corrected reference pixel area.
  12. 根据权利要求11所述的方法,其特征在于,对所述目标像素区域进行颜色校正的校正矩阵基于第三色温确定,所述第三色温基于所述第四白平衡增益确定;The method according to claim 11, wherein the correction matrix for performing color correction on the target pixel area is determined based on a third color temperature, and the third color temperature is determined based on the fourth white balance gain;
    对所述白平衡校正后的参考像素区域进行颜色校正的校正矩阵基于第四色温确定,所述第四色温基于第五白平衡增益确定。A correction matrix for performing color correction on the white balance corrected reference pixel area is determined based on a fourth color temperature, and the fourth color temperature is determined based on a fifth white balance gain.
  13. 根据权利要求9所述的方法,其特征在于,所述目标像素区域和所述参考像素区域基于所述第一摄像头和所述第二摄像头的相对位置关系预先标定得到。The method according to claim 9, wherein the target pixel area and the reference pixel area are pre-calibrated and obtained based on the relative positional relationship between the first camera and the second camera.
  14. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, characterized in that the method further comprises:
    基于所述第五白平衡增益和所述第六白平衡增益对所述第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得所述第二摄像头输出的所述多帧目标图像的色彩由所述第六白平衡增益校正后的色彩向由所述第五白平衡增益校正后的色彩过渡。Based on the fifth white balance gain and the sixth white balance gain, white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the sixth white balance gain to the color corrected by the fifth white balance gain.
  15. 一种图像处理装置,其特征在于,所述装置包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时可实现以下步骤:An image processing device, characterized in that the device includes a processor, a memory, and a computer program stored in the memory for execution by the processor, and the processor can implement the following steps when executing the computer program:
    对同一目标拍摄场景,将图像采集设备的第一摄像头切换至第二摄像头以实现光学变焦;For the same target shooting scene, switch the first camera of the image acquisition device to the second camera to achieve optical zoom;
    利用光学变焦前所述第一摄像头采集的第一图像的色彩信息对光学变焦后所述第二摄像头采集的第二图像进行色彩处理,得到目标图像,其中,所述色彩信息基于所述第一图像中的目标像素区域获取,所述目标像素区域与所述第二图像的全部或部分像素区域具有相同的视场;Using the color information of the first image captured by the first camera before the optical zoom to perform color processing on the second image captured by the second camera after the optical zoom to obtain a target image, wherein the color information is based on the first Acquiring a target pixel area in the image, where the target pixel area has the same field of view as all or part of the pixel area of the second image;
    输出所述目标图像,其中,光学变焦前所述第一摄像头输出的图像和所述目标图像中具有相同视场的图像区域色彩一致。Outputting the target image, wherein the image output by the first camera before the optical zoom is in the same color as the image area in the target image having the same field of view.
  16. 根据权利要求15所述的装置,其特征在于,所述处理器用于利用所述第一摄像头采集的第一图像的色彩信息对所述第二摄像头采集的第二图像进行色彩处理,具体用于:The device according to claim 15, wherein the processor is configured to use the color information of the first image captured by the first camera to perform color processing on the second image captured by the second camera, specifically for :
    基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正。Performing white balance correction on the second image based on the white balance gain for performing white balance correction on the first image.
  17. 根据权利要求16所述的装置,其特征在于,所述处理器用于基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正时,具体用于:The device according to claim 16, wherein, when the processor is configured to perform white balance correction on the second image based on the white balance gain for performing white balance correction on the first image, it is specifically used to:
    基于所述目标像素区域确定第一白平衡增益;determining a first white balance gain based on the target pixel area;
    基于所述第一摄像头和所述第二摄像头的色彩映射关系以及所述第一白平衡增益得到第二白平衡增益,其中,所述色彩映射关系基于所述第一摄像头的光谱响应特性与所述第二摄像头的光谱响应特性确定;The second white balance gain is obtained based on the color mapping relationship between the first camera and the second camera and the first white balance gain, wherein the color mapping relationship is based on the spectral response characteristic of the first camera and the first white balance gain. The spectral response characteristics of the second camera are determined;
    利用所述第二白平衡增益对所述第二图像进行白平衡校正。Perform white balance correction on the second image by using the second white balance gain.
  18. 根据权利要求17所述的装置,其特征在于,所述处理器用于基于所述目标像素区域确定所述第一白平衡增益,具体用于:The device according to claim 17, wherein the processor is configured to determine the first white balance gain based on the target pixel area, specifically for:
    基于预设的扩展比例和所述目标像素区域得到扩展像素区域,所述扩展像素区域包括所述目标像素区域以及所述目标像素区域周围的像素区域;obtaining an extended pixel area based on a preset expansion ratio and the target pixel area, where the extended pixel area includes the target pixel area and pixel areas around the target pixel area;
    利用所述扩展像素区域的RGB值确定所述第一白平衡增益。The first white balance gain is determined by using RGB values of the extended pixel area.
  19. 根据权利要求17所述的装置,其特征在于,所述处理器用于基于所述第一摄像头和所述第二摄像头的色彩映射关系以及所述第一白平衡增益得到所述第二白平衡增益时,具体用于:The device according to claim 17, wherein the processor is configured to obtain the second white balance gain based on the color mapping relationship between the first camera and the second camera and the first white balance gain , specifically for:
    确定所述第一白平衡增益对应的第一色温;determining a first color temperature corresponding to the first white balance gain;
    基于所述色彩映射关系和所述第一色温确定第二色温;determining a second color temperature based on the color mapping relationship and the first color temperature;
    将所述第二色温对应的白平衡增益确定为所述第二白平衡增益。A white balance gain corresponding to the second color temperature is determined as the second white balance gain.
  20. 根据权利要求17所述的装置,其特征在于,所述处理器还用于:The device according to claim 17, wherein the processor is further configured to:
    基于所述第二图像的RGB值确定第三白平衡增益;determining a third white balance gain based on the RGB values of the second image;
    基于所述第二白平衡增益和所述第三白平衡增益对所述第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得所述第二摄像头输出的所述多帧目标图像的色彩由所述第二白平衡增益校正后的色彩向由所述第三白平衡增益校正后的色彩过渡。Based on the second white balance gain and the third white balance gain, white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the second white balance gain to the color corrected by the third white balance gain.
  21. 根据权利要求17所述的装置,其特征在于,所述第一摄像头的视角覆盖所述第二摄像头的视角,所述目标像素区域与所述第二图像的全部像素区域具有相同的视场;或The device according to claim 17, wherein the viewing angle of the first camera covers the viewing angle of the second camera, and the target pixel area has the same field of view as all pixel areas of the second image; or
    所述第二摄像头的视角覆盖所述第一摄像头的视角,所述目标像素区域与所述第二图像的部分像素区域具有相同的视场。The viewing angle of the second camera covers the viewing angle of the first camera, and the target pixel area has the same field of view as a partial pixel area of the second image.
  22. 根据权利要求17-21任一项所述的装置,其特征在于,所述目标像素区域基于变焦倍率,以及所述第一摄像头和所述第二摄像头的相对位置关系确定。The device according to any one of claims 17-21, wherein the target pixel area is determined based on a zoom magnification and a relative positional relationship between the first camera and the second camera.
  23. 根据权利要求16所述的装置,其特征在于,所述目标像素区域与 所述第二图像中的参考像素区域具有相同的视场;The device according to claim 16, wherein the target pixel area has the same field of view as the reference pixel area in the second image;
    所述处理器用于基于对所述第一图像进行白平衡校正的白平衡增益对所述第二图像进行白平衡校正时,具体用于:When the processor is used to perform white balance correction on the second image based on the white balance gain for performing white balance correction on the first image, it is specifically used to:
    基于所述第一图像确定第四白平衡增益;determining a fourth white balance gain based on the first image;
    基于所述第二图像确定第五白平衡增益;determining a fifth white balance gain based on the second image;
    基于利用所述第四白平衡增益进行白平衡校正后的目标像素区域与利用所述第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数;determining an offset coefficient based on a color deviation between a target pixel area after white balance correction by using the fourth white balance gain and a reference pixel area after white balance correction by using the fifth white balance gain;
    基于所述第五白平衡增益和所述偏移系数确定第六白平衡增益;determining a sixth white balance gain based on the fifth white balance gain and the offset coefficient;
    利用所述第六白平衡增益对所述第二图像进行白平衡校正。Perform white balance correction on the second image by using the sixth white balance gain.
  24. 根据权利要求23所述的装置,其特征在于,所述处理器用于基于所述第一图像确定第四白平衡增益时,具体用于:The device according to claim 23, wherein when the processor is configured to determine the fourth white balance gain based on the first image, it is specifically configured to:
    基于所述第一图像中的所述目标像素区域的RGB值确定所述第四白平衡增益;和/或determining the fourth white balance gain based on RGB values of the target pixel region in the first image; and/or
    基于所述第二图像确定第五白平衡增益,包括:determining a fifth white balance gain based on the second image, comprising:
    基于所述第二图像中的所述参考像素区域的RGB值确定所述第五白平衡增益。The fifth white balance gain is determined based on RGB values of the reference pixel region in the second image.
  25. 根据权利要求23所述的装置,其特征在于,所述处理器用于基于利用所述第四白平衡增益进行白平衡校正后的目标像素区域与利用所述第五白平衡增益进行白平衡校正后的参考像素区域的色彩偏差确定偏移系数时,具体用于:The device according to claim 23, wherein the processor is configured to perform white balance correction based on the target pixel area using the fourth white balance gain and the white balance correction using the fifth white balance gain When determining the offset coefficient, the color deviation of the reference pixel area is specifically used for:
    分别对所述白平衡校正后的目标像素区域和所述白平衡校正后的参考像素区域进行颜色校正;performing color correction on the target pixel area after white balance correction and the reference pixel area after white balance correction;
    基于颜色校正后的目标像素区域和颜色校正后的参考像素区域的色彩偏差确定所述偏移系数。The offset coefficient is determined based on a color deviation between the color-corrected target pixel area and the color-corrected reference pixel area.
  26. 根据权利要求25所述的装置,其特征在于,对所述目标像素区域进行颜色校正的校正矩阵基于第三色温确定,所述第三色温基于所述第四 白平衡增益确定;The device according to claim 25, wherein the correction matrix for performing color correction on the target pixel area is determined based on a third color temperature, and the third color temperature is determined based on the fourth white balance gain;
    对所述白平衡校正后的参考像素区域进行颜色校正的校正矩阵基于第四色温确定,所述第四色温基于第五白平衡增益确定。A correction matrix for performing color correction on the white balance corrected reference pixel area is determined based on a fourth color temperature, and the fourth color temperature is determined based on a fifth white balance gain.
  27. 根据权利要求23所述的装置,其特征在于,所述目标像素区域和所述参考像素区域基于所述第一摄像头和所述第二摄像头的相对位置关系预先标定得到。The device according to claim 23, wherein the target pixel area and the reference pixel area are pre-calibrated and obtained based on the relative positional relationship between the first camera and the second camera.
  28. 根据权利要求23所述的装置,其特征在于,所述处理器还用于:The device according to claim 23, wherein the processor is further configured to:
    基于所述第五白平衡增益和所述第六白平衡增益对所述第二摄像头采集的多帧第二图像进行白平衡校正,得到多帧目标图像;使得所述第二摄像头输出的所述多帧目标图像的色彩由所述第六白平衡增益校正后的色彩向由所述第五白平衡增益校正后的色彩过渡。Based on the fifth white balance gain and the sixth white balance gain, white balance correction is performed on multiple frames of second images collected by the second camera to obtain multiple frames of target images; so that the output of the second camera The color of the multiple frames of the target image transitions from the color corrected by the sixth white balance gain to the color corrected by the fifth white balance gain.
  29. 一种图像采集设备,其特征在于,所述图像采集设备包括第一摄像头、第二摄像头以及如权利要求15-28任一项所述的图像处理装置。An image acquisition device, characterized in that the image acquisition device comprises a first camera, a second camera, and the image processing device according to any one of claims 15-28.
  30. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质被执行时可实现如权利要求1-14任一项所述的方法。A computer-readable storage medium, wherein the method according to any one of claims 1-14 can be realized when the computer-readable storage medium is executed.
PCT/CN2021/129018 2021-11-05 2021-11-05 Image processing method and apparatus, and image collection device and storage medium WO2023077431A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/129018 WO2023077431A1 (en) 2021-11-05 2021-11-05 Image processing method and apparatus, and image collection device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/129018 WO2023077431A1 (en) 2021-11-05 2021-11-05 Image processing method and apparatus, and image collection device and storage medium

Publications (1)

Publication Number Publication Date
WO2023077431A1 true WO2023077431A1 (en) 2023-05-11

Family

ID=86240480

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/129018 WO2023077431A1 (en) 2021-11-05 2021-11-05 Image processing method and apparatus, and image collection device and storage medium

Country Status (1)

Country Link
WO (1) WO2023077431A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478802A (en) * 2023-10-30 2024-01-30 神力视界(深圳)文化科技有限公司 Image processing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013207721A (en) * 2012-03-29 2013-10-07 Fujifilm Corp Image pickup device and its white balance correction method and white balance correction program
CN105227945A (en) * 2015-10-21 2016-01-06 维沃移动通信有限公司 A kind of control method of Automatic white balance and mobile terminal
CN107277355A (en) * 2017-07-10 2017-10-20 广东欧珀移动通信有限公司 camera switching method, device and terminal
CN107343190A (en) * 2017-07-25 2017-11-10 广东欧珀移动通信有限公司 White balance adjusting method, apparatus and terminal device
US20170359494A1 (en) * 2016-06-12 2017-12-14 Apple Inc. Switchover control techniques for dual-sensor camera system
CN111314683A (en) * 2020-03-17 2020-06-19 Oppo广东移动通信有限公司 White balance adjusting method and related equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013207721A (en) * 2012-03-29 2013-10-07 Fujifilm Corp Image pickup device and its white balance correction method and white balance correction program
CN105227945A (en) * 2015-10-21 2016-01-06 维沃移动通信有限公司 A kind of control method of Automatic white balance and mobile terminal
US20170359494A1 (en) * 2016-06-12 2017-12-14 Apple Inc. Switchover control techniques for dual-sensor camera system
CN107277355A (en) * 2017-07-10 2017-10-20 广东欧珀移动通信有限公司 camera switching method, device and terminal
CN107343190A (en) * 2017-07-25 2017-11-10 广东欧珀移动通信有限公司 White balance adjusting method, apparatus and terminal device
CN111314683A (en) * 2020-03-17 2020-06-19 Oppo广东移动通信有限公司 White balance adjusting method and related equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478802A (en) * 2023-10-30 2024-01-30 神力视界(深圳)文化科技有限公司 Image processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US8830348B2 (en) Imaging device and imaging method
JP5321163B2 (en) Imaging apparatus and imaging method
CN108154514B (en) Image processing method, device and equipment
WO2017045558A1 (en) Depth-of-field adjustment method and apparatus, and terminal
JP2009053748A (en) Image processing apparatus, image processing program, and camera
US10582174B2 (en) Video processing apparatus, video processing method, and medium
US20090190856A1 (en) Distortion correcting apparatus
CN112991245B (en) Dual-shot blurring processing method, device, electronic equipment and readable storage medium
US11245852B2 (en) Capturing apparatus for generating two types of images for display from an obtained captured image based on scene luminance and exposure
WO2023077431A1 (en) Image processing method and apparatus, and image collection device and storage medium
JP6253007B2 (en) Display device
US20180077298A1 (en) Image-capturing assistance device and image-capturing device
CN114339042A (en) Image processing method and device based on multiple cameras and computer readable storage medium
CN113315956B (en) Image processing apparatus, image capturing apparatus, image processing method, and machine-readable medium
KR102285756B1 (en) Electronic system and image processing method
JP5911340B2 (en) Imaging apparatus and control method thereof
JP6210772B2 (en) Information processing apparatus, imaging apparatus, control method, and program
WO2023016044A1 (en) Video processing method and apparatus, electronic device, and storage medium
JP2016046610A (en) Imaging apparatus
JP2009212787A (en) Imaging apparatus and imaging method
EP3442218A1 (en) Imaging apparatus and control method for outputting images with different input/output characteristics in different regions and region information, client apparatus and control method for receiving images with different input/output characteristics in different regions and region information and displaying the regions in a distinguishable manner
WO2022087982A1 (en) Image processing method and apparatus, photographing device, and computer-readable storage medium
WO2023011197A1 (en) Image processing method, electronic device, and computer readable storage medium
US20240007599A1 (en) Information processing system, information processing device, information processing method, information processing program, imaging device, control method of imaging device, and control program
WO2023044789A1 (en) Zooming method and device for image acquisition 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: 21962944

Country of ref document: EP

Kind code of ref document: A1