camera contamination detection method and device, storage medium and electronic equipment

文档序号:1712109 发布日期:2019-12-13 浏览:25次 中文

阅读说明:本技术 摄像头脏污检测方法、装置、存储介质及电子设备 (camera contamination detection method and device, storage medium and electronic equipment ) 是由 姚坤 于 2019-07-23 设计创作,主要内容包括:本申请实施例提供一种摄像头脏污检测方法、装置、存储介质及电子设备,所述摄像头脏污检测方法包括:获取摄像头拍摄的至少两个图像;依次将每一所述图像转换为一维数据序列;将至少两个所述一维数据序列进行卷积运算,以得到脏污检测标志特征量;判断所述脏污检测标志特征量中是否存在大于预设阈值的数据元素;若所述脏污检测标志特征量中存在大于所述预设阈值的数据元素,则确定为所述摄像头出现脏污。所述摄像头脏污检测方法中,电子设备可以通过摄像头在不同场景中拍摄的图像来检测摄像头是否出现脏污,从而无需人为干预,也无需用户人为地对摄像头的脏污情况进行检测,可以实现智能化地实时检测摄像头的脏污情况。(the embodiment of the application provides a camera contamination detection method, a camera contamination detection device, a storage medium and electronic equipment, wherein the camera contamination detection method comprises the following steps: acquiring at least two images shot by a camera; sequentially converting each image into a one-dimensional data sequence; performing convolution operation on at least two one-dimensional data sequences to obtain a dirt detection mark characteristic quantity; judging whether data elements larger than a preset threshold exist in the characteristic quantity of the dirt detection mark; and if the data elements larger than the preset threshold exist in the dirt detection mark characteristic quantity, determining that the camera is dirty. In the camera contamination detection method, the electronic equipment can detect whether the camera is contaminated or not through images shot by the camera in different scenes, so that human intervention is not needed, a user does not need to manually detect the contamination condition of the camera, and the contamination condition of the camera can be intelligently detected in real time.)

1. a camera smudging detection method is characterized by comprising the following steps:

Acquiring at least two images shot by a camera, wherein each image is an image shot in different scenes;

Sequentially converting each image into a one-dimensional data sequence to remove the correlation among pixel points in each image;

performing convolution operation on at least two one-dimensional data sequences to obtain cross-correlation data sequences, and determining the cross-correlation data sequences as the characteristic quantity of the pollution detection mark;

Judging whether data elements larger than a preset threshold exist in the characteristic quantity of the dirt detection mark;

and if the data elements larger than the preset threshold exist in the dirt detection mark characteristic quantity, determining that the camera is dirty.

2. The method according to claim 1, wherein the number of the images is at least three, the number of the one-dimensional data sequences obtained by converting the at least three images is at least three, the convolving operation is performed on at least two of the one-dimensional data sequences to obtain a cross-correlation data sequence, and the cross-correlation data sequence is determined as a contamination detection flag feature quantity, and the method includes:

performing convolution operation on the two one-dimensional data sequences to obtain a cross-correlation data sequence, and determining the cross-correlation data sequence as a dirt detection mark characteristic quantity;

And performing convolution operation on one-dimensional data sequence out of the two one-dimensional data sequences and the dirt detection mark characteristic quantity in sequence to obtain a new cross-correlation data sequence, and updating the dirt detection mark characteristic quantity according to the new cross-correlation data sequence.

3. The camera contamination detection method according to claim 2, wherein the updating the contamination detection flag feature quantity according to the new cross-correlation data sequence includes:

calculating the new cross-correlation data sequence and the average data sequence of the dirty detection mark characteristic quantity;

And determining the average data sequence as the updated dirt detection mark characteristic quantity.

4. The method according to any one of claims 1 to 3, wherein, after determining that the camera is dirty if the data element greater than the preset threshold exists in the dirty detection flag feature amount, the method further comprises:

Reversely converting the characteristic quantity of the dirt detection mark to obtain a matrix image corresponding to the characteristic quantity of the dirt detection mark;

Determining a pixel point region where the data elements larger than the preset threshold value in the characteristic quantity of the contamination detection mark are located in the matrix image;

And determining the pixel point region as a dirty region of the camera.

5. The method as claimed in any one of claims 1 to 3, wherein said converting each of said images into a one-dimensional data sequence to remove correlation between pixels in each of said images comprises:

sequentially converting each image into a gray-scale image;

And sequentially carrying out zigzag scanning on each gray scale image to obtain a one-dimensional data sequence corresponding to each gray scale image so as to remove the correlation among pixel points in each image.

6. The utility model provides a dirty detection device of camera which characterized in that includes:

The device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring at least two images shot by a camera, and each image is shot in different scenes;

The image conversion module is used for sequentially converting each image into a one-dimensional data sequence so as to remove the correlation among pixel points in each image;

the operation module is used for performing convolution operation on at least two one-dimensional data sequences to obtain cross-correlation data sequences and determining the cross-correlation data sequences as the characteristic quantity of the pollution detection mark;

And the detection module is used for judging whether data elements larger than a preset threshold exist in the dirt detection mark characteristic quantity, and if the data elements larger than the preset threshold exist in the dirt detection mark characteristic quantity, determining that the camera is dirty.

7. The camera contamination detection apparatus according to claim 6, wherein the number of the images is at least three, the number of the one-dimensional data sequences obtained by converting at least three of the images is at least three, and the operation module is configured to:

Performing convolution operation on the two one-dimensional data sequences to obtain a cross-correlation data sequence, and determining the cross-correlation data sequence as a dirt detection mark characteristic quantity;

and performing convolution operation on one-dimensional data sequence out of the two one-dimensional data sequences and the dirt detection mark characteristic quantity in sequence to obtain a new cross-correlation data sequence, and updating the dirt detection mark characteristic quantity according to the new cross-correlation data sequence.

8. The camera contamination detection apparatus according to claim 7, wherein when the contamination detection flag feature amount is updated according to the new cross-correlation data sequence, the operation module is configured to:

Calculating the new cross-correlation data sequence and the average data sequence of the dirty detection mark characteristic quantity;

And determining the average data sequence as the updated dirt detection mark characteristic quantity.

9. The camera contamination detection apparatus according to any one of claims 6 to 8, wherein the image conversion module is further configured to:

When the camera is determined to be dirty, reversely converting the dirty detection mark characteristic quantity to obtain a matrix image corresponding to the dirty detection mark characteristic quantity;

The detection module is further configured to:

Determining a pixel point region where the data elements larger than the preset threshold value in the characteristic quantity of the contamination detection mark are located in the matrix image;

and determining the pixel point region as a dirty region of the camera.

10. The camera contamination detection apparatus according to any one of claims 6 to 8, wherein the image conversion module is configured to:

Sequentially converting each image into a gray-scale image;

And sequentially carrying out zigzag scanning on each gray scale image to obtain a one-dimensional data sequence corresponding to each gray scale image so as to remove the correlation among pixel points in each image.

11. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the camera contamination detection method according to any one of claims 1 to 5.

12. An electronic device, characterized in that the electronic device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used for executing the camera contamination detection method according to any one of claims 1 to 5 by calling the computer program stored in the memory.

Technical Field

The present disclosure relates to the field of electronic technologies, and in particular, to a method and an apparatus for detecting contamination of a camera, a storage medium, and an electronic device.

background

With the development of electronic technology, electronic devices such as smart phones have become more and more rich in functions. Among them, the photographing function has become one of the most commonly used functions in electronic devices.

Electronic devices are often provided with one or more cameras, such as a front camera, a rear dual camera, even a rear quad camera, and so on. During the use of the electronic device by the user, the camera may be dirty. For example, water droplets, dust, dirt, and the like may be attached to the camera. When the camera is dirty, the user is difficult to find the dirty camera in time, so that the quality of the shot picture is affected.

Disclosure of Invention

the embodiment of the application provides a method and a device for detecting the fouling of a camera, a storage medium and electronic equipment, which can intelligently detect the fouling condition of the camera in real time.

the embodiment of the application provides a method for detecting fouling of a camera, which comprises the following steps:

acquiring at least two images shot by a camera, wherein each image is an image shot in different scenes;

Sequentially converting each image into a one-dimensional data sequence to remove the correlation among pixel points in each image;

Performing convolution operation on at least two one-dimensional data sequences to obtain cross-correlation data sequences, and determining the cross-correlation data sequences as the characteristic quantity of the pollution detection mark;

Judging whether data elements larger than a preset threshold exist in the characteristic quantity of the dirt detection mark;

And if the data elements larger than the preset threshold exist in the dirt detection mark characteristic quantity, determining that the camera is dirty.

The embodiment of the present application further provides a dirty detection device of camera, include:

the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring at least two images shot by a camera, and each image is shot in different scenes;

The image conversion module is used for sequentially converting each image into a one-dimensional data sequence so as to remove the correlation among pixel points in each image;

The operation module is used for performing convolution operation on at least two one-dimensional data sequences to obtain cross-correlation data sequences and determining the cross-correlation data sequences as the characteristic quantity of the pollution detection mark;

and the detection module is used for judging whether data elements larger than a preset threshold exist in the dirt detection mark characteristic quantity, and if the data elements larger than the preset threshold exist in the dirt detection mark characteristic quantity, determining that the camera is dirty.

an embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer is caused to execute the above method for detecting contamination of a camera.

the embodiment of the application further provides an electronic device, which comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is used for executing the camera contamination detection method by calling the computer program stored in the memory.

according to the method for detecting the fouling of the camera, the electronic equipment can carry out convolution operation on the one-dimensional data sequences corresponding to the images shot by the camera in different scenes, and detects whether the fouling occurs in the camera according to the fouling detection mark characteristic quantity obtained by the convolution operation, so that human intervention is not needed, a user does not need to manually detect the fouling condition of the camera, and the intelligent real-time detection of the fouling condition of the camera can be realized.

Drawings

in order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.

Fig. 1 is a schematic view of an application scenario of a method for detecting contamination in a camera according to an embodiment of the present application.

fig. 2 is a schematic flow chart of a method for detecting contamination of a camera according to an embodiment of the present application.

Fig. 3 is another schematic flow chart of a method for detecting contamination in a camera according to an embodiment of the present disclosure.

Fig. 4 is a schematic diagram of image conversion in the camera contamination detection method according to the embodiment of the present application.

Fig. 5 is a schematic view of zigzag scanning in the method for detecting contamination in a camera according to the embodiment of the present application.

Fig. 6 is a schematic structural diagram of a camera contamination detection apparatus according to an embodiment of the present application.

Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

fig. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present application.

referring to fig. 1, fig. 1 is a schematic view of an application scenario of a method for detecting contamination in a camera according to an embodiment of the present application.

In the process of using the electronic equipment, a user can often take pictures through a camera of the electronic equipment, so that a plurality of pictures can be taken in the scenes. For example, a home, a company, various tourist attractions, animals, plants, buildings, etc. may be the scene being photographed.

in the method for detecting the fouling of the camera provided by the embodiment of the application, images shot by the camera in different scenes are firstly acquired, for example, an image of a first scene and an image of a second scene are acquired. And then, performing convolution operation on the data corresponding to the image of the first scene and the data corresponding to the image of the second scene to obtain the dirt detection mark characteristic quantity of the camera. The dirt detection mark characteristic quantity can represent the dirt degree of the camera. And then, carrying out threshold judgment between the characteristic quantity of the dirt detection mark and a preset threshold value to obtain a dirt detection result of the camera.

the camera contamination detection method provided by the embodiment of the application does not need human intervention of a user, and can intelligently and automatically detect the contamination of the camera in the whole process that the user uses the electronic equipment. Therefore, when the camera is dirty, the dirty condition of the camera can be detected in time, the user is reminded, the user can clean the camera in time, and the quality of the shot picture is guaranteed.

The camera contamination detection method provided by the embodiment of the application can be applied to electronic equipment. The electronic device may be a smartphone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a video playback device, a laptop computer, a desktop computing device, a wearable device such as an electronic helmet, an electronic garment, or the like.

Referring to fig. 2, fig. 2 is a schematic flowchart of a method for detecting contamination of a camera according to an embodiment of the present disclosure. The camera fouling detection method comprises the following steps:

and 110, acquiring at least two images shot by the camera, wherein each image is an image shot in different scenes.

First, the electronic device may acquire at least two images taken by the camera. Wherein each of the images is an image taken in a different scene. For example, one of the images may be an image taken at sea and the other image may be an image taken at a park.

It can be understood that the similarity between a plurality of images photographed in the same scene is relatively high. For example, two images taken in the same seaside scene have a relatively high similarity between the two images. And the similarity between images taken in different scenes is relatively low. For example, the degree of similarity between an image taken at sea and an image taken at a park is low, or it can be considered that there is little similarity between the two images.

it should be noted that the at least two images may be acquired by the electronic device at the same time after the shooting by the camera is completed and stored in the electronic device. The at least two images may also be acquired by the electronic device at different times. For example, the electronic device may intelligently recognize a scene shot by a camera, and each time the camera finishes shooting in one scene, the electronic device may acquire one image from a plurality of images shot in the scene as an image of the scene.

For example, in a travel of a user, after the user takes a plurality of images at an entrance of a park, the electronic device may obtain one image from the images as an image of the entrance of the park; then, after the user takes a plurality of images at the lake side in the park, the electronic device can acquire one image from the images as the image at the lake side in the park; subsequently, when the user takes a plurality of images on a mountain in the park, the electronic device may acquire one image therefrom as an image on the park mountain.

And 120, sequentially converting each image into a one-dimensional data sequence to remove the correlation among the pixel points in each image.

it should be noted that, in the embodiment of the present application, the electronic device detects the contamination of the camera by the similarity of each pixel point of the multiple images of the different scenes. Regardless of the scene in which the image is shot, the pixel points of the image have certain relevance. The relevance between the pixel points of the image is specifically expressed as follows: the pixel value of each pixel is always approximately similar to the pixel values of the surrounding pixels, or is understood to have little change, so that each pixel has similarity with the surrounding pixels.

Therefore, in order to remove the correlation between the pixels in each of the images, each of the images may be sequentially converted into a one-dimensional data sequence. The one-dimensional data sequence is a data sequence representing image characteristics by a plurality of sequentially spaced data elements. Each data element in the one-dimensional data sequence may represent a pixel value of a pixel point in the image. For example, the one-dimensional data sequence may be the following data sequence: (122, 58, 190,......,77, 251, 15).

It can be understood that in an image shot by the camera, each pixel point is adjacent to a plurality of pixel points around the pixel point, so that strong correlation exists between each pixel point and the plurality of pixel points around the pixel point, and in the one-dimensional data sequence, each data element is only adjacent to two data elements on the left and right, and is not adjacent to other data elements except the two data elements on the left and right, that is, each data element does not have correlation with other data elements except the two data elements on the left and right, so that the correlation between each data element and other data elements can be greatly reduced, or the correlation between each data element and other data elements can be understood to be removed. Therefore, after the image is converted into the one-dimensional data sequence, the correlation among the pixel points in the image can be considered to be removed.

And 130, performing convolution operation on at least two one-dimensional data sequences to obtain a cross-correlation data sequence, and determining the cross-correlation data sequence as the characteristic quantity of the pollution detection mark.

After the electronic device converts each of the at least two images into a one-dimensional data sequence, the electronic device may perform convolution operation on the at least two one-dimensional data sequences obtained by the conversion to obtain a cross-correlation data sequence, and determine the cross-correlation data sequence as a contamination detection flag feature quantity.

wherein the characteristic quantity of the contamination detection flag is an operation result of the convolution operation. The characteristic quantity of the dirt detection mark is also a one-dimensional data sequence, and the characteristic quantity of the dirt detection mark also comprises a plurality of data elements. Each data element in the dirty detection flag feature quantity represents the correlation between pixel points at corresponding positions in the at least two images. The larger the value of the data element is, the higher the correlation between the pixel points at the corresponding positions in the at least two images is; the smaller the value of the data element is, the lower the correlation between the pixel points representing the corresponding positions in the at least two images is; and when the value of the data element is 0, indicating that the pixel points at the corresponding positions in the at least two images have no correlation.

It can be understood that, theoretically, in images shot in different scenes, there is no correlation between pixel points at corresponding positions in the two images. Therefore, when the camera is not dirty, the camera will not affect the pixel value of the pixel point in the captured image, and at this time, the dirty detection flag feature quantity should be the following data sequence or approach to the following data sequence: (0,0,0,......,0,0,0). That is, in the stain detection flag feature amount, the value of each data element is 0 or approaches 0.

in addition, it can be understood that, when the camera is dirty, the dirty spot on the camera may affect the pixel value of the pixel point at the corresponding position in the shot image, so that the pixel value of the pixel point cannot present the pixel value of the shot object but present the pixel value of the dirty spot. Therefore, in images taken in different scenes, pixel values at positions corresponding to dirty spots of the camera in the two images are similar, and thus correlation is shown between pixel points that should not have correlation in the two images. At this time, the value of a data element in the contamination detection flag feature amount, which represents the correlation between pixel values at the camera contamination point in the two images, is not 0, and may increase significantly.

And 140, judging whether the data elements larger than a preset threshold exist in the characteristic quantity of the contamination detection mark.

A preset threshold may be preset in the electronic device. The preset threshold value represents the minimum value of data elements used for representing the correlation between pixel values at the dirty point of the camera in the dirty detection mark characteristic quantity when the camera is dirty. The preset threshold may be set empirically or may be set based on experimentally measured data. For example, the preset threshold may be 80.

After the electronic device obtains the dirty detection flag feature quantity through convolution operation, each data element in the dirty detection flag feature quantity can be compared with the preset threshold value, so that whether a data element larger than the preset threshold value exists in the dirty detection flag feature quantity or not is judged.

if there is a data element in the dirty detection flag feature quantity that is greater than the preset threshold value, it indicates that the camera is dirty, and then step 150 is executed. If the data elements larger than the preset threshold value do not exist in the dirt detection mark characteristic quantity, the camera is indicated to be not dirty, and at the moment, the electronic equipment can terminate the process and perform the dirt detection of the camera again, or perform the detection again after a period of time.

It will be appreciated that the camera is soiled, meaning that the camera has been soiled and that the degree of soiling is sufficient to affect the quality of the images taken. The camera is not dirty, which means that the camera is not dirty to any degree; or the camera is dirty, but the dirty degree is light enough to affect the quality of the shot image, and the camera can be considered to be not dirty.

150, if there is a data element greater than the preset threshold in the dirty detection flag feature quantity, determining that the camera is dirty.

And if the data elements larger than the preset threshold exist in the dirt detection mark characteristic quantity, the electronic equipment determines that the camera is dirty. At this time, the electronic device may remind the user to clean the camera. The reminding mode can be various, for example, the reminding mode can be realized by displaying information on a display screen, preset audio can be played to generate a sound signal for reminding, a light-emitting device such as a light-emitting diode can be used for emitting light for reminding, or electronic equipment can be controlled to generate vibration for reminding, and the like.

According to the method for detecting the fouling of the camera, the electronic equipment can carry out convolution operation on the one-dimensional data sequences corresponding to the images shot by the camera in different scenes, and detects whether the fouling occurs in the camera according to the fouling detection mark characteristic quantity obtained by the convolution operation, so that human intervention is not needed, a user does not need to manually detect the fouling condition of the camera, and the intelligent real-time detection of the fouling condition of the camera can be realized.

Referring to fig. 3, fig. 3 is another schematic flow chart of a method for detecting contamination in a camera according to an embodiment of the present disclosure. It can be understood that, when the electronic device sequentially converts each of the images into a one-dimensional data sequence to remove the correlation between the pixel points in each of the images, the following steps may be performed, that is, step 120 may include the following steps:

121, sequentially converting each image into a gray scale image;

And 122, sequentially carrying out zigzag scanning on each gray scale image to obtain a one-dimensional data sequence corresponding to each gray scale image so as to remove the correlation among the pixel points in each image.

Meanwhile, referring to fig. 4, fig. 4 is a schematic diagram of image conversion in the camera contamination detection method provided in the embodiment of the present application. After the electronic equipment acquires the original images shot by the camera, gray level map conversion can be carried out, and each image is converted into a gray level map in sequence. And the gray-scale image expresses the pixel value of the pixel point at the corresponding position through each numerical value. The pixel value ranges from 0 to 255, 0 representing black and 255 representing white. The gray scale map can also be understood as a matrix.

The electronic device may then perform a one-dimensional data sequence conversion on the grayscale map, converting the grayscale map to a one-dimensional data sequence. The electronic device may perform zigzag scanning on each obtained grayscale image in sequence in a zigzag scanning manner to obtain a one-dimensional data sequence corresponding to each grayscale image, so as to remove correlation between pixels in each image. For example, the one-dimensional data sequence obtained after scanning may be: (60, 50, 50, 62,......,221, 230, 110, 255).

it should be noted that, after converting an original image into a grayscale image, the electronic device may also perform normalization processing on the grayscale image, map each pixel value to an integer value within a range of-127 to obtain a standard grayscale image, and then perform one-dimensional data sequence conversion on the standard grayscale image to obtain a one-dimensional data sequence.

Referring to fig. 5, fig. 5 is a schematic view of zigzag scanning in the method for detecting contamination in a camera according to the embodiment of the present application. The zigzag scanning is a scanning mode in which, in the process of scanning a gray image by the electronic equipment, the scanning direction is changed once after the scanning of a plurality of pixel points is completed, and the scanning path is zigzag until the scanning of all the pixel points is completed.

For example, to 4 x 4's matrix, electronic equipment can scan 2 pixel to the right earlier, scan 1 pixel down left again, scan 1 pixel down right again, scan 2 pixel up right again, scan 1 pixel down right again, scan 3 pixels down left again, scan 1 pixel down right again, scan 2 pixel up right again, scan 1 pixel down left again, scan 1 pixel down right again, scan 1 pixel down left again, scan 1 pixel down right last, accomplish the scanning of whole 16 pixels.

it should be noted that the zigzag scanning mode shown in fig. 5 is only an example, and the scanning mode in practical application is similar to that shown in fig. 5, but is not necessarily the same, and the specific scanning mode of zigzag scanning is not limited in the present application.

It is understood that the number of the images acquired by the electronic device may be at least three, and the one-dimensional data sequence obtained by converting at least three of the images is at least three. For example, the number of images may be 3, 4, 5, 100, and so on.

With reference to fig. 3, step 130, performing convolution operation on at least two one-dimensional data sequences to obtain a cross-correlation data sequence, and determining the cross-correlation data sequence as a dirty detection flag feature quantity, includes the following steps:

131, performing convolution operation on the two one-dimensional data sequences to obtain a cross-correlation data sequence, and determining the cross-correlation data sequence as a dirt detection mark characteristic quantity;

and 132, performing convolution operation on one-dimensional data sequence except the two one-dimensional data sequences and the dirt detection flag characteristic quantity in sequence to obtain a new cross-correlation data sequence, and updating the dirt detection flag characteristic quantity according to the new cross-correlation data sequence.

The electronic device may first perform convolution operation on the two one-dimensional data sequences to obtain a cross-correlation data sequence, and determine the cross-correlation data sequence as a contamination detection flag feature quantity. That is, the dirty detection flag feature quantity is obtained according to the convolution operation result of the two one-dimensional data sequences.

And then, the electronic equipment sequentially performs convolution operation on one-dimensional data sequence except the two one-dimensional data sequences and the dirt detection mark characteristic quantity to obtain a new cross-correlation data sequence, and updates the dirt detection mark characteristic quantity according to the new cross-correlation data sequence.

For example, the electronic device acquires A, B, C, D four images sequentially captured by the camera in four different scenes, and converts each image into a one-dimensional data sequence to obtain four one-dimensional data sequences a, b, c, and d. Subsequently, the electronic device may first perform convolution operation on the one-dimensional data sequences a and b to obtain a cross-correlation data sequence P1 of a and b, and determine the cross-correlation data sequence P1 as the contamination detection flag feature quantity Q1. And then, performing convolution operation on the one-dimensional data sequence c and the pollution detection mark characteristic quantity Q1 to obtain a new cross-correlation data sequence P2, and updating the pollution detection mark characteristic quantity Q1 according to P2 to obtain an updated pollution detection mark characteristic quantity Q2. And then, performing convolution operation on the one-dimensional data sequence d and the pollution detection flag characteristic quantity Q2 to obtain a new cross-correlation data sequence P3, and updating the pollution detection flag characteristic quantity Q2 according to P3 to obtain an updated pollution detection flag characteristic quantity Q3. The latest contamination detection flag feature Q3 is the contamination detection flag feature at the time of the threshold determination.

in some embodiments, when the electronic device updates the contamination detection flag feature quantity according to the new cross-correlation data sequence, the following steps may be performed:

calculating the new cross-correlation data sequence and the average data sequence of the dirty detection mark characteristic quantity;

And determining the average data sequence as the updated dirt detection mark characteristic quantity.

After the electronic device obtains a new cross-correlation data sequence through convolution operation, an average data sequence of the new cross-correlation data sequence and the dirty detection flag feature quantity can be calculated, and the average data sequence is determined as the updated dirty detection flag feature quantity.

For example, after the contamination detection flag feature quantity determined first in the electronic device is Q1 and a new cross-correlation data sequence P2 is obtained by a convolution operation, an average data sequence of P2 and Q1 may be calculated, and the calculated average data sequence may be determined as the updated contamination detection flag feature quantity Q2. Subsequently, after continuing to obtain a new cross-correlation data sequence P3 through convolution operation, an average data sequence of P3 and Q2 may be calculated, and the calculated average data sequence may be determined as the updated contamination detection flag feature quantity Q3. Therefore, the continuous updating of the characteristic quantity of the contamination detection mark can be realized in the using process of the electronic equipment.

It can be understood that, when the image shot by the camera is newer, that is, the shooting time of the image is shorter than the current time, the image can reflect the pollution condition of the camera. Therefore, a first weight k1 corresponding to the dirty detection flag feature quantity and a second weight k2 corresponding to the new cross-correlation data sequence can be preset in the electronic device, and the first weight k1 is smaller than the second weight k 2. For example, k1 may be 0.4 and k2 may be 0.6.

In the process of updating the contamination detection flag feature quantity by the electronic device, the first weight k1 and the second weight k2 are firstly obtained, and the contamination detection flag feature quantity is updated through the contamination detection flag feature quantity, a new cross-correlation data sequence, the first weight k1 and the second weight k2 to calculate and obtain a new contamination detection flag feature quantity.

For example, after the contamination detection flag feature quantity determined first in the electronic device is Q1 and a new cross-correlation data sequence P2 is obtained by convolution, a new contamination detection flag feature quantity Q2 ═ k1 ═ Q1+ k2 × P2 can be calculated. Subsequently, after a new cross-correlation data sequence P3 is obtained by the convolution operation, a new stain detection flag feature amount Q3 ═ k1 ═ Q2+ k2 ×, P3 may be calculated.

It can be understood that after the electronic equipment judges that the camera is dirty, the electronic equipment can also position the dirty area and remind the user of which area of the camera is dirty, so that the user can clean the dirty area of the camera.

Therefore, step 150, if there is a data element greater than the preset threshold in the contamination detection flag feature quantity, after determining that the camera is contaminated, may further include the following steps:

161, reversely converting the characteristic quantity of the contamination detection flag to obtain a matrix image corresponding to the characteristic quantity of the contamination detection flag;

162, determining a pixel point region where the data element larger than the preset threshold value in the dirt detection mark characteristic quantity is located in the matrix image;

163, determining the pixel point region as a dirty region of the camera.

since the characteristic quantity of the contamination detection flag is a one-dimensional data sequence, and the one-dimensional data sequence is obtained by scanning each numerical value of the matrix, the electronic device may perform inverse conversion on the characteristic quantity of the contamination detection flag to obtain a matrix image corresponding to the characteristic quantity of the contamination detection flag.

And the reverse conversion is a scanning mode opposite to the one-dimensional data sequence obtained by the electronic equipment through one-dimensional data sequence conversion according to the image shot by the camera. For example, when the electronic device performs zigzag scanning on the gray scale map to obtain a one-dimensional data sequence corresponding to the gray scale map, the electronic device may perform inverse zigzag scanning on the contamination detection flag feature quantity to obtain a matrix image corresponding to the contamination detection flag feature quantity. The inverse zigzag scanning is a scanning mode opposite to the scanning path of the zigzag scanning.

And then, the electronic equipment determines a pixel point region where the data element larger than the preset threshold value in the characteristic quantity of the contamination detection mark is located in the matrix image, and determines the pixel point region as the contamination region of the camera.

For example, if the contamination detection flag feature quantity obtained by the electronic device is (0, 0, 0.. once.. 0, 0, 105, 120, 90, 150, 0, 0.. once.. 0, 0, 0), the data elements 105, 120, 90, 150 therein are the data elements in the contamination detection flag feature quantity that are greater than the preset threshold value. The electronic device determines pixel point regions of the data elements 105, 120, 90, 150 in the matrix image according to the matrix image obtained by the reverse conversion, and then the determined pixel point regions can be determined as the dirty regions of the camera.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图像异常的检测方法、终端设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!