Method and device for detecting imaging consistency of system, and computer storage medium
View Patent ↗Disclosed, in one embodiment, are a method and device for detecting imaging consistency of a system, and a computer storage medium. The method includes: determining a target region in an image acquired by the system, where the target region is a partial region that includes a target object in the image acquired by the system; obtaining first image information of the target region; and detecting the imaging consistency of the system based on the first image information. By obtaining the first image information of the target region in the image acquired by the system and determining the imaging consistency of the system based on the first image information, this application can effectively detect the imaging consistency of the system and improve accuracy of product detection.
1 . A method for detecting imaging consistency of a system, wherein the method comprises:
determining a target region in an image acquired by the system, wherein the target region is a partial region that comprises a target object in the image, wherein the target object is a tab for a battery, and the target region is a region of interest in the image, the region of interest comprising the tab in the image;
obtaining first image information of the target region, wherein the first image information comprises brightness, clarity, and location of the target region; and
detecting the imaging consistency of the system based on the first image information,
wherein detecting the imaging consistency of the system based on the first image information comprises:
determining, if the first image information satisfies a first preset condition, that imaging is consistent in the system;
determining, if the first image information fails to satisfy a first preset condition, that imaging is inconsistent in the system; and
determining an abnormal status of at least one of a light source, an optical path adjustment device, and an image acquisition device in the system when the first image information fails to satisfy the first preset condition,
wherein that the first image information satisfies the first preset condition comprises:
the brightness of the target region falls within a first preset brightness range;
the clarity of the target region is greater than or equal to a first preset clarity; and
the location of the target region falls within a preset location range; and
wherein,
the light source and/or the optical path adjustment device is determined to be abnormal when the brightness of the target region falls outside the first preset brightness range;
the optical path adjustment device and/or the image acquisition device is determined to be abnormal when the clarity of the target region is less than the first preset clarity; and
the optical path adjustment device and/or the image acquisition device are determined to be abnormal when the location of the target region falls outside the preset location range.
2 . The method according to claim 1 , wherein the determining a target region in an image acquired by the system comprises:
processing the image based on a segmenting and locating method to obtain the region of interest.
3 . The method according to claim 1 , wherein the target region is a line region in the region of interest in the image, and the line region is formed of lines of the target object; the first image information comprises brightness, clarity, and line angle of the target region; the line angle is an angle of the lines of the target object; and that the first image information satisfies the first preset condition comprises:
the brightness of the target region falls within a second preset brightness range;
the clarity of the target region is greater than or equal to a second preset clarity; and
the line angle of the target region falls within a preset angle range.
4 . The method according to claim 3 , wherein the determining a target region in an image acquired by the system comprises:
processing the image based on a segmenting and locating method to obtain the region of interest; and
segmenting the region of interest semantically to obtain the target region.
5 . The method according to claim 1 , wherein the first image information comprises brightness, clarity, and location of the target region as well as brightness, clarity, and a line angle of a line region in the target region; the line region is a line region formed of lines of the target object in the target region; the line angle is an angle of the lines of the target object; and that the first image information satisfies the first preset condition comprises:
the brightness of the target region falls within a first preset brightness range;
the clarity of the target region is greater than or equal to a first preset clarity; and
the location of the target region falls within a preset location range;
the brightness of the line region in the target region falls within a second preset brightness range;
the clarity of the line region in the target region is greater than or equal to a second preset clarity; and
the line angle of the line region in the target region falls within a preset angle range.
6 . The method according to claim 1 , wherein the method further comprises:
obtaining second image information of the image; and
the detecting the imaging consistency of the system comprises:
detecting the imaging consistency of the system based on the second image information and the first image information.
7 . The method according to claim 6 , wherein the detecting the imaging consistency of the system based on the second image information and the first image information comprises:
determining, if the second image information satisfies a second preset condition and the first image information satisfies a first preset condition, that imaging is consistent in the system; or
determining, if the second image information fails to satisfy a second preset condition or the first image information fails to satisfy a first preset condition, that imaging is inconsistent in the system.
8 . The method according to claim 7 , wherein the second image information comprises brightness, clarity, and similarity of the image, and that the second image information satisfies the second preset condition comprises:
the brightness of the image falls within a third preset brightness range;
the clarity of the image is greater than or equal to a third preset clarity; and
the similarity of the image falls within a preset similarity range.
9 . The method according to claim 1 , wherein the target region is a line region formed of tab lines of the tab in the image.
10 . A device for detecting imaging consistency of a system, wherein the device comprises a processor and a memory, the memory is configured to store a program, and the processor is configured to call the program from the memory and run the program to perform the method for detecting imaging consistency of a system according to claim 1 .
11 . A non-transitory computer-readable storage medium, wherein the non-transitory storage medium stores a computer program, and, when executed on a computer, the computer program causes the computer to perform the method for detecting imaging consistency of a system according to claim 1 .
12 . The method according to claim 1 , wherein the first preset brightness range, the first preset clarity, and the preset location range are determined based on brightness values, clarity values, and coordinate values of regions of interest in a standard image acquired under a normal status the system.
13 . The method according to claim 1 , wherein obtaining the first image information of the target region comprises:
calculating the brightness of the target region as an average pixel value of the target region;
calculating the clarity of the target region as a variance of a grayscale image gradient obtained by convolving a Laplacian operator with the target region; and
obtaining the location of the target region as center coordinates of the target region.
14 . The method according to claim 1 , wherein detecting the imaging consistency of the system further comprises:
generating a detection result; and
adjusting the system based on the detection result.
15 . The method according to claim 8 , wherein the similarity between the image and a standard image is determined by calculating a histogram of the image and a histogram of the standard image, and calculating a similarity between the histogram of the image and the histogram of the standard image based on at least one of correlation, chi-square, intersection, or Bhattacharyya distance.