WO2017206444A1 - Method and device for detecting imaging difference, and computer storage medium - Google Patents

Method and device for detecting imaging difference, and computer storage medium Download PDF

Info

Publication number
WO2017206444A1
WO2017206444A1 PCT/CN2016/105783 CN2016105783W WO2017206444A1 WO 2017206444 A1 WO2017206444 A1 WO 2017206444A1 CN 2016105783 W CN2016105783 W CN 2016105783W WO 2017206444 A1 WO2017206444 A1 WO 2017206444A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
difference
camera device
comparing
captured
Prior art date
Application number
PCT/CN2016/105783
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 中兴通讯股份有限公司
Publication of WO2017206444A1 publication Critical patent/WO2017206444A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N23/676Bracketing for image capture at varying focusing conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Definitions

  • the present invention relates to terminal imaging technologies, and in particular, to an imaging difference detection method and apparatus, and a computer storage medium.
  • the image quality of the two cameras of the mobile terminal should be as close as possible; the closer the image quality of the two cameras is, the closer the focus accuracy and the background blur The better.
  • the difference in the installation position of the dual camera there is often one of the cameras in a position that is relatively easy to touch or occlude; if the camera is set to an auxiliary camera that is not visible, then if the camera is When occlusion or foreign object coverage on the lens, the difference in imaging quality between the two cameras will increase; the difference in imaging quality will directly affect the focus accuracy and blurring of the background blurred object contour, which will affect the user experience. Based on this, in the case of occlusion and foreign object coverage, it is particularly important to confirm whether the dual camera framing is successful, that is, whether the imaging quality of the two cameras is close enough.
  • embodiments of the present invention are directed to provide an imaging difference detecting method, apparatus, and computer storage medium, which can effectively identify the occlusion and foreign object coverage existing on the camera, remind the user to clean up, thereby reducing the imaging difference between the two cameras, and improving the double Camera image quality.
  • An embodiment of the present invention provides an imaging difference detecting method, where the method includes:
  • comparing the difference in imaging quality between the first image and the second image includes:
  • the difference in image content, and/or image sharpness, and/or image contrast of the first and second images is compared.
  • the comparing the difference between the image content of the first image and the second image includes:
  • the first image and the second image are divided into more than one block, and the difference in image content of the corresponding position block of the first image and the second image is compared.
  • comparing the difference of the image content of the corresponding location block of the first image and the second image comprises: comparing image content of the same location block of the first image and the second image corner area difference.
  • the comparing the difference in image sharpness of the first image and the second image comprises: comparing a difference in edge definition of the subject in the first image and the second image.
  • the comparing the difference in edge definition of the object in the first image and the second image includes:
  • a difference in sharpness of a position corresponding to a position of the subject in the first image and the second image is compared.
  • comparing the difference in image contrast between the first image and the second image comprises: comparing a difference in contrast between the first image and the second image by using a histogram.
  • the acquiring the first image and the second image captured by the first camera device and the second camera device respectively includes: acquiring the image captured by the first camera device and the second camera device at a preset focal length And a first image and a second image, or the first image and the second image within a preset focal length difference range captured by the first camera and the second camera.
  • the embodiment of the present invention further provides an imaging difference detecting device, where the device includes: an acquiring module and a comparing module; wherein
  • the acquiring module is configured to acquire a first image captured by the first camera device and a second image captured by the second camera device;
  • the comparison module is configured to compare image quality differences between the first image and the second image, and generate and issue a prompt when the image quality difference exceeds a preset threshold.
  • the comparison module is specifically configured to:
  • the difference in image content, and/or image sharpness, and/or image contrast of the first and second images is compared.
  • the acquiring module is specifically configured to:
  • Embodiments of the present invention also provide a computer storage medium, the storage medium comprising a set of instructions that, when executed, cause at least one processor to perform operations including:
  • the imaging difference detecting method and device and the computer storage medium provided by the embodiments of the present invention respectively acquire the first image and the second image captured by the first camera device and the second camera device; and compare the first image and the second image
  • the difference in imaging quality when the difference in imaging quality exceeds a preset threshold, prompts the user. In this way, by detecting the difference between the imaging of the two camera devices, the occlusion and foreign object coverage existing on the camera can be effectively recognized, and the user is prompted to clear, thereby reducing the imaging difference between the two cameras and improving the imaging quality of the dual camera.
  • FIG. 1 is a schematic flow chart of an imaging difference detecting method according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram showing a comparison of histograms in different contrasts according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of an imaging difference detecting apparatus according to an embodiment of the present invention.
  • the first image and the second image captured by the first camera device and the second camera device are respectively acquired; and the image quality difference between the first image and the second image is compared, when the image quality difference exceeds Prompt the user when the threshold is preset.
  • the difference in imaging quality may be a difference in image content, or may be a difference in sharpness of a subject edge in the image, or may be a difference in image contrast.
  • the imaging difference detecting method provided by the embodiment of the present invention is as shown in FIG. 1 , and the method includes:
  • Step 101 Acquire a first image and a second image captured by the first camera device and the second camera device, respectively;
  • the first camera device and the second camera device may be two cameras on the same side of the dual camera terminal, such as a dual camera located at the back of the terminal; the first camera may be separately obtained. a first image and a second image captured by the image device and the second camera at the same time;
  • a detection mode can be set in Synchronizing the focal lengths of the two cameras in the detection mode, so that the two cameras take the first image and the second image with a uniform focal length, ensuring that the focal lengths of the first image and the second image are consistent, so that it can be avoided in subsequent comparisons.
  • the deviation of the comparison result should be caused by the difference of depth of field; this detection mode can be added to the stage before the user takes the photo according to the demand, to avoid affecting the normal shooting of the user; or in the normal shooting process, the focal length difference between the two cameras falls The first image and the second image captured when a preset focal length difference is within a range.
  • Step 102 Comparing the difference in imaging quality between the first image and the second image, generating and issuing a prompt when the difference in imaging quality exceeds a preset threshold;
  • three methods may be used to detect whether the camera has occlusion or foreign object coverage, and one of them may be used or a combination thereof may be used to compare the difference in imaging quality between the first image and the second image to determine whether the lens exists.
  • Occlusion or foreign object coverage wherein the difference in imaging quality may be a difference in image content, a difference in sharpness of a subject edge in the image, or a difference in image contrast.
  • the image content captured by the two cameras may be different, and therefore, the image content may be detected by comparing the image content; specifically, the image may be captured.
  • the first image and the second image are respectively divided into more than one block, and the block contents corresponding to the positions of the two images are compared.
  • the comparison of the block contents can be mainly used for detecting the small-area occlusion; the small-area occlusion is usually mainly located at the corner position of the image, and can be from the corner area.
  • the block starts to contrast, so you can minimize the amount of calculation. If the calculation finds that the difference of the block content exceeds the preset content difference threshold, the current first image and the second image are considered to be different. As a result, one of the cameras may have a shadow, which may prompt the user that the camera lens has a shadow.
  • SIM Structural Similarity
  • the preset content difference threshold When the difference value exceeds When the preset content difference threshold is used, the prompt is sent to the user; due to the difference between the dual camera position and the individual performance of the camera, the image content of the first image and the second image captured by the two cameras cannot be completely consistent, and statistics can be performed.
  • the image content difference between the first image and the second image taken under ideal conditions may not be reached in actual shooting, so if the image content difference is 1% to 3% under ideal conditions, A difference value of 3% to 5% is selected as the preset content difference threshold.
  • Method 2 contrasting the edge definition of the image subject
  • the sharpness of the subject in the captured image will be significantly reduced. Therefore, the sharpness of the same subject in the first image and the second image can be compared to detect whether there is a foreign object. Covering the lens; further, in the case where the lens has foreign matter coverage, the edge sharpness of the subject is most significantly reduced, and therefore, it is preferable to compare the edge sharpness of the same subject in the first image and the second image.
  • some existing image object edge detection algorithms such as Sobeel Sobel edge detection algorithm may be used to determine the edge of the object; and the edge sharpness evaluation method is used to compare the edges of the two images.
  • the resolution evaluation method a Laplace image sharpness algorithm or the like in the edge gradient detection method may be employed.
  • a prompt is sent to the user, prompting the user that there may be foreign object coverage on the lens; Due to the difference of the dual camera position, the individual performance of the camera, etc., the first image and the second image captured by the two cameras cannot achieve the same edge definition, and the first image and the second image taken under ideal conditions can be counted.
  • the difference in edge definition of the image this difference range may not be achieved in actual shooting, so if the difference in edge resolution is close to ideal conditions For the range of 1% to 3%, a difference value of 3% to 5% can be selected as the preset sharpness difference threshold.
  • the contrast of the image will be significantly reduced due to the blocking effect of the foreign matter on the light. This change will be directly reflected on the histogram of the first image and the second image. Compare the histograms to determine if one of them has a foreign object and gives a user prompt.
  • the grayscale histogram can be used to measure the image contrast.
  • the histogram is a two-dimensional map.
  • the abscissa indicates the gray level of each pixel in the image, which can be 0 to 255 levels; the ordinate is the gray level.
  • the histogram has a bimodal characteristic; the more uniform the histogram distribution, the better the image contrast; for the same image, if the contrast is reduced, the histogram distribution will be concentrated; the histogram shown in Figure 2(a)
  • the picture shows a histogram of the original image. It can be seen that the pixel distribution on each gray scale is more uniform in the histogram.
  • Figure 2(b) is the histogram of the image after the lens is covered by foreign objects. You can see the gray in the histogram.
  • the pixel distribution is more concentrated, indicating that the contrast of Figure 2(b) is lower; by comparing the histograms of the first image and the second image, if the pixel distribution on each gray scale is found on one of the histograms If the concentration is relatively concentrated, it can be judged that the contrast of the image is low, and the corresponding image of the camera may have foreign object coverage; here, a contrast difference threshold may be set, when the difference between the histogram of the first image and the second image exceeds the contrast difference At the threshold, it is determined that there may be foreign matter coverage on the lens corresponding to one of the images, and the user is prompted; here, the contrast difference may be a difference in the uniformity of the distribution of the histogram; due to differences in the position of the dual camera and the individual performance of the camera, The image contrast of the first image and the second image captured by the two cameras cannot be completely consistent, and the difference between the first image and the second image captured under ideal conditions can be counted, such as 1% to 3 %; this difference range may
  • the imaging difference detecting device provided by the embodiment of the present invention, as shown in FIG. 3, the device includes: an obtaining module 31 and a comparing module 32;
  • the acquiring module 31 is configured to acquire a first image captured by the first camera device and a second image captured by the second camera device;
  • the first camera device and the second camera device may be two cameras on the same side of the dual camera terminal, such as a dual camera located at the back of the terminal; the first camera device and the second camera device may be respectively acquired in the same a first image and a second image taken at time;
  • a detection mode can be set in Synchronizing the focal lengths of the two cameras in the detection mode, so that the two cameras take the first image and the second image with a uniform focal length, ensuring that the focal lengths of the first image and the second image are consistent, so that it can be avoided in subsequent comparisons.
  • the deviation of the comparison result should be caused by the difference of depth of field; this detection mode can be added to the stage before the user takes the photo according to the demand, to avoid affecting the normal shooting of the user; or in the normal shooting process, the focal length difference between the two cameras falls The first image and the second image captured when a preset focal length difference is within a range.
  • the comparison module 32 is configured to compare image quality differences between the first image and the second image, and generate and issue a prompt when the image quality difference exceeds a preset threshold;
  • three methods may be used to detect whether the camera has occlusion or foreign object coverage, and one of them may be used or a combination thereof may be used to compare the difference in imaging quality between the first image and the second image to determine whether the lens exists.
  • Occlusion or foreign object coverage wherein the difference in imaging quality may be a difference in image content or a difference in sharpness of a subject edge in the image, It can also be the difference in image contrast.
  • the image content captured by the two cameras may be different, and therefore, the image content may be detected by comparing the image content; specifically, the image may be captured.
  • the first image and the second image are respectively divided into more than one block, and the block contents corresponding to the positions of the two images are compared.
  • the comparison of the block contents can be mainly used for detecting the small-area occlusion; the small-area occlusion is usually mainly located at the corner position of the image, and can be from the corner area.
  • the block starts to contrast, so you can minimize the amount of calculation. If the calculation finds that the difference of the block content exceeds the preset content difference threshold, it is considered that the current first image and the second image are inconsistent, and one of the cameras may have a shadow, which may prompt the user that the camera lens has a shadow condition.
  • some existing algorithms such as a SIM algorithm, may be used to compare the image similarity of the image block content, and set a preset content difference threshold, when the difference value exceeds the preset content difference threshold.
  • the difference between the image content of the first image and the second image this difference range may not be achieved in actual shooting. Therefore, if the image content difference is 1% to 3% under ideal conditions, 3% to 5% may be selected.
  • the difference value is used as a preset content difference threshold.
  • Method 2 contrasting the edge definition of the image subject
  • the sharpness of the subject in the captured image will be significantly reduced. Therefore, the sharpness of the same subject in the first image and the second image can be compared to detect whether there is a foreign object. Covering the lens; further, in the case where the lens has foreign matter coverage, the edge sharpness of the subject is most significantly reduced, and therefore, it is preferable to compare the edge sharpness of the same subject in the first image and the second image.
  • some existing image object edge detection algorithms such as Sobel edge detection algorithm and the like may be used to determine the edge of the object; and the edge definition of the two images is compared by the edge sharpness evaluation method;
  • the resolution evaluation method may use a Laplace image sharpness algorithm in the edge gradient detection method or the like.
  • the contrast of the image will be significantly reduced due to the blocking effect of the foreign matter on the light. This change will be directly reflected on the histogram of the first image and the second image. Compare the histograms to determine if one of them has a foreign object and gives a user prompt.
  • the gray histogram can be used to measure the image contrast; the histogram is a two-dimensional map, and the abscissa indicates the gray level of each pixel in the image, which can be 0 to 255 levels; the ordinate is the gray level.
  • the contrast difference may be a difference in the degree of uniformity of the histogram distribution; the first image taken by the two cameras due to the difference in the position of the dual camera, the individual performance of the camera, and the like The contrast of the image with the second image cannot be completely consistent, and the difference between the contrast of the first image and the second image taken under ideal conditions can be counted, such as 1% to 3%;
  • the acquiring module 31 can be implemented by a camera device of the terminal in combination with a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
  • the comparison module 32 can be implemented by a CPU, an MPU, a DSP, an FPGA, or the like of the terminal.
  • Embodiments of the present invention also provide a computer storage medium, the storage medium comprising a set of instructions that, when executed, cause at least one processor to perform operations including:
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiment of the invention discloses an imaging difference detecting method, a device and a computer storage medium, respectively acquiring a first image and a second image captured by the first camera device and the second camera device;
  • the difference in imaging quality between the first image and the second image is issued to the user when the difference in imaging quality exceeds a preset threshold.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Studio Devices (AREA)

Abstract

Disclosed in an embodiment of the invention is a method for detecting an imaging difference, comprising: respectively acquiring a first image and a second image captured by a first photographing device and a second photographing device; and comparing the first image and the second image to obtain a difference in imaging quality therebetween, and if the difference in imaging quality exceeds a preset threshold, generating and issuing a notification. Also disclosed in the embodiment of the invention are a device for detecting an imaging difference, and a computer storage medium.

Description

一种成像差异检测方法、装置及计算机存储介质Imaging difference detecting method, device and computer storage medium 技术领域Technical field
本发明涉及终端成像技术,尤其涉及一种成像差异检测方法、装置及计算机存储介质。The present invention relates to terminal imaging technologies, and in particular, to an imaging difference detection method and apparatus, and a computer storage medium.
背景技术Background technique
目前,越来越多的移动终端采用双摄像头解决方案来实现快速对焦、背景虚化、全景深拍照等功能。At present, more and more mobile terminals use dual camera solutions to achieve fast focus, background blur, panoramic deep camera and other functions.
无论是快速对焦,还是大光圈功能,都要求移动终端的两个摄像头拍摄的图像质量等各项指标要尽量接近;两个摄像头拍摄图像的图像质量越接近,对焦准确性和背景虚化等效果越出色。但是,实际使用过程中,基于双摄像头安装位置的差别,经常会有其中一个摄像头处于相对易触碰或遮挡的位置;如果这个摄像头被设置成取景不可见的辅助摄像头,那么,如果这个摄像头被遮挡或者镜头上有异物覆盖时,两个摄像头的成像质量差别就会加大;成像质量相差得大,就会直接影响对焦准确性和背景虚化物体轮廓模糊等问题,进而影响用户体验。基于此,在有遮挡和异物覆盖情况下,确认双摄像头取景是否成功,也就是两个摄像头成像质量是否足够接近,显得尤为重要。Whether it is fast focus or large aperture function, it is required that the image quality of the two cameras of the mobile terminal should be as close as possible; the closer the image quality of the two cameras is, the closer the focus accuracy and the background blur The better. However, in actual use, based on the difference in the installation position of the dual camera, there is often one of the cameras in a position that is relatively easy to touch or occlude; if the camera is set to an auxiliary camera that is not visible, then if the camera is When occlusion or foreign object coverage on the lens, the difference in imaging quality between the two cameras will increase; the difference in imaging quality will directly affect the focus accuracy and blurring of the background blurred object contour, which will affect the user experience. Based on this, in the case of occlusion and foreign object coverage, it is particularly important to confirm whether the dual camera framing is successful, that is, whether the imaging quality of the two cameras is close enough.
识别大面积遮挡相对来说简单一些,因为大面积遮挡了以后,曝光有明显差别,通过曝光差别很容易判断出有遮挡,进而提示用户检查并避免遮挡摄像头;但是,目前没有有效的方法来识别摄像头上存在的小部分遮挡和异物覆盖。It is relatively simple to identify large-area occlusions. Because large areas are occluded, there is a significant difference in exposure. It is easy to judge occlusion by exposure difference, and then prompt the user to check and avoid occlusion of the camera; however, there is currently no effective way to identify A small amount of occlusion and foreign object coverage on the camera.
因此,如何有效识别摄像头上存在的遮挡和异物覆盖,提醒用户清理,减小两个摄像头成像差异,提高双摄像头成像质量,是亟待解决的问题。 Therefore, how to effectively identify the occlusion and foreign object coverage existing on the camera, remind the user to clean up, reduce the imaging difference between the two cameras, and improve the imaging quality of the dual camera is an urgent problem to be solved.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种成像差异检测方法、装置及计算机存储介质,能有效识别摄像头上存在的遮挡和异物覆盖,提醒用户清理,从而减小两个摄像头成像差异,提高双摄像头成像质量。In view of this, embodiments of the present invention are directed to provide an imaging difference detecting method, apparatus, and computer storage medium, which can effectively identify the occlusion and foreign object coverage existing on the camera, remind the user to clean up, thereby reducing the imaging difference between the two cameras, and improving the double Camera image quality.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, the technical solution of the present invention is achieved as follows:
本发明实施例提供了一种成像差异检测方法,所述方法包括:An embodiment of the present invention provides an imaging difference detecting method, where the method includes:
分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;Acquiring the first image and the second image captured by the first camera device and the second camera device respectively;
对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示。Comparing the difference in imaging quality between the first image and the second image, when the difference in imaging quality exceeds a preset threshold, a prompt is generated and issued.
上述方案中,所述对比所述第一图像和第二图像的成像质量差异,包括:In the above solution, comparing the difference in imaging quality between the first image and the second image includes:
对比所述第一图像和第二图像的图像内容、和/或图像清晰度、和/或图像对比度的差异。The difference in image content, and/or image sharpness, and/or image contrast of the first and second images is compared.
上述方案中,所述对比所述第一图像和第二图像的图像内容的差异,包括:In the above solution, the comparing the difference between the image content of the first image and the second image includes:
将所述第一图像和第二图像分成一个以上的区块,对比所述第一图像和第二图像的对应位置区块的图像内容的差异。The first image and the second image are divided into more than one block, and the difference in image content of the corresponding position block of the first image and the second image is compared.
上述方案中,所述对比所述第一图像和第二图像的对应位置区块的图像内容的差异,包括:对比所述第一图像和第二图像边角区域相同位置区块的图像内容的差异。In the above solution, comparing the difference of the image content of the corresponding location block of the first image and the second image comprises: comparing image content of the same location block of the first image and the second image corner area difference.
上述方案中,所述对比所述第一图像和第二图像的图像清晰度的差异,包括:对比所述第一图像和第二图像中被摄物的边缘清晰度的差异。In the above solution, the comparing the difference in image sharpness of the first image and the second image comprises: comparing a difference in edge definition of the subject in the first image and the second image.
上述方案中,所述对比所述第一图像和第二图像中被摄物的边缘清晰度的差异,包括:In the above solution, the comparing the difference in edge definition of the object in the first image and the second image includes:
采用索贝尔(Sobel)边缘检测算法,检测所述第一图像和第二图像中 被摄物的边缘;Detecting the first image and the second image using a Sobel edge detection algorithm The edge of the subject;
对比所述第一图像和第二图像中被摄物对应位置边缘的清晰度的差异。A difference in sharpness of a position corresponding to a position of the subject in the first image and the second image is compared.
上述方案中,所述对比所述第一图像和第二图像的图像对比度的差异,包括:采用直方图对比所述第一图像和第二图像的对比度的差异。In the above solution, comparing the difference in image contrast between the first image and the second image comprises: comparing a difference in contrast between the first image and the second image by using a histogram.
上述方案中,所述分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像,包括:获取所述第一摄像装置和第二摄像装置在预设焦距上拍摄的所述第一图像和第二图像,或获取所述第一摄像装置和所述第二摄像装置拍摄的预设焦距差异范围内的所述第一图像和第二图像。In the above solution, the acquiring the first image and the second image captured by the first camera device and the second camera device respectively includes: acquiring the image captured by the first camera device and the second camera device at a preset focal length And a first image and a second image, or the first image and the second image within a preset focal length difference range captured by the first camera and the second camera.
本发明实施例还提供了一种成像差异检测装置,所述装置包括:获取模块、对比模块;其中,The embodiment of the present invention further provides an imaging difference detecting device, where the device includes: an acquiring module and a comparing module; wherein
所述获取模块,用于获取第一摄像装置拍摄的第一图像,和第二摄像装置拍摄的第二图像;The acquiring module is configured to acquire a first image captured by the first camera device and a second image captured by the second camera device;
所述对比模块,用于对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示。The comparison module is configured to compare image quality differences between the first image and the second image, and generate and issue a prompt when the image quality difference exceeds a preset threshold.
上述方案中,所述对比模块,具体用于:In the above solution, the comparison module is specifically configured to:
对比所述第一图像和第二图像的图像内容、和/或图像清晰度、和/或图像对比度的差异。The difference in image content, and/or image sharpness, and/or image contrast of the first and second images is compared.
上述方案中,所述获取模块,具体用于:In the above solution, the acquiring module is specifically configured to:
获取所述第一摄像装置和第二摄像装置在预设焦距上拍摄的所述第一图像和第二图像,或获取所述第一摄像装置和所述第二摄像装置拍摄的预设焦距差异范围内的所述第一图像和第二图像。Acquiring the first image and the second image captured by the first camera device and the second camera device on a preset focal length, or acquiring a preset focal length difference captured by the first camera device and the second camera device The first image and the second image within range.
本发明实施例还提供了一种计算机存储介质,该存储介质包括一组指令,当执行所述指令时,引起至少一个处理器执行包括以下的操作:Embodiments of the present invention also provide a computer storage medium, the storage medium comprising a set of instructions that, when executed, cause at least one processor to perform operations including:
分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像; Acquiring the first image and the second image captured by the first camera device and the second camera device respectively;
对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示。Comparing the difference in imaging quality between the first image and the second image, when the difference in imaging quality exceeds a preset threshold, a prompt is generated and issued.
本发明实施例所提供的成像差异检测方法、装置及计算机存储介质,分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,向用户发出提示。如此,通过检测两个摄像装置成像的差异,能有效识别摄像头上存在的遮挡和异物覆盖,提醒用户清理,从而减小两个摄像头成像差异,提高双摄像头成像质量。The imaging difference detecting method and device and the computer storage medium provided by the embodiments of the present invention respectively acquire the first image and the second image captured by the first camera device and the second camera device; and compare the first image and the second image The difference in imaging quality, when the difference in imaging quality exceeds a preset threshold, prompts the user. In this way, by detecting the difference between the imaging of the two camera devices, the occlusion and foreign object coverage existing on the camera can be effectively recognized, and the user is prompted to clear, thereby reducing the imaging difference between the two cameras and improving the imaging quality of the dual camera.
附图说明DRAWINGS
图1为本发明实施例成像差异检测方法的流程示意图;1 is a schematic flow chart of an imaging difference detecting method according to an embodiment of the present invention;
图2为本发明实施例不同对比度下直方图对比示意图;2 is a schematic diagram showing a comparison of histograms in different contrasts according to an embodiment of the present invention;
图3为本发明实施例成像差异检测装置的组成结构示意图。FIG. 3 is a schematic structural diagram of an imaging difference detecting apparatus according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例中,分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,提示用户。In the embodiment of the present invention, the first image and the second image captured by the first camera device and the second camera device are respectively acquired; and the image quality difference between the first image and the second image is compared, when the image quality difference exceeds Prompt the user when the threshold is preset.
其中,所述成像质量差异可以是图像内容的差异,也可以是图像中被摄物边缘清晰度的差异,还可以是图像对比度的差异。Wherein, the difference in imaging quality may be a difference in image content, or may be a difference in sharpness of a subject edge in the image, or may be a difference in image contrast.
下面结合实施例对本发明再作进一步详细的说明。The present invention will be further described in detail below with reference to the embodiments.
本发明实施例提供的成像差异检测方法,如图1所示,所述方法包括:The imaging difference detecting method provided by the embodiment of the present invention is as shown in FIG. 1 , and the method includes:
步骤101:分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;Step 101: Acquire a first image and a second image captured by the first camera device and the second camera device, respectively;
这里,所述第一摄像装置和第二摄像装置可以是双摄像头终端位于同侧的两个摄像头,如位于终端背部的双摄像头;可以分别获取所述第一摄 像装置和第二摄像装置在同一时间拍摄的第一图像和第二图像;Here, the first camera device and the second camera device may be two cameras on the same side of the dual camera terminal, such as a dual camera located at the back of the terminal; the first camera may be separately obtained. a first image and a second image captured by the image device and the second camera at the same time;
进一步的,由于通常双摄像头被设置成一个对近处对焦,一个对远处对焦,两个摄像头拍摄的图像在景深上会有较大差异,不利于对比;因此,可以设置一个检测模式,在检测模式下同步两个摄像头的焦距,使两个摄像头采用统一焦距拍摄所述第一图像和第二图像,确保第一图像和第二图像焦距一致,这样,在可以避免在后续对比中不会应为景深的差异而引起比较结果的偏差;这个检测模式可以根据需求加在用户拍摄照片前的阶段,避免影响用户正常拍摄;也可以采用在正常拍摄过程中,两个摄像头的焦距差落在预先设定的焦距差范围内时拍摄的所述第一图像和第二图像。Further, since the dual camera is usually set to focus on a near focus and a focus on a distance, the images captured by the two cameras may have a large difference in depth of field, which is not conducive to comparison; therefore, a detection mode can be set in Synchronizing the focal lengths of the two cameras in the detection mode, so that the two cameras take the first image and the second image with a uniform focal length, ensuring that the focal lengths of the first image and the second image are consistent, so that it can be avoided in subsequent comparisons. The deviation of the comparison result should be caused by the difference of depth of field; this detection mode can be added to the stage before the user takes the photo according to the demand, to avoid affecting the normal shooting of the user; or in the normal shooting process, the focal length difference between the two cameras falls The first image and the second image captured when a preset focal length difference is within a range.
步骤102:对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示;Step 102: Comparing the difference in imaging quality between the first image and the second image, generating and issuing a prompt when the difference in imaging quality exceeds a preset threshold;
这里,可以采用三种方法来检测摄像头是否存在的遮挡或异物覆盖,可以采用其中的一种或采用其组合来对比所述第一图像和第二图像的成像质量差异,进而判断镜头是否存在的遮挡或异物覆盖;其中,所述成像质量差异可以是图像内容的差异,也可以是图像中被摄物边缘清晰度的差异,还可以是图像对比度的差异。Here, three methods may be used to detect whether the camera has occlusion or foreign object coverage, and one of them may be used or a combination thereof may be used to compare the difference in imaging quality between the first image and the second image to determine whether the lens exists. Occlusion or foreign object coverage; wherein the difference in imaging quality may be a difference in image content, a difference in sharpness of a subject edge in the image, or a difference in image contrast.
方法1:图像内容对比;Method 1: Comparison of image content;
通常,如果在双摄像头终端的一个摄像头镜头被手指等遮蔽的情况下,两个摄像头所拍摄的图像内容会有差异,因此,可以通过对比图像内容的方法来进行检测;具体的,可以将拍摄的第一图像和第二图像分别划分一个以上的区块,对比两个图像对应位置的区块内容。进一步的,由于大面积的遮蔽可以通过曝光差别进行检测,区块内容的对比可以主要用于对小面积的遮蔽进行检测;小面积的遮蔽通常主要位于图像的边角位置,可以从边角区块开始对比,如此,可以尽量减小计算量。如果计算发现区块内容的差异超过预设的内容差异阈值,则认为当前第一图像和第二图像不一 致,其中的一个摄像头可能有遮蔽,可以提示用户摄像头镜头有遮蔽情况。Generally, if a camera lens of a dual camera terminal is blocked by a finger or the like, the image content captured by the two cameras may be different, and therefore, the image content may be detected by comparing the image content; specifically, the image may be captured. The first image and the second image are respectively divided into more than one block, and the block contents corresponding to the positions of the two images are compared. Further, since the large-area occlusion can be detected by the difference in exposure, the comparison of the block contents can be mainly used for detecting the small-area occlusion; the small-area occlusion is usually mainly located at the corner position of the image, and can be from the corner area. The block starts to contrast, so you can minimize the amount of calculation. If the calculation finds that the difference of the block content exceeds the preset content difference threshold, the current first image and the second image are considered to be different. As a result, one of the cameras may have a shadow, which may prompt the user that the camera lens has a shadow.
实际应用中,可以采用现有的一些算法如:结构相似性(SIM,Structural SIMilarity)算法等,对图像区块内容进行图像相似度比较,并设定一个预设内容差异阈值,当差异值超出所述预设内容差异阈值时,向用户发送提示;由于双摄像头位置、摄像头个体性能等差异,两个摄像头拍摄的所述第一图像和第二图像的图像内容无法做到完全一致,可以统计接近理想状况下拍摄的所述第一图像和第二图像的图像内容差异;实际拍摄中可能达不到这个差异范围,因此,如果接近理想状况下图像内容差异为1%~3%,则可以选定3%~5%的差异值作为预设内容差异阈值。In practical applications, some existing algorithms such as Structural Similarity (SIM) can be used to compare the image similarity of the image block content, and set a preset content difference threshold. When the difference value exceeds When the preset content difference threshold is used, the prompt is sent to the user; due to the difference between the dual camera position and the individual performance of the camera, the image content of the first image and the second image captured by the two cameras cannot be completely consistent, and statistics can be performed. The image content difference between the first image and the second image taken under ideal conditions may not be reached in actual shooting, so if the image content difference is 1% to 3% under ideal conditions, A difference value of 3% to 5% is selected as the preset content difference threshold.
方法2:图像被摄物的边缘清晰度对比;Method 2: contrasting the edge definition of the image subject;
通常,如果在镜头有异物覆盖的情况下,拍摄的图像中被摄物清晰度会有明显下降,因此,可以对比第一图像和第二图像中相同被摄物的清晰度来检测是否有异物覆盖在镜头上;进一步的,在镜头有异物覆盖的情况下,被摄物的边缘清晰度下降最为明显,因此,可以优选对比第一图像和第二图像中相同被摄物的边缘清晰度。Generally, if there is a foreign object covering the lens, the sharpness of the subject in the captured image will be significantly reduced. Therefore, the sharpness of the same subject in the first image and the second image can be compared to detect whether there is a foreign object. Covering the lens; further, in the case where the lens has foreign matter coverage, the edge sharpness of the subject is most significantly reduced, and therefore, it is preferable to compare the edge sharpness of the same subject in the first image and the second image.
实际应用中,可以采用一些现有的图像物体边缘检测算法如:基于索贝儿Sobel边缘检测算法等,来确定所述被摄物的边缘;并通过边缘清晰度评价方法比较两幅图像边缘清晰度;其中,清晰度评价方法可以采用边缘梯度检测法中的拉普拉斯(Laplace)图像清晰度算法等。通过设定一个预设清晰度差异阈值,当第一图像和第二图像的边缘清晰度比较差异超出所述预设清晰度差异阈值时,向用户发送提示,提示用户可能镜头上有异物覆盖;由于双摄像头位置、摄像头个体性能等差异,两个摄像头拍摄的所述第一图像和第二图像无法做到边缘清晰度完全一致,可以统计接近理想状况下拍摄的所述第一图像和第二图像的边缘清晰度的差异;实际拍摄中可能达不到这个差异范围,因此,如果接近理想状况下边缘清晰度的差异 为1%~3%,则可以选定3%~5%的差异值作为预设清晰度差异阈值。In practical applications, some existing image object edge detection algorithms such as Sobeel Sobel edge detection algorithm may be used to determine the edge of the object; and the edge sharpness evaluation method is used to compare the edges of the two images. In the resolution evaluation method, a Laplace image sharpness algorithm or the like in the edge gradient detection method may be employed. By setting a preset sharpness difference threshold, when the edge sharpness comparison difference between the first image and the second image exceeds the preset sharpness difference threshold, a prompt is sent to the user, prompting the user that there may be foreign object coverage on the lens; Due to the difference of the dual camera position, the individual performance of the camera, etc., the first image and the second image captured by the two cameras cannot achieve the same edge definition, and the first image and the second image taken under ideal conditions can be counted. The difference in edge definition of the image; this difference range may not be achieved in actual shooting, so if the difference in edge resolution is close to ideal conditions For the range of 1% to 3%, a difference value of 3% to 5% can be selected as the preset sharpness difference threshold.
方法3:图像对比度对比;Method 3: Image contrast contrast;
通常,如果在镜头有异物覆盖的情况下,由于异物对光线的遮挡作用,会使得图像对比度明显下降,这种变化会直接体现在所述第一图像和第二图像的直方图上,可以通过比较直方图,来判断是否其中一个有异物覆盖并给出用户提示。Generally, if there is foreign matter covering the lens, the contrast of the image will be significantly reduced due to the blocking effect of the foreign matter on the light. This change will be directly reflected on the histogram of the first image and the second image. Compare the histograms to determine if one of them has a foreign object and gives a user prompt.
具体的,可以采用灰度直方图来衡量图像对比度,直方图是一个二维图,横坐标表示图像中各个像素点的灰度级,可以采用0到255个级别;纵坐标为各个灰度级上图像各个像素点出现的次数或概率;直方图的峰值集中在低端,则图像较暗,反之,图像较亮;直方图的峰值集中在某个区域,图像昏暗,图像中物体和背景差别很大的图像,其直方图具有双峰特性;直方图分布越均匀,图像对比度越好;对于同一副图像,如果对比度下降,则直方图分布会集中;如图2(a)所示的直方图为一张原始图像的直方图,可以看到直方图中各灰度上像素分布较为均匀,如图2(b)为镜头被异物覆盖后图像的直方图,可以看到直方图中各灰度上像素分布较为集中,表明图2(b)的对比度较低;通过对比第一图像和第二图像的直方图,如果发现其中一张直方图上各灰度上像素分布较为集中,则可以判断该图像对比度较低,该图像对应的摄像装置镜头上可能有异物覆盖;这里可以设置一个对比度差异阈值,当第一图像和第二图像的直方图差异超出所述对比度差异阈值时,确定其中一张图像对应的镜头上可能有异物覆盖,向用户发出提示;这里,所述对比度差异可以是直方图的分布均匀程度的差异;由于双摄像头位置、摄像头个体性能等差异,两个摄像头拍摄的所述第一图像和第二图像的图像对比度无法做到对比度完全一致,可以统计接近理想状况下拍摄的所述第一图像和第二图像对比度的差异,如1%~3%;实际拍摄中可能达不到这个差异范围,因此,如果接近理想状况下对比度 的差异为1%~3%,则可以选定3%~5%的差异值作为预设对比度差异阈值。Specifically, the grayscale histogram can be used to measure the image contrast. The histogram is a two-dimensional map. The abscissa indicates the gray level of each pixel in the image, which can be 0 to 255 levels; the ordinate is the gray level. The number or probability of occurrence of each pixel in the upper image; the peak of the histogram is concentrated at the low end, the image is darker, and the image is brighter; the peak of the histogram is concentrated in a certain area, the image is dim, and the object and background are different in the image. For large images, the histogram has a bimodal characteristic; the more uniform the histogram distribution, the better the image contrast; for the same image, if the contrast is reduced, the histogram distribution will be concentrated; the histogram shown in Figure 2(a) The picture shows a histogram of the original image. It can be seen that the pixel distribution on each gray scale is more uniform in the histogram. Figure 2(b) is the histogram of the image after the lens is covered by foreign objects. You can see the gray in the histogram. The pixel distribution is more concentrated, indicating that the contrast of Figure 2(b) is lower; by comparing the histograms of the first image and the second image, if the pixel distribution on each gray scale is found on one of the histograms If the concentration is relatively concentrated, it can be judged that the contrast of the image is low, and the corresponding image of the camera may have foreign object coverage; here, a contrast difference threshold may be set, when the difference between the histogram of the first image and the second image exceeds the contrast difference At the threshold, it is determined that there may be foreign matter coverage on the lens corresponding to one of the images, and the user is prompted; here, the contrast difference may be a difference in the uniformity of the distribution of the histogram; due to differences in the position of the dual camera and the individual performance of the camera, The image contrast of the first image and the second image captured by the two cameras cannot be completely consistent, and the difference between the first image and the second image captured under ideal conditions can be counted, such as 1% to 3 %; this difference range may not be achieved in actual shooting, so if the contrast is close to ideal conditions The difference is 1% to 3%, and a difference value of 3% to 5% can be selected as the preset contrast difference threshold.
采用上述三种图像质量的对比方法中的一种或多种,可以确定是否双摄像头中的一个摄像头图像质量是否下降,如果下降则表明摄像头上存在的遮挡或异物覆盖需要清理。Using one or more of the above three image quality comparison methods, it can be determined whether the image quality of one of the dual cameras is degraded, and if it is lowered, it indicates that the occlusion or foreign object coverage existing on the camera needs to be cleaned.
本发明实施例提供的成像差异检测装置,如图3所示,所述装置包括:获取模块31、对比模块32;其中,The imaging difference detecting device provided by the embodiment of the present invention, as shown in FIG. 3, the device includes: an obtaining module 31 and a comparing module 32;
所述获取模块31,用于获取第一摄像装置拍摄的第一图像,和第二摄像装置拍摄的第二图像;The acquiring module 31 is configured to acquire a first image captured by the first camera device and a second image captured by the second camera device;
这里,所述第一摄像装置和第二摄像装置可以是双摄像头终端位于同侧的两个摄像头,如位于终端背部的双摄像头;可以分别获取所述第一摄像装置和第二摄像装置在同一时间拍摄的第一图像和第二图像;Here, the first camera device and the second camera device may be two cameras on the same side of the dual camera terminal, such as a dual camera located at the back of the terminal; the first camera device and the second camera device may be respectively acquired in the same a first image and a second image taken at time;
进一步的,由于通常双摄像头被设置成一个对近处对焦,一个对远处对焦,两个摄像头拍摄的图像在景深上会有较大差异,不利于对比;因此,可以设置一个检测模式,在检测模式下同步两个摄像头的焦距,使两个摄像头采用统一焦距拍摄所述第一图像和第二图像,确保第一图像和第二图像焦距一致,这样,在可以避免在后续对比中不会应为景深的差异而引起比较结果的偏差;这个检测模式可以根据需求加在用户拍摄照片前的阶段,避免影响用户正常拍摄;也可以采用在正常拍摄过程中,两个摄像头的焦距差落在预先设定的焦距差范围内时拍摄的所述第一图像和第二图像。Further, since the dual camera is usually set to focus on a near focus and a focus on a distance, the images captured by the two cameras may have a large difference in depth of field, which is not conducive to comparison; therefore, a detection mode can be set in Synchronizing the focal lengths of the two cameras in the detection mode, so that the two cameras take the first image and the second image with a uniform focal length, ensuring that the focal lengths of the first image and the second image are consistent, so that it can be avoided in subsequent comparisons. The deviation of the comparison result should be caused by the difference of depth of field; this detection mode can be added to the stage before the user takes the photo according to the demand, to avoid affecting the normal shooting of the user; or in the normal shooting process, the focal length difference between the two cameras falls The first image and the second image captured when a preset focal length difference is within a range.
所述对比模块32,用于对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示;The comparison module 32 is configured to compare image quality differences between the first image and the second image, and generate and issue a prompt when the image quality difference exceeds a preset threshold;
这里,可以采用三种方法来检测摄像头是否存在的遮挡或异物覆盖,可以采用其中的一种或采用其组合来对比所述第一图像和第二图像的成像质量差异,进而判断镜头是否存在的遮挡或异物覆盖;其中,所述成像质量差异可以是图像内容的差异,也可以是图像中被摄物边缘清晰度的差异, 还可以是图像对比度的差异。Here, three methods may be used to detect whether the camera has occlusion or foreign object coverage, and one of them may be used or a combination thereof may be used to compare the difference in imaging quality between the first image and the second image to determine whether the lens exists. Occlusion or foreign object coverage; wherein the difference in imaging quality may be a difference in image content or a difference in sharpness of a subject edge in the image, It can also be the difference in image contrast.
方法1:图像内容对比;Method 1: Comparison of image content;
通常,如果在双摄像头终端的一个摄像头镜头被手指等遮蔽的情况下,两个摄像头所拍摄的图像内容会有差异,因此,可以通过对比图像内容的方法来进行检测;具体的,可以将拍摄的第一图像和第二图像分别划分一个以上的区块,对比两个图像对应位置的区块内容。进一步的,由于大面积的遮蔽可以通过曝光差别进行检测,区块内容的对比可以主要用于对小面积的遮蔽进行检测;小面积的遮蔽通常主要位于图像的边角位置,可以从边角区块开始对比,如此,可以尽量减小计算量。如果计算发现区块内容的差异超过预设的内容差异阈值,则认为当前第一图像和第二图像不一致,其中的一个摄像头可能有遮蔽,可以提示用户摄像头镜头有遮蔽情况。Generally, if a camera lens of a dual camera terminal is blocked by a finger or the like, the image content captured by the two cameras may be different, and therefore, the image content may be detected by comparing the image content; specifically, the image may be captured. The first image and the second image are respectively divided into more than one block, and the block contents corresponding to the positions of the two images are compared. Further, since the large-area occlusion can be detected by the difference in exposure, the comparison of the block contents can be mainly used for detecting the small-area occlusion; the small-area occlusion is usually mainly located at the corner position of the image, and can be from the corner area. The block starts to contrast, so you can minimize the amount of calculation. If the calculation finds that the difference of the block content exceeds the preset content difference threshold, it is considered that the current first image and the second image are inconsistent, and one of the cameras may have a shadow, which may prompt the user that the camera lens has a shadow condition.
实际应用中,可以采用现有的一些算法如:SIM算法等,对图像区块内容进行图像相似度比较,并设定一个预设内容差异阈值,当差异值超出所述预设内容差异阈值时,向用户发送提示;由于双摄像头位置、摄像头个体性能等差异,两个摄像头拍摄的所述第一图像和第二图像的图像内容无法做到完全一致,可以统计接近理想状况下拍摄的所述第一图像和第二图像的图像内容差异;实际拍摄中可能达不到这个差异范围,因此,如果接近理想状况下图像内容差异为1%~3%,则可以选定3%~5%的差异值作为预设内容差异阈值。In practical applications, some existing algorithms, such as a SIM algorithm, may be used to compare the image similarity of the image block content, and set a preset content difference threshold, when the difference value exceeds the preset content difference threshold. Sending a prompt to the user; due to the difference in the position of the dual camera, the performance of the individual camera, etc., the image content of the first image and the second image captured by the two cameras cannot be completely consistent, and the statistically close to the ideal situation can be counted. The difference between the image content of the first image and the second image; this difference range may not be achieved in actual shooting. Therefore, if the image content difference is 1% to 3% under ideal conditions, 3% to 5% may be selected. The difference value is used as a preset content difference threshold.
方法2:图像被摄物的边缘清晰度对比;Method 2: contrasting the edge definition of the image subject;
通常,如果在镜头有异物覆盖的情况下,拍摄的图像中被摄物清晰度会有明显下降,因此,可以对比第一图像和第二图像中相同被摄物的清晰度来检测是否有异物覆盖在镜头上;进一步的,在镜头有异物覆盖的情况下,被摄物的边缘清晰度下降最为明显,因此,可以优选对比第一图像和第二图像中相同被摄物的边缘清晰度。 Generally, if there is a foreign object covering the lens, the sharpness of the subject in the captured image will be significantly reduced. Therefore, the sharpness of the same subject in the first image and the second image can be compared to detect whether there is a foreign object. Covering the lens; further, in the case where the lens has foreign matter coverage, the edge sharpness of the subject is most significantly reduced, and therefore, it is preferable to compare the edge sharpness of the same subject in the first image and the second image.
实际应用中,可以采用一些现有的图像物体边缘检测算法如:基于Sobel边缘检测算法等,来确定所述被摄物的边缘;并通过边缘清晰度评价方法比较两幅图像边缘清晰度;其中,清晰度评价方法可以采用边缘梯度检测法中的Laplace图像清晰度算法等。通过设定一个预设清晰度差异阈值,当第一图像和第二图像的边缘清晰度比较差异超出所述预设清晰度差异阈值时,向用户发送提示,提示用户可能镜头上有异物覆盖;由于双摄像头位置、摄像头个体性能等差异,两个摄像头拍摄的所述第一图像和第二图像无法做到边缘清晰度完全一致,可以统计接近理想状况下拍摄的所述第一图像和第二图像的边缘清晰度的差异;实际拍摄中可能达不到这个差异范围,因此,如果接近理想状况下边缘清晰度的差异为1%~3%,则可以选定3%~5%的差异值作为预设清晰度差异阈值。In practical applications, some existing image object edge detection algorithms such as Sobel edge detection algorithm and the like may be used to determine the edge of the object; and the edge definition of the two images is compared by the edge sharpness evaluation method; The resolution evaluation method may use a Laplace image sharpness algorithm in the edge gradient detection method or the like. By setting a preset sharpness difference threshold, when the edge sharpness comparison difference between the first image and the second image exceeds the preset sharpness difference threshold, a prompt is sent to the user, prompting the user that there may be foreign object coverage on the lens; Due to the difference of the dual camera position, the individual performance of the camera, etc., the first image and the second image captured by the two cameras cannot achieve the same edge definition, and the first image and the second image taken under ideal conditions can be counted. The difference in edge definition of the image; this difference range may not be achieved in actual shooting. Therefore, if the difference in edge sharpness is 1% to 3% under ideal conditions, a difference value of 3% to 5% can be selected. As a preset clarity difference threshold.
方法3:图像对比度对比;Method 3: Image contrast contrast;
通常,如果在镜头有异物覆盖的情况下,由于异物对光线的遮挡作用,会使得图像对比度明显下降,这种变化会直接体现在所述第一图像和第二图像的直方图上,可以通过比较直方图,来判断是否其中一个有异物覆盖并给出用户提示。Generally, if there is foreign matter covering the lens, the contrast of the image will be significantly reduced due to the blocking effect of the foreign matter on the light. This change will be directly reflected on the histogram of the first image and the second image. Compare the histograms to determine if one of them has a foreign object and gives a user prompt.
具体的,可以采用灰度直方图来衡量图像对比度;直方图是一个二维图,横坐标表示图像中各个像素点的灰度级,可以采用0到255个级别;纵坐标为各个灰度级上图像各个像素点出现的次数或概率;直方图的峰值集中在低端,则图像较暗,反之,图像较亮;直方图的峰值集中在某个区域,图像昏暗;图像中物体和背景差别很大的图像,其直方图具有双峰特性;直方图分布越均匀,图像对比度越好;对于同一副图像,如果对比度下降,则直方图分布会集中;如图2(a)所示的直方图为一张原始图像的直方图,可以看到直方图中各灰度上像素分布较为均匀,如图2(b)为镜头被异物覆盖后图像的直方图,可以看到直方图中各灰度上像素分布较为 集中,表明图2(b)的对比度较低;通过对比第一图像和第二图像的直方图,如果发现其中一张直方图上各灰度上像素分布较为集中,则可以判断该图像对比度较低,该图像对应的摄像装置镜头上可能有异物覆盖;这里可以设置一个对比度差异阈值,当第一图像和第二图像的直方图差异超出所述对比度差异阈值时,确定其中一张图像对应的镜头上可能有异物覆盖,向用户发出提示;这里,所述对比度差异可以是直方图的分布均匀程度的差异;由于双摄像头位置、摄像头个体性能等差异,两个摄像头拍摄的所述第一图像和第二图像的图像对比度无法做到对比度完全一致,可以统计接近理想状况下拍摄的所述第一图像和第二图像对比度的差异,如1%~3%;实际拍摄中可能达不到这个差异范围,因此,如果接近理想状况下对比度的差异为1%~3%,则可以选定3%~5%的差异值作为预设对比度差异阈值。Specifically, the gray histogram can be used to measure the image contrast; the histogram is a two-dimensional map, and the abscissa indicates the gray level of each pixel in the image, which can be 0 to 255 levels; the ordinate is the gray level. The number or probability of occurrence of each pixel of the upper image; the peak of the histogram is concentrated at the low end, the image is darker, and the image is brighter; the peak of the histogram is concentrated in a certain area, the image is dim; the difference between the object and the background in the image For large images, the histogram has a bimodal characteristic; the more uniform the histogram distribution, the better the image contrast; for the same image, if the contrast is reduced, the histogram distribution will be concentrated; the histogram shown in Figure 2(a) The picture shows a histogram of the original image. It can be seen that the pixel distribution on each gray scale is more uniform in the histogram. Figure 2(b) is the histogram of the image after the lens is covered by foreign objects. You can see the gray in the histogram. Pixel distribution Concentration, indicating that the contrast of Figure 2(b) is low; by comparing the histograms of the first image and the second image, if the pixel distribution on each gray scale on one of the histograms is found to be concentrated, it can be judged that the contrast of the image is relatively Low, the image corresponding to the camera may have foreign object coverage; here a contrast difference threshold may be set, and when the histogram difference between the first image and the second image exceeds the contrast difference threshold, determine one of the images corresponding to There may be foreign matter covering on the lens, and the user is prompted; here, the contrast difference may be a difference in the degree of uniformity of the histogram distribution; the first image taken by the two cameras due to the difference in the position of the dual camera, the individual performance of the camera, and the like The contrast of the image with the second image cannot be completely consistent, and the difference between the contrast of the first image and the second image taken under ideal conditions can be counted, such as 1% to 3%; this may not be achieved in actual shooting. The range of difference, therefore, if the difference in contrast under ideal conditions is 1% to 3%, then Set the difference value of 3% to 5% of a predetermined contrast difference threshold.
采用上述三种图像质量的对比方法中的一种或多种,可以确定是否双摄像头中的一个摄像头图像质量是否下降,如果下降则表明摄像头上存在的遮挡或异物覆盖需要清理。Using one or more of the above three image quality comparison methods, it can be determined whether the image quality of one of the dual cameras is degraded, and if it is lowered, it indicates that the occlusion or foreign object coverage existing on the camera needs to be cleaned.
在实际应用中,所述获取模块31可以由终端的摄像装置结合中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)、或现场可编程门阵列(FPGA)等实现;所述对比模块32均可以由终端的CPU、MPU、DSP、或FPGA等实现。In an actual application, the acquiring module 31 can be implemented by a camera device of the terminal in combination with a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA). The comparison module 32 can be implemented by a CPU, an MPU, a DSP, an FPGA, or the like of the terminal.
以上所述,仅为本发明的最佳实施例而已,并非用于限定本发明的保护范围,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included. Within the scope of protection of the present invention.
本发明实施例还提供了一种计算机存储介质,该存储介质包括一组指令,当执行所述指令时,引起至少一个处理器执行包括以下的操作:Embodiments of the present invention also provide a computer storage medium, the storage medium comprising a set of instructions that, when executed, cause at least one processor to perform operations including:
分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;Acquiring the first image and the second image captured by the first camera device and the second camera device respectively;
对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差 异超出预设阈值时,生成并发出提示。Comparing the difference in imaging quality between the first image and the second image, when the image quality is poor Generate and issue a prompt when the preset threshold is exceeded.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
本发明实施例公开了成像差异检测方法、装置及计算机存储介质,分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;对比所 述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,向用户发出提示。如此,通过检测两个摄像装置成像的差异,能有效识别摄像头上存在的遮挡和异物覆盖,提醒用户清理,从而减小两个摄像头成像差异,提高双摄像头成像质量。 The embodiment of the invention discloses an imaging difference detecting method, a device and a computer storage medium, respectively acquiring a first image and a second image captured by the first camera device and the second camera device; The difference in imaging quality between the first image and the second image is issued to the user when the difference in imaging quality exceeds a preset threshold. In this way, by detecting the difference between the imaging of the two camera devices, the occlusion and foreign object coverage existing on the camera can be effectively recognized, and the user is prompted to clear, thereby reducing the imaging difference between the two cameras and improving the imaging quality of the dual camera.

Claims (12)

  1. 一种成像差异检测方法,所述方法包括:An imaging difference detecting method, the method comprising:
    分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像;Acquiring the first image and the second image captured by the first camera device and the second camera device respectively;
    对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示。Comparing the difference in imaging quality between the first image and the second image, when the difference in imaging quality exceeds a preset threshold, a prompt is generated and issued.
  2. 根据权利要求1所述的方法,其中,所述对比所述第一图像和第二图像的成像质量差异,包括:The method of claim 1, wherein comparing the difference in imaging quality between the first image and the second image comprises:
    对比所述第一图像和第二图像的图像内容、和/或图像清晰度、和/或图像对比度的差异。The difference in image content, and/or image sharpness, and/or image contrast of the first and second images is compared.
  3. 根据权利要求2所述的方法,其中,所述对比所述第一图像和第二图像的图像内容的差异,包括:The method of claim 2, wherein comparing the difference in image content of the first image and the second image comprises:
    将所述第一图像和第二图像分成一个以上的区块,对比所述第一图像和第二图像的对应位置区块的图像内容的差异。The first image and the second image are divided into more than one block, and the difference in image content of the corresponding position block of the first image and the second image is compared.
  4. 根据权利要求3所述的方法,其中,所述对比所述第一图像和第二图像的对应位置区块的图像内容的差异,包括:The method of claim 3, wherein comparing the difference in image content of the corresponding location block of the first image and the second image comprises:
    对比所述第一图像和第二图像边角区域相同位置区块的图像内容的差异。Comparing the difference in image content of the same location block of the first image and the second image corner region.
  5. 根据权利要求2所述的方法,其中,所述对比所述第一图像和第二图像的图像清晰度的差异,包括:对比所述第一图像和第二图像中被摄物的边缘清晰度的差异。The method of claim 2, wherein comparing the difference in image sharpness of the first image and the second image comprises comparing edge definition of a subject in the first image and the second image The difference.
  6. 根据权利要求5所述的方法,其中,所述对比所述第一图像和第二图像中被摄物的边缘清晰度的差异,包括:The method according to claim 5, wherein said comparing a difference in edge definition of a subject in said first image and said second image comprises:
    采用索贝尔Sobel边缘检测算法,检测所述第一图像和第二图像中被摄物的边缘;Detecting edges of the object in the first image and the second image by using a Sobel Sobel edge detection algorithm;
    对比所述第一图像和第二图像中被摄物对应位置边缘的清晰度的差 异。Comparing the difference in sharpness of the edge of the corresponding position of the object in the first image and the second image different.
  7. 根据权利要求2所述的方法,其中,所述对比所述第一图像和第二图像的图像对比度的差异,包括:采用直方图对比所述第一图像和第二图像的对比度的差异。The method of claim 2, wherein comparing the difference in image contrast of the first image and the second image comprises comparing a difference in contrast of the first image and the second image using a histogram.
  8. 根据权利要求1至7任一项所述的方法,其中,所述分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像,包括:获取所述第一摄像装置和第二摄像装置在预设焦距上拍摄的所述第一图像和第二图像,或获取所述第一摄像装置和所述第二摄像装置拍摄的预设焦距差异范围内的所述第一图像和第二图像。The method according to any one of claims 1 to 7, wherein the acquiring the first image and the second image captured by the first camera device and the second camera device respectively comprises: acquiring the first camera device and The first image and the second image captured by the second camera device on a preset focal length, or the first image and the preset focal length difference range captured by the first camera device and the second camera device Second image.
  9. 一种成像差异检测装置,所述装置包括:获取模块、对比模块;其中,An imaging difference detecting device, the device comprising: an acquiring module and a comparing module; wherein
    所述获取模块,配置为获取第一摄像装置拍摄的第一图像,和第二摄像装置拍摄的第二图像;The acquiring module is configured to acquire a first image captured by the first camera device and a second image captured by the second camera device;
    所述对比模块,配置为对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示。The comparison module is configured to compare an imaging quality difference between the first image and the second image, and generate and issue a prompt when the imaging quality difference exceeds a preset threshold.
  10. 根据权利要求9所述的装置,其中,所述对比模块,配置为对比所述第一图像和第二图像的图像内容、和/或图像清晰度、和/或图像对比度的差异。The apparatus of claim 9, wherein the contrast module is configured to compare image content of the first and second images, and/or image sharpness, and/or contrast of image contrast.
  11. 根据权利要求9或10所述的装置,其中,所述获取模块,配置为获取所述第一摄像装置和第二摄像装置在预设焦距上拍摄的所述第一图像和第二图像,或获取所述第一摄像装置和所述第二摄像装置拍摄的预设焦距差异范围内的所述第一图像和第二图像。The apparatus according to claim 9 or 10, wherein the acquisition module is configured to acquire the first image and the second image captured by the first camera device and the second camera device at a preset focal length, or Acquiring the first image and the second image within a preset focal length difference range captured by the first camera device and the second camera device.
  12. 一种计算机存储介质,该存储介质包括一组指令,当执行所述指令时,引起至少一个处理器执行包括以下的操作:A computer storage medium comprising a set of instructions that, when executed, cause at least one processor to perform operations comprising:
    分别获取第一摄像装置和第二摄像装置拍摄的第一图像和第二图像; Acquiring the first image and the second image captured by the first camera device and the second camera device respectively;
    对比所述第一图像和第二图像的成像质量差异,当所述的成像质量差异超出预设阈值时,生成并发出提示。 Comparing the difference in imaging quality between the first image and the second image, when the difference in imaging quality exceeds a preset threshold, a prompt is generated and issued.
PCT/CN2016/105783 2016-06-03 2016-11-14 Method and device for detecting imaging difference, and computer storage medium WO2017206444A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610392599.7 2016-06-03
CN201610392599.7A CN107465912A (en) 2016-06-03 2016-06-03 A kind of imaging difference detection method and device

Publications (1)

Publication Number Publication Date
WO2017206444A1 true WO2017206444A1 (en) 2017-12-07

Family

ID=60479678

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/105783 WO2017206444A1 (en) 2016-06-03 2016-11-14 Method and device for detecting imaging difference, and computer storage medium

Country Status (2)

Country Link
CN (1) CN107465912A (en)
WO (1) WO2017206444A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109741377A (en) * 2018-11-30 2019-05-10 四川译讯信息科技有限公司 A kind of image difference detection method
WO2020030081A1 (en) * 2018-08-09 2020-02-13 Zhejiang Dahua Technology Co., Ltd. Method and system for selecting an image acquisition device
CN111080571A (en) * 2019-11-15 2020-04-28 北京迈格威科技有限公司 Camera shielding state detection method and device, terminal and storage medium
CN112351271A (en) * 2020-09-22 2021-02-09 北京迈格威科技有限公司 Camera shielding detection method and device, storage medium and electronic equipment
CN115314633A (en) * 2022-06-27 2022-11-08 中国科学院合肥物质科学研究院 Camera focusing method and device computer device and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109145A (en) * 2018-01-02 2018-06-01 中兴通讯股份有限公司 Picture quality detection method, device, storage medium and electronic device
CN108595003A (en) * 2018-04-23 2018-09-28 Oppo广东移动通信有限公司 Function control method and relevant device
CN111629204A (en) * 2020-06-30 2020-09-04 重庆盛泰光电有限公司 Data synchronization method for camera module detection
CN112529845A (en) * 2020-11-24 2021-03-19 浙江大华技术股份有限公司 Image quality value determination method, image quality value determination device, storage medium, and electronic device
CN112668636B (en) * 2020-12-25 2023-08-08 展讯通信(上海)有限公司 Camera shielding detection method and system, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779274A (en) * 2012-07-19 2012-11-14 冠捷显示科技(厦门)有限公司 Intelligent television face recognition method based on binocular camera
US20140333757A1 (en) * 2011-12-24 2014-11-13 Connaught Electronics Ltd. Method for operating a camera assembly, camera assembly and driver assistance system
KR101525516B1 (en) * 2014-03-20 2015-06-03 주식회사 이미지넥스트 Camera Image Processing System and Method for Processing Pollution of Camera Lens
CN104980646A (en) * 2014-03-19 2015-10-14 宏达国际电子股份有限公司 Blocking detection method and electronic apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542298A (en) * 2010-12-30 2012-07-04 富泰华工业(深圳)有限公司 Electronic device and image similarity degree comparison method thereof
CN103927729A (en) * 2013-01-10 2014-07-16 清华大学 Image processing method and image processing apparatus
KR20150057431A (en) * 2013-11-19 2015-05-28 삼성전자주식회사 Display device and control method thereof
US9154697B2 (en) * 2013-12-06 2015-10-06 Google Inc. Camera selection based on occlusion of field of view

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140333757A1 (en) * 2011-12-24 2014-11-13 Connaught Electronics Ltd. Method for operating a camera assembly, camera assembly and driver assistance system
CN102779274A (en) * 2012-07-19 2012-11-14 冠捷显示科技(厦门)有限公司 Intelligent television face recognition method based on binocular camera
CN104980646A (en) * 2014-03-19 2015-10-14 宏达国际电子股份有限公司 Blocking detection method and electronic apparatus
KR101525516B1 (en) * 2014-03-20 2015-06-03 주식회사 이미지넥스트 Camera Image Processing System and Method for Processing Pollution of Camera Lens

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020030081A1 (en) * 2018-08-09 2020-02-13 Zhejiang Dahua Technology Co., Ltd. Method and system for selecting an image acquisition device
US11195263B2 (en) 2018-08-09 2021-12-07 Zhejiang Dahua Technology Co., Ltd. Method and system for selecting an image acquisition device
CN109741377A (en) * 2018-11-30 2019-05-10 四川译讯信息科技有限公司 A kind of image difference detection method
CN111080571A (en) * 2019-11-15 2020-04-28 北京迈格威科技有限公司 Camera shielding state detection method and device, terminal and storage medium
CN111080571B (en) * 2019-11-15 2023-10-20 北京迈格威科技有限公司 Camera shielding state detection method, device, terminal and storage medium
CN112351271A (en) * 2020-09-22 2021-02-09 北京迈格威科技有限公司 Camera shielding detection method and device, storage medium and electronic equipment
CN115314633A (en) * 2022-06-27 2022-11-08 中国科学院合肥物质科学研究院 Camera focusing method and device computer device and storage medium
CN115314633B (en) * 2022-06-27 2023-06-16 中国科学院合肥物质科学研究院 Camera focusing method, camera focusing device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN107465912A (en) 2017-12-12

Similar Documents

Publication Publication Date Title
WO2017206444A1 (en) Method and device for detecting imaging difference, and computer storage medium
CN110121882B (en) Image processing method and device
US11102417B2 (en) Target object capturing method and device, and video monitoring device
US8416314B2 (en) Method and system for processing images
WO2019233264A1 (en) Image processing method, computer readable storage medium, and electronic device
JP6309111B2 (en) Method and apparatus for detecting imaging conditions
CN109829859B (en) Image processing method and terminal equipment
US20110280475A1 (en) Apparatus and method for generating bokeh effect in out-focusing photography
WO2014114223A1 (en) Scene recognition method and apparatus
CN110796600B (en) Image super-resolution reconstruction method, image super-resolution reconstruction device and electronic equipment
WO2006116744A1 (en) Method and apparatus for incorporating iris color in red-eye correction
JP2014057303A (en) System and method for utilizing enhanced scene detection in depth estimation procedure
JP5725194B2 (en) Night scene image blur detection system
CN107493407B (en) Photographing device and photographing method
WO2016074467A1 (en) Image processing method and device
CN111444555B (en) Temperature measurement information display method and device and terminal equipment
CN111080571B (en) Camera shielding state detection method, device, terminal and storage medium
CN112272292A (en) Projection correction method, apparatus and storage medium
US10972676B2 (en) Image processing method and electronic device capable of optimizing hdr image by using depth information
CN109068060B (en) Image processing method and device, terminal device and computer readable storage medium
US20090041377A1 (en) Method and system for defect image correction
US20220309627A1 (en) Face image straight line processing method, terminal device and storage medium
CN109753886B (en) Face image evaluation method, device and equipment
WO2019196240A1 (en) Photographing method, apparatus, computer device, and storage medium
US20190166299A1 (en) Image processing apparatus, control method thereof, and non-transitory computer-readable storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16903824

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16903824

Country of ref document: EP

Kind code of ref document: A1