Test image processing method, device, electronic device and storage medium

By reducing, pre-processing and corrosion treatment of the test images, and determining the frame grabbing parameters, the problems of slow positioning speed and low accuracy of ROI area in the prior art are solved, and fast and accurate ROI area positioning is achieved, improving the efficiency and accuracy of the resolution test.

CN113362238BActive Publication Date: 2025-04-18KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110559723.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-21
Publication Date
2025-04-18
Estimated Expiration
2041-05-21

AI Technical Summary

Technical Problem

The prior art has slow calculation speed and low accuracy in the process of capturing ROI areas from test images, which affects the efficiency and accuracy of the resolution test.

Method used

By reducing the test images captured by the camera module, pre-processing and corrosion processing are performed on the reduced images, the frame grab parameters are determined, and multiple ROI areas are located.

Benefits of technology

The efficiency of positioning the ROI area is improved, the accuracy of grabbing the ROI area is ensured, and the rapid and accurate positioning of the ROI area is achieved, thereby improving the efficiency and accuracy of the camera module resolution test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113362238B_ABST
    Figure CN113362238B_ABST
Patent Text Reader

Abstract

The present invention discloses a test image processing method, device, electronic device and storage medium, and belongs to the field of camera module testing. According to a preset reduction coefficient, the test image captured by the camera module is reduced to obtain a target reduced image; the target reduced image is preprocessed to obtain a preprocessed image; according to a preset corrosion coefficient, the target color area in the preprocessed image is corroded to obtain a corroded image; according to the preset corrosion coefficient and the preset reduction coefficient, the capture frame parameters for the test image are determined from the corroded image, and multiple ROI areas are located from the test image using the capture frame parameters. The present invention solves the technical problem that the calculation speed of the process of capturing ROI from the test image is slow and the accuracy is not high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of camera module testing, and in particular relates to a test image processing method, device, electronic equipment and storage medium. Background Art

[0002] The camera module needs to be tested for resolution before leaving the factory. Generally, the SFR (spatial frequency response) algorithm is used to test the resolution.

[0003] In the related art, SFR is a multi-value metric that measures contrast loss as a function of spatial frequency. When using the SFR algorithm to test the resolution of a camera module, it is necessary to capture ROI (Region of interest) from the test image captured by the camera module, which is used to calculate the horizontal SFR and vertical SFR respectively. However, the process of capturing ROI from the test image based on the related art is slow in calculation speed and low in accuracy, which affects the efficiency and accuracy of the resolution test. Summary of the invention

[0004] The embodiments of the present invention provide a test image processing method, device, electronic device and storage medium, thereby solving the technical problem that the calculation speed of the process of capturing ROI from the test image is slow and the accuracy is low.

[0005] In a first aspect, an embodiment of the present invention provides a test image processing method, comprising: performing reduction processing on a test image captured by a camera module according to a preset reduction coefficient to obtain a target reduced image, wherein the test image includes different color areas; performing preprocessing on the target reduced image to obtain a preprocessed image; performing corrosion processing on the target color area in the preprocessed image according to a preset corrosion coefficient to obtain an eroded image; determining a capture frame parameter for the test image from the eroded image according to the preset corrosion coefficient and the preset reduction coefficient, and locating multiple ROI areas from the test image using the capture frame parameter.

[0006] Optionally, preprocessing the target reduced image to obtain a preprocessed image includes:

[0007] Performing noise reduction processing on the target reduced image to obtain a first noise-reduced image;

[0008] Dividing the first denoised image into a plurality of image regions from the image center to the image edge, and performing binarization processing on each of the image regions using a corresponding binarization threshold to obtain a binarized image corresponding to the first denoised image;

[0009] The binary image is optimized to obtain the preprocessed image.

[0010] Optionally, the optimizing the binary image to obtain the pre-processed image includes:

[0011] Removing white point noise from the binary image to obtain a second denoised image;

[0012] Performing a negation operation on the second denoised image to obtain the preprocessed image.

[0013] Optionally, the test image includes an original black block area and an original white block area, the target color area of ​​the eroded image includes a plurality of spaced eroded white block areas, and determining the capture frame parameters for the test image from the eroded image according to the preset erosion coefficient and the preset reduction coefficient includes:

[0014] Respectively detecting the minimum circumscribed contour of each corroded white block area in the corroded image;

[0015] For each corroded white block area in the corroded image, the frame parameters of the original black block area corresponding to the position of the corroded white block area in the test image are determined according to the preset reduction coefficient, the corrosion coefficient and the minimum circumscribed contour of the corroded white block area.

[0016] Optionally, determining the capture frame parameters of the original black block area corresponding to the position of the eroded white block area in the test image according to the preset reduction coefficient, the erosion coefficient and the minimum circumscribed contour of the eroded white block area includes:

[0017] Determine the area size of the original black block area corresponding to the position of the corroded white block area in the test image according to the preset corrosion coefficient, the preset reduction coefficient and the outline size of the minimum circumscribed outline of the corroded white block area;

[0018] Determine the contour center of the minimum circumscribed contour of the eroded white block area;

[0019] The method of using the grab frame parameters to locate multiple ROI regions from the test image includes:

[0020] Determine multiple grab frame centers according to the contour center of the minimum circumscribed contour of the corroded white block area and the black block size of the original black block area corresponding to the position of the corroded white block area in the test image;

[0021] Based on the multiple grab frame centers, the multiple ROI regions are correspondingly grabbed.

[0022] Optionally, after locating a plurality of ROI regions from the test image using the grab frame parameters, the method further includes:

[0023] Correcting the multiple ROI regions to obtain corresponding corrected ROI regions;

[0024] From each corrected ROI area, multiple corrected ROI areas around the field of view point are selected for SFR calculation.

[0025] Optionally, the correcting the multiple ROI regions to obtain corresponding corrected ROI regions includes:

[0026] Determine the pixel mean of two target column pixels at the region edge of the ROI region;

[0027] Traversing the pixel points of the ROI area, determining the number of pixel points greater than the pixel mean and the number of pixel points less than the pixel mean;

[0028] Determining correction information for the ROI area according to the height of the ROI area, the number of pixels greater than the pixel mean, and the number of pixels less than the pixel mean;

[0029] The corresponding pixel points in the ROI area are corrected based on the correction information to obtain the corresponding corrected ROI area.

[0030] In a second aspect, an embodiment of the present invention provides a test image processing device, including:

[0031] A reduction unit, used to reduce the test image captured by the camera module according to a preset reduction coefficient to obtain a target reduced image, wherein the test image includes different color areas;

[0032] A preprocessing unit, used for preprocessing the target reduced image to obtain a preprocessed image;

[0033] An erosion unit, used for performing an erosion process on a target color region in the preprocessed image according to a preset erosion coefficient to obtain an eroded image;

[0034] A positioning unit is used to determine a capture frame parameter for the test image from the eroded image according to the preset erosion coefficient and the preset reduction coefficient, and to locate a plurality of ROI areas from the test image using the capture frame parameter.

[0035] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the first aspect when executing the program.

[0036] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the first aspect.

[0037] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:

[0038] In the embodiment of the present invention, the test image includes different color areas. By reducing the image, the calculation speed of the subsequent multiple steps (preprocessing, corrosion processing) is greatly improved. Then, the frame grabbing parameters are determined from the corrosion image according to the preset corrosion coefficient and the preset reduction coefficient. The frame grabbing parameters are used to locate the ROI area from the test image, thereby compensating for the accuracy loss caused by reducing the image. Therefore, the efficiency of locating the ROI area can be improved, and the accuracy of grabbing the ROI area can be guaranteed. The effect of quickly and accurately grabbing the ROI area is achieved, thereby providing conditions for more efficient and accurate resolution testing of the camera module. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 is a flow chart of a test image processing method according to an embodiment of the present invention;

[0041] Figure 2 It shows the test image in the embodiment of the present invention;

[0042] Figure 3 Shows the Figure 2 A first denoised image after Gaussian blur processing;

[0043] Figure 4 Shows the Figure 3 Binarization of regions;

[0044] Figure 5 Shows the Figure 3 Binarized image after binarization processing;

[0045] Figure 6 Shows the Figure 5 A second denoised image after the binarized image is opened;

[0046] Figure 7 Shows the Figure 6A preprocessed image after the second denoised image is inverted;

[0047] Figure 8 Shows the Figure 7 The eroded image after the erosion process of the pre-processed image;

[0048] Fig. 9 is a schematic diagram of a minimum circumscribed contour detected from a corrosion image in an embodiment of the present invention;

[0049] Fig.10 It is a schematic diagram of capturing four ROI areas from the black block area of ​​a test image in an embodiment of the present invention;

[0050] Fig.11 A schematic diagram of the structure of a test image processing device according to an embodiment of the present invention;

[0051] Fig.12 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] Based on the technical problems in related technologies that the process of grabbing the ROI area from the test image has slow calculation speed and low accuracy, the embodiments of the present invention provide a test image processing method, device, electronic device and storage medium.

[0053] The technical solution of the embodiment of the present invention is to solve the above technical problems, and the overall idea is as follows:

[0054] A test image containing different color areas captured by a camera module is reduced according to a preset reduction coefficient to obtain a target reduced image; the target reduced image is preprocessed to obtain a preprocessed image; according to a preset corrosion coefficient, the target color area in the preprocessed image is corroded to obtain a corroded image; according to the preset corrosion coefficient and the preset reduction coefficient, a frame grabbing parameter for the test image is determined from the corroded image, and multiple ROI areas are located from the test image using the frame grabbing parameter.

[0055] The above technical solution first greatly improves the calculation speed of the subsequent multiple steps (preprocessing, corrosion processing) by reducing the image, and then determines the frame parameters from the corrosion image according to the preset corrosion coefficient and the preset reduction coefficient, and uses the frame parameters to locate the ROI area from the test image, thereby compensating for the accuracy loss caused by reducing the image. Therefore, it can not only improve the efficiency of locating the ROI area, but also ensure the accuracy of grabbing the ROI area. The effect of quickly and accurately grabbing the ROI area is achieved, which provides conditions for more efficient and accurate testing of the resolution of the camera module.

[0056] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0057] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0058] In a first aspect, an embodiment of the present invention provides a test image processing method, which can be applied to a camera module test machine, and the test image processing method is used to capture a ROI area from a test image captured by a camera module, and the captured ROI area can also be used to calculate the SFR used to measure the resolution of the camera module. Figure 1 As shown, the test image processing method provided by the embodiment of the present invention includes:

[0059] S101 . Perform reduction processing on a test image captured by a camera module according to a preset reduction coefficient to obtain a target reduced image, wherein the test image includes different color regions.

[0060] Get and load the test image captured by the camera, where the test image contains the area where two color areas touch each other. Specifically, refer to Figure 2 As shown, it may be a black and white grid test image obtained by photographing a checkerboard test chart. Of course, it may also be a black and white test image of other shapes, or a test image of other colors.

[0061] In step S101, the loaded test image is reduced according to a preset reduction factor to obtain a target reduced image. The preset reduction factor is set according to actual needs. In specific implementation, the image width and image height of the loaded test image can be reduced to 1 / 3, 1 / 5, 1 / 7 or 1 / 9 of the original image in proportion.

[0062] In some implementations, in order to increase the calculation speed, the image width and height of the test image can be reduced to 1 / 5 of the original image without losing details in the image. In this way, the image data processing amount in the subsequent steps is only 1 / 25 of the original, which greatly improves the calculation speed. However, after the reduction, 1 pixel is used instead of the original 25 pixels. Even if the accuracy is reduced, there will only be an error of ±2 pixels in the width and height directions of the image.

[0063] S102: Preprocess the target reduced image to obtain a preprocessed image.

[0064] In step S102, pre-processing of the target reduced image includes noise reduction processing and binarization processing.

[0065] Specifically, it includes the following multiple preprocessing steps S1021 to S1023 executed in sequence:

[0066] Step S1021: Perform noise reduction processing on the target reduced image to obtain a first noise reduction image. The noise reduction processing on the target reduced image may be performed by, but is not limited to, a Gaussian blur algorithm.

[0067] Step S1022: Divide the first denoised image into a plurality of image regions from the image center to the image edge, and perform binarization processing on each image region using a corresponding binarization threshold to obtain a binarized image corresponding to the first denoised image.

[0068] Each divided image area is the same image center. Binarization processing is to set the gray value of each pixel in the pixel matrix of the first denoised image to 0 (black) or 255 (white), that is, to make the entire image appear only black and white.

[0069] Specifically, the first denoised image may be divided into 3 to 6 image regions from the image center to the image edge. In some implementations, the 3 to 6 image regions having the same image center may be divided into equidistant regions.

[0070] Since the center of the captured test image is brighter than the surrounding area, the size of the central black block will be smaller than the surrounding area when the same binarization threshold is used for binarization, thereby affecting the position of the ROI area and causing the areas of the two color areas in the ROI area to be unequal. The embodiment of the present invention uses different binarization thresholds for each image area, wherein the closer the image area is to the edge of the image, the larger the binarization threshold is used. Such binarization processing can make the size of each color area in the obtained binary image more uniform.

[0071] In order to balance the computational complexity and the uniformity of the size of the black block area after binarization. Figure 4 As shown, the first denoised image is equidistantly divided into four image regions with the same image center: image region ①, image region ②, image region ③, and image region ④. Four different binarization thresholds are used to perform binarization processing on the four image regions one by one.

[0072] In the binary image formed by the above steps S1021 to S1022, the white block area is large and there is white point noise. Therefore, directly grabbing the ROI area after corrosion processing based on the binary image requires a large amount of calculation and there is noise interference. After the binary image is obtained by step S1022, the embodiment of the present invention further performs step S1023: optimizing the binary image to obtain a pre-processed image.

[0073] In some embodiments, the optimization process of step S1023 includes: removing white point noise of the binary image to obtain a second denoised image; and performing an inversion operation on the second denoised image to obtain a pre-processed image with black and white reversed.

[0074] In specific implementation, the white point noise in the black block area of ​​the binary image can be removed by using, but not limited to, an opening operation to obtain a second denoised image, thereby eliminating the small white points on the image and avoiding the interference of the small white points on the captured ROI area.

[0075] If the test image captured by the camera module is blurry and has high brightness, the white block area in the binarized image after binarization will be large. In this case, if the binarized image is directly corroded, the corrosion coefficient needs to be set very large to separate all the white block areas. Therefore, it is not convenient to uniformly control the corrosion coefficient. Moreover, setting the corrosion coefficient too large will affect the calculation speed.

[0076] refer to Figure 5-6 As shown, the embodiment of the present invention performs a color inversion operation on the second denoised image, so that the white block area in the second denoised image becomes a black block area, and the black block area becomes a white block area, thereby obtaining a pre-processed image with black and white reversed. As a result, most of the eroded white block areas in the pre-processed image (the corresponding positions in the test image are black block areas) are naturally separated. Therefore, in the subsequent erosion processing, only a smaller erosion coefficient needs to be set to separate all the white block areas in the pre-processed image, which is convenient for controlling the erosion coefficient, and the calculation speed of the subsequent erosion processing is also faster.

[0077] S103 , performing corrosion processing on the target color area in the preprocessed image according to a preset corrosion coefficient to obtain a corrosion image.

[0078] In the specific implementation, for the test image including the original black block area and the original white block area, the preprocessed image is a black and white image, and the target color area of ​​the eroded image includes a plurality of spaced eroded white block areas. It should be noted that the preset erosion coefficient is the number of pixels eroded to black in each white block area of ​​the preprocessed image. The purpose of the erosion process is to eliminate the boundary points of adjacent white block areas in the preprocessed image, so that the boundary points of each white block area in the preprocessed image shrink inward, and then, to disconnect the small connections between two adjacent white block areas, and to achieve separation between different white block areas.

[0079] Specifically, a structure element for performing erosion processing on the preprocessed image is designed based on a preset erosion coefficient. Specifically, the structure element can be generated using a numpy library.

[0080] For example, if the preset erosion coefficient is 3 pixels, a 3x3 structural element can be generated and used to scan each pixel of the preprocessed image, and the structural element is used to perform an AND operation with the binary image area covered by the structural element. During the scanning process, when the center of the structural element B is translated to a pixel point (x, y) of the preprocessed image. If each pixel value in the structural element B is exactly the same as the pixel value of the corresponding pixel point in the same neighborhood centered on the pixel point (x, y), then the pixel value of the pixel point (x, y) is retained as 255 (that is, retained as white), otherwise the pixel point (x, y) is changed to a pixel value of 0 (that is, changed to black). This realizes the erosion of the boundary of the white block area in the preprocessed image and obtains the eroded image.

[0081] S104 , determining frame parameters for the test image from the eroded image according to a preset erosion coefficient and a preset reduction coefficient, and locating a plurality of ROI regions from the test image using the frame parameters.

[0082] In step S104, the minimum circumscribed contour of each eroded white block area in the eroded image is detected respectively; each minimum circumscribed contour detected in the eroded image is referenced Fig. 9 For each corroded white block region in the corroded image, according to the preset reduction coefficient, the corrosion coefficient and the minimum circumscribed contour of the corroded white block region, the grabbing frame parameters of the original black block region corresponding to the position of the corroded white block region are determined in the test image.

[0083] For each original black block area in the test image, a corresponding set of grabbing frame parameters is required. Among them, a set of grabbing frame parameters includes: the contour center of the minimum circumscribed contour of the corroded white block area corresponding to the position of the original black block area in the corroded image, and the area size of the original black block area. Specifically, according to the preset corrosion coefficient, the preset reduction coefficient and the contour size of the minimum circumscribed contour of the corroded white block area, the area size of the original black block area corresponding to the position of the corroded white block area in the test image is determined; and the contour center of the minimum circumscribed contour of the corroded white block area is determined.

[0084] The area size of the original black block area includes height and width, wherein the black block width of the original black block area is determined according to a preset corrosion coefficient, a preset reduction coefficient, and the contour width of the minimum circumscribed contour of the corroded white block area corresponding to the position of the original black block area; the black block height of the original black area is determined according to the preset corrosion coefficient, the preset reduction coefficient, and the contour height of the minimum circumscribed contour of the corroded white block area corresponding to the position of the original black block area.

[0085] Specifically, the black block width of each original black block area in the test image can be obtained by referring to the following calculation formula: black block width = (contour width of the minimum circumscribed contour + preset corrosion coefficient) / preset reduction coefficient + number of error pixels; the black block height of each original black block area in the test image can be obtained by referring to the following calculation formula: black block height = (contour height of the minimum circumscribed contour + preset corrosion coefficient) / preset reduction coefficient + number of error pixels. Below, take the reduction to 1 / 5 of the captured test image as an example: black block width = (contour width of the minimum circumscribed contour + preset corrosion coefficient) * 5 + 2; black block height = (contour height of the minimum circumscribed contour + preset corrosion coefficient) * 5 + 2.

[0086] Because the test image captured by the camera module is framed, it is converted to the original image size by multiplying by 5 and then adding 2, so as to frame the image on the original size. Therefore, the accuracy of capturing the ROI area is not affected, achieving the effect of both capture speed and accuracy.

[0087] Of course, in the specific implementation process, the above formula can also be modified according to the accuracy requirements to obtain other similar calculation formulas to calculate the black block height and black block width of the original black block area, which will not be listed one by one here.

[0088] In step S104, multiple ROI regions are located from the test image using the grab frame parameters. Multiple grab frame centers can be determined based on the contour center of the minimum circumscribed contour of the eroded white block region and the black block size of the original black block region corresponding to the position of the eroded white block region in the test image; based on the multiple grab frame centers, multiple ROI regions are correspondingly grabbed. Fig.10As shown, for each original black block area, four grabbing frame centers can be determined, and then four ROI areas can be captured.

[0089] Specifically, for each minimum circumscribed contour, the center of the minimum circumscribed contour is displaced to the left and right by half the width of the black block in the test image, and the two ROI areas of the original black block area are captured with the displaced position as the center frame. Fig.10 The black and white of ROI area I and ROI area II are vertically distributed, so they are used to calculate the vertical SFR. The center of the smallest circumscribed contour is displaced upward and downward by half the width or height of the black block, and the other two ROI areas corresponding to the original black block area are captured with the displaced position as the center frame. Figure 5 The ROI region III and ROI region IV shown in the figure have black and white distributions in the horizontal direction, which are used to calculate the horizontal SFR.

[0090] Through the above step S104, four ROI regions can be captured for each original black block region of the test image. Of course, in some embodiments, in order to reduce the number of located ROI regions and thus improve the calculation speed, the ROI region can be captured only for the minimum circumscribed contour around the field of view point, thereby locating multiple ROI regions around the field of view point, rather than capturing the ROI region for each minimum circumscribed contour.

[0091] Furthermore, even if different binarization thresholds are used for multiple image regions during binarization, the unequal black and white areas of the ROI region can be alleviated to a certain extent. However, the unequal black and white areas of the ROI region still exist, and the error of ±2 pixels caused by reducing the image will also cause unequal black and white areas. Therefore, in order to obtain a more accurate ROI region. After using the grabbing frame parameters to extract multiple ROI regions from the test image, each ROI region is corrected to obtain the corresponding corrected ROI region.

[0092] In some embodiments, the ROI area can be corrected by the following implementation: determining the pixel mean of two target column pixel points at the edge of the ROI area; traversing the pixel points of the ROI area to determine the number of pixel points greater than the pixel mean and the number of pixel points less than the pixel mean; determining correction information for the ROI area based on the height of the ROI area, the number of pixel points greater than the pixel mean, and the number of pixel points less than the pixel mean; correcting the corresponding pixel points in the ROI area based on the correction information to obtain the corresponding corrected ROI area.

[0093] The two target columns of pixels are two columns of pixels at the edges of the two regions, wherein: one column of target columns of pixels all belong to the original black block region, and the other column of target columns of pixels all belong to the original white block region. The obtained correction information represents the correction direction and the number of pixels corrected in the correction direction.

[0094] Below, Figure 5 Take the black and white horizontally distributed ROI area II as an example, select the left and right columns of pixels at the edge of the ROI area II, and calculate the average pixel V of the left and right columns of pixels. Traverse all the pixels in the ROI area II, record the number of pixels greater than V Ng, and record the number of pixels less than V Nl. Then calculate the correction information of the ROI area:

[0095] OffsetX=(Nl-Ng)÷H÷2

[0096] Wherein, H is the height of ROI region II, H is a preset external input parameter, and OffsetX represents the pixel value corrected to the left or right by X pixels.

[0097] After calibration, multiple calibrated ROI areas around the field of view point are selected for SFR calculation. Specifically, multiple calibrated ROI areas with horizontal black and white distribution are selected for horizontal SFR calculation to measure the horizontal resolution of the camera module; and multiple calibrated ROI areas with vertical black and white distribution are selected for vertical SFR calculation to measure the horizontal resolution of the camera module.

[0098] Below, for reference Figure 2 to Figure 10 , the test image processing process of the embodiment of the present invention is described by example to understand the technical solution of the embodiment of the present invention:

[0099] For example, for a camera module that needs to use the SFR algorithm for resolution testing, first, the camera module needs to be used to shoot a test chart to obtain a test image and load it.

[0100] First, the width and height of the loaded test image are reduced to 1 / 5 of the original image, and the target reduced image is obtained, such as Figure 2 Part of the image area shown.

[0101] Next, the target reduced image is subjected to image denoising based on Gaussian blur to obtain a first denoised image, such as Figure 3 As shown, visible, compared Figure 2 , the image becomes blurred, but part of the noise is eliminated.

[0102] Then, if Figure 4As shown in FIG. 1 , the first denoised image is divided into four image regions from the image center to the image edge, and four different binarization thresholds are used to perform binarization processing on the four image regions to obtain a binarized image. The result is referenced in FIG. Figure 5 As shown. Figure 5 It can be seen that different binarization thresholds are used for different image regions to perform binarization processing, so that the size of the black block area after binarization is more uniform.

[0103] Next, since there is still white noise in the binary image, such as Figure 5 If there are small white dots in the black block area circled in the figure, the small white dots in the binary image are removed by opening operation to obtain the second denoised image. The result is as follows: Figure 6 shown.

[0104] Next, the second denoised image is subjected to a color inversion operation to obtain a preprocessed image. Figure 7 As shown. It can be seen that relative to Figure 6 The black and white areas are reversed.

[0105] Next, yes Figure 7 The pre-processed image is corroded to obtain the corroded image. The result is referenced Figure 8 As shown. It can be seen that relative to Figure 7 The scope of the white area has been reduced.

[0106] Next, for Figure 7 The eroded image shown above detects the minimum external contour of each eroded white block. The result is referenced Fig. 9 For each eroded white block area, according to the preset reduction coefficient, the erosion coefficient and the minimum circumscribed contour of the eroded white block area, the grabbing frame parameters of the original black block area corresponding to the position of the eroded white block area are determined in the test image.

[0107] Finally, multiple ROI regions can be located from the test image using the grab frame parameters. Fig.10 As shown in the figure, multiple ROI areas required for SFR testing are accurately captured.

[0108] Since the electronic device introduced in this embodiment is an electronic device used to implement the information processing method in the embodiment of the present invention, based on the information processing method introduced in the embodiment of the present invention, a person skilled in the art can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present invention is not described in detail here. As long as the electronic device used by a person skilled in the art to implement the information processing method in the embodiment of the present invention, it belongs to the scope of protection of the present invention.

[0109] In the second aspect, based on the same inventive concept, an embodiment of the present invention provides a test image processing device, referring to Fig.11 As shown, including:

[0110] The reduction unit 1101 is used to reduce the test image captured by the camera module according to a preset reduction coefficient to obtain a target reduced image, wherein the test image includes different color areas;

[0111] A preprocessing unit 1102 is used to preprocess the target reduced image to obtain a preprocessed image;

[0112] The corrosion unit 1103 is used to perform corrosion processing on the target color area in the preprocessed image according to a preset corrosion coefficient to obtain a corrosion image;

[0113] The positioning unit 1104 is used to determine the capture frame parameters for the test image from the eroded image according to the preset erosion coefficient and the preset reduction coefficient, and locate multiple ROI areas from the test image using the capture frame parameters.

[0114] Optionally, preprocessing is performed on the target reduced image to obtain a preprocessed image, including:

[0115] Performing noise reduction processing on the target reduced image to obtain a first noise reduction image;

[0116] Dividing the first denoised image into a plurality of image regions from the image center to the image edge, and performing binarization processing on each image region using a corresponding binarization threshold to obtain a binarized image;

[0117] The binary image is optimized to obtain the preprocessed image.

[0118] In an optional implementation, the preprocessing unit 1102 includes: a first denoising subunit, used to remove white point noise from the binary image to obtain a second denoised image; and a negation subunit, used to perform an inversion operation on the second denoised image to obtain a preprocessed image with black and white reversed.

[0119] In an optional embodiment, the test image includes an original black block area and an original white block area, the target color area of ​​the corroded image includes multiple spaced corroded white block areas, and the positioning unit 1104 includes: a contour detection subunit, used to respectively detect the minimum circumscribed contour of each corroded white block area in the corroded image; a parameter determination subunit, used to determine, for each corroded white block area in the corroded image, the capture frame parameters of the original black block area corresponding to the position of the corroded white block area in the test image according to a preset reduction coefficient, corrosion coefficient and the minimum circumscribed contour of the corroded white block area.

[0120] In an optional implementation manner, the parameter determination subunit is specifically used to: determine the area size of the original black block area corresponding to the position of the corroded white block area in the test image according to the preset corrosion coefficient, the preset reduction coefficient and the outline size of the minimum circumscribed outline of the corroded white block area; determine the outline center of the minimum circumscribed outline of the corroded white block area;

[0121] In an optional implementation, the positioning unit 1104 is specifically used to: determine multiple grab frame centers based on the contour center of the minimum circumscribed contour of the corroded white block area and the black block size of the original black block area corresponding to the position of the corroded white block area in the test image; and based on the multiple grab frame centers, correspondingly capture multiple ROI areas.

[0122] In an optional embodiment, the device also includes: a correction unit, used to perform correction on multiple ROI areas to obtain corresponding corrected ROI areas; an SFR calculation unit, used to select multiple corrected ROI areas around the field of view point from each corrected ROI area for SFR calculation.

[0123] In an optional embodiment, the correction unit includes: a pixel column determination subunit, which is used to determine the pixel mean of two target column pixel points at the edge of the ROI area; a traversal subunit, which is used to traverse the pixel points of the ROI area to determine the number of pixel points greater than the pixel mean and the number of pixel points less than the pixel mean; an information determination subunit, which is used to determine the correction information for the ROI area based on the height of the ROI area, the number of pixel points greater than the pixel mean, and the number of pixel points less than the pixel mean; and a correction execution subunit, which is used to correct the corresponding pixel points in the ROI area based on the correction information to obtain the corresponding corrected ROI area.

[0124] In the embodiment of the present invention, the reduction unit 1101 reduces the original test image to greatly improve the calculation speed of the subsequent multiple steps (preprocessing, corrosion processing), and then determines the capture frame parameters for the test image captured by the camera module from the corrosion image through the positioning unit 1104 according to the preset corrosion coefficient and the preset reduction coefficient, and locates the ROI area on the test image, and can compensate for the accuracy loss caused by the image reduction. Thus, the effect of quickly and accurately capturing the ROI area is achieved, and the resolution test of the camera module can be performed more efficiently and accurately.

[0125] In a third aspect, based on the same inventive concept, an embodiment of the present invention provides an electronic device, such as Fig.12As shown, the electronic device includes a memory 1204, a processor 1202, and a computer program stored in the memory 1204 and executable on the processor 1202. When the processor 1202 executes the program, the test image processing method described in the first aspect is implemented. For specific implementation details, reference can be made to the test image processing method embodiment described above.

[0126] Among them, Fig.12 In the embodiment of the present invention, a bus architecture (represented by bus 1200) is shown, and bus 1200 may include any number of interconnected buses and bridges, and bus 1200 links various circuits including one or more processors represented by processor 1202 and memory represented by memory 304. Bus 1200 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1206 provides an interface between bus 1200 and receiver 1201 and transmitter 1203. Receiver 1201 and transmitter 1203 may be the same element, namely a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 1202 is responsible for managing bus 1200 and general processing, while memory 1204 may be used to store data used by processor 1202 when performing operations.

[0127] In the fourth aspect, based on the same inventive concept as the aforementioned test image processing method, an embodiment of the present specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any implementation method in the aforementioned test image processing method embodiment. The specific implementation details refer to the aforementioned test image processing method embodiment, and for the sake of brevity of the specification, they will not be repeated here.

[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0132] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0133] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A test image processing method, characterized in that: include: The test image captured by the camera module is reduced according to a preset reduction coefficient to obtain a target reduced image, wherein the test image contains different color areas, and the test image includes an original black block area and an original white block area; Preprocessing the target reduced image to obtain a preprocessed image; According to a preset corrosion coefficient, a target color area in the preprocessed image is corroded to obtain a corroded image, wherein the target color area of ​​the corroded image includes a plurality of spaced corroded white block areas; Determining the capture frame parameters for the test image from the eroded image according to the preset erosion coefficient and the preset reduction coefficient, including: respectively detecting the minimum circumscribed contour of each eroded white block area in the eroded image; For each corroded white block region in the corroded image, determining the capture frame parameters of the original black block region corresponding to the position of the corroded white block region in the test image according to the preset reduction coefficient, the corroded coefficient and the minimum circumscribed contour of the corroded white block region; A plurality of ROI regions are located from the test image using the grab frame parameters.

2. The method according to claim 1, characterized in that The preprocessing of the target reduced image to obtain the preprocessed image includes: Performing noise reduction processing on the target reduced image to obtain a first noise-reduced image; Dividing the first denoised image into a plurality of image regions from the image center to the image edge, and performing binarization processing on each of the image regions using a corresponding binarization threshold to obtain a binarized image corresponding to the first denoised image; The binary image is optimized to obtain the preprocessed image.

3. The method according to claim 2, characterized in that The step of optimizing the binary image to obtain the pre-processed image includes: Removing white point noise from the binary image to obtain a second denoised image; Performing a negation operation on the second denoised image to obtain the preprocessed image.

4. The method according to claim 1, characterized in that The step of determining the capture frame parameters of the original black block area corresponding to the position of the eroded white block area in the test image according to the preset reduction coefficient, the erosion coefficient and the minimum circumscribed contour of the eroded white block area includes: Determine the area size of the original black block area corresponding to the position of the corroded white block area in the test image according to the preset corrosion coefficient, the preset reduction coefficient and the outline size of the minimum circumscribed outline of the corroded white block area; Determine the contour center of the minimum circumscribed contour of the eroded white block area; The method of using the grab frame parameters to locate multiple ROI regions from the test image includes: Determine multiple grab frame centers according to the contour center of the minimum circumscribed contour of the corroded white block area and the black block size of the original black block area corresponding to the position of the corroded white block area in the test image; Based on the multiple grab frame centers, the multiple ROI regions are correspondingly grabbed.

5. The method according to any one of claims 1 to 4, characterized in that: After locating a plurality of ROI regions from the test image using the grab frame parameters, the method further includes: Correcting the multiple ROI regions to obtain corresponding corrected ROI regions; From each corrected ROI area, multiple corrected ROI areas around the field of view point are selected for SFR calculation.

6. The method according to claim 5, characterized in that The correcting the multiple ROI regions to obtain corresponding corrected ROI regions includes: Determine the pixel mean of two target column pixels at the region edge of the ROI region; Traversing the pixel points of the ROI area, determining the number of pixel points greater than the pixel mean and the number of pixel points less than the pixel mean; Determining correction information for the ROI area according to the height of the ROI area, the number of pixels greater than the pixel mean, and the number of pixels less than the pixel mean; The corresponding pixel points in the ROI area are corrected based on the correction information to obtain the corresponding corrected ROI area.

7. A test image processing device, characterized in that: include: A reduction unit, used to reduce the test image captured by the camera module according to a preset reduction coefficient to obtain a target reduced image, wherein the test image contains different color areas, and the test image includes an original black block area and an original white block area; A preprocessing unit, used for preprocessing the target reduced image to obtain a preprocessed image; An erosion unit, configured to perform an erosion process on a target color region in the preprocessed image according to a preset erosion coefficient to obtain an eroded image, wherein the target color region of the eroded image comprises a plurality of spaced eroded white block regions; A positioning unit, used to determine the capture frame parameters for the test image from the eroded image according to the preset erosion coefficient and the preset reduction coefficient, including: respectively detecting the minimum circumscribed contour of each eroded white block area in the eroded image; For each corroded white block region in the corroded image, determining the capture frame parameters of the original black block region corresponding to the position of the corroded white block region in the test image according to the preset reduction coefficient, the corroded coefficient and the minimum circumscribed contour of the corroded white block region; The positioning unit is further used to locate multiple ROI areas from the test image using the grab frame parameters.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program.

9. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image processing method, device, electronic device and computer-readable medium

    CN109410215A

  • Radioactive source imaging image processing method and device and electronic equipment

    CN111311621A