A TVLine automatic analysis test method and system
By taking the ISO12233 test card image and applying image processing technology to automatically locate and calculate the effective position of the wedge line area, the problems of inefficient and insufficient accuracy of traditional TVLine testing are solved, and efficient wedge line resolution analysis and calculation are achieved.
Patent Information
- Application Number
- CN202411157830.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-22
AI Technical Summary
Traditional TVLine resolution test relies on manual judgment, which is inefficient and costly. The existing automatic resolution test software cannot achieve one-click control of resolution analysis of all effective wedge line areas, and the determination of the starting and ending positions of the wedge line is inaccurate.
By taking the ISO12233 test card image, the effective wedge line positions in the five wedge line areas, namely the middle, upper left, lower left, upper right and lower right, were automatically positioned and filtered out. The horizontal and vertical clarity of the wedge line was calculated using image processing technology. Gaussian filters and filtering methods for local minimum values improve computational robustness.
Automatic box selection and resolution calculation of the wedge line area in the ISO12233 test card image is realized, which improves testing efficiency and accuracy, and reduces manual intervention and cost requirements.
Smart Images

Figure CN118678050B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of imaging resolution, and in particular to a TVLine automatic analysis test method and system. Background Art
[0002] TVLine resolution test is a method for evaluating the resolution of imaging systems. As the most intuitive resolution test method, it uses ISO12233 as the resolution standard and is widely used to determine the image quality of cameras, scanners or other imaging devices.
[0003] Traditional TVLine testing relies on manual judgment. By adjusting the camera position, the effective area of the ISO12233 test card covers the entire screen, and then manually reading the wedge line readings on the test card to evaluate the camera's resolution. This test method has problems such as strong subjectivity, low efficiency, and high manpower requirements. With the continuous development of technology, automatic resolution test software such as Imatest, iSeetest, and iQstest are constantly used as third-party test tools for industrial product quality monitoring, and they often have the following problems.
[0004] (1) Some automatic resolution test software is expensive and still requires manual selection of a single wedge line area, which greatly increases the cost. For example, when performing a resolution test on an ISO12233 test card, the effective wedge line area is the number of black and white line pairs that can be clearly distinguished on one end of the wedge line, and the number of black and white line pairs that cannot be clearly distinguished on the other end, which requires manual subjective judgment.
[0005] (2) The existing technology still has room for improvement in test efficiency and accuracy. For example, existing third-party tools test the valid wedge line areas of a single box selection in turn and save the results. They cannot achieve one-click control to perform analytical analysis on all valid wedge line areas. At the same time, the method selected to determine the starting position of the wedge line, the ending position of the wedge line, and the clear position of the black and white valid wedge lines is directly related to the structure of the final test. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention provides a TVLine automatic analysis test method and system, which aims to solve the problem of automatically locating all wedge lines in the five wedge line areas of the middle, upper left, lower left, upper right and lower right of the captured ISO12233 test card image, screening out the valid wedge line positions, and automatically calculating the horizontal clarity and vertical clarity of each area.
[0007] To achieve the above object, the present invention provides the following technical solution: a TVLine automatic parsing test method, comprising the following steps:
[0008] Step S1: photographing the ISO12233 test card to obtain a test card image;
[0009] Step S2: measuring the test card image to obtain the effective height of the test card image;
[0010] Step S3: intercepting the square area of the test card image and the square area of the cross wedge line in the upper left corner, and obtaining the middle wedge line area and the surrounding cross wedge line areas by processing the intercepted square area and the square area of the cross wedge line in the upper left corner;
[0011] Step S4: judging the middle wedge line area and the surrounding cross wedge line areas to obtain the wedge line starting position, processing the wedge line starting position to obtain the effective wedge line area, the effective wedge line area includes the middle wedge line effective area and the surrounding cross wedge line effective area;
[0012] Step S5: judging the effective wedge line area, obtaining the wedge line starting position of the effective wedge line area, and starting judging from the wedge line starting position of the effective wedge line area to obtain the clear position of the effective wedge line of the black and white line, and continuing judging the clear position of the effective wedge line of the black and white line to obtain the ending position of the wedge line;
[0013] Step S6: Calculate the effective height of the test card image in step S2, the starting position of the wedge line in step S4, the clear position of the effective wedge line of black and white lines in step S5, and the ending position of the wedge line to obtain the horizontal clarity and vertical clarity of the middle wedge line effective area and the surrounding cross wedge line effective areas.
[0014] Further, in step S1, the test card image is obtained, and the specific steps are:
[0015] Step S11, fixing the ISO12233 test card on the light box, using a camera to face the ISO12233 test card, and photographing the ISO12233 test card to obtain a test card image with a black edge;
[0016] Step S12, dividing the test card image into a middle wedge line area and four areas of upper left, lower left, upper right and lower right, wherein the four areas of upper left, lower left, upper right and lower right are surrounded by cross wedge line areas.
[0017] Further, in step S2, the effective height of the test card image is obtained, and the specific steps are:
[0018] Step S21, converting the obtained test card image into a grayscale image, using image binarization to operate the converted test card image, using morphological operations to disconnect the areas where the test card image shape and structure are located, and then using connected component marking to find the connected areas in the test card image, taking the largest connected area of the test card image, that is, obtaining the test card image without black edges, and the test card image without black edges includes the distance between the highest point and the lowest point of the test card image;
[0019] Step S22, obtaining the effective height of the test card image by measuring the distance between the highest point and the lowest point of the test card image without black edges .
[0020] Further, in step S3, the middle wedge line area and the surrounding cross wedge line areas are obtained, and the specific steps are:
[0021] Step S31, the process of obtaining the middle wedge line area is as follows: the middle wedge line area includes four wedge line areas; a square area at the center of the test card image area without black edges is intercepted, the square area is operated by image binarization, and then a morphological operation is performed, and the middle wedge line area is obtained by screening through an image contour detection method, and the middle wedge line area is obtained by designing the length and width of the middle wedge line area according to the corresponding position relationship between the four middle wedge line areas and the square area;
[0022] Step S32, the process of obtaining the surrounding cross wedge line area is as follows: the surrounding wedge line area is four cross wedge line areas, the cross wedge line square area in the upper left corner of the test card image area without black edges is intercepted, the image of the cross wedge line square area in the upper left corner is binarized using a local adaptive threshold, and then the minimum circumscribed rectangle of the cross wedge line is obtained using a contour screening method, and the minimum circumscribed rectangle of the cross wedge line contains four cross wedge line areas;
[0023] Step S33, by designing the length and width of the square area of the cross wedge line in the upper left corner, using the corresponding position relationship of the four cross wedge line areas in the minimum circumscribed rectangle of the cross wedge line, and the length and width of the square area of the cross wedge line in the upper left corner, and the effective height of the test card image The ratio relationship is obtained, and the square area of the cross wedge line in the upper left corner is obtained;
[0024] Step S34, obtaining surrounding cross wedge line areas by testing the symmetric relationship of the four cross wedge line areas on the card image, wherein the four cross wedge line areas are respectively a cross wedge line square area at the upper left corner, a cross wedge line square area at the lower left corner, a cross wedge line square area at the upper right corner, and a cross wedge line square area at the lower right corner;
[0025] Among them, the middle wedge line area includes 2 horizontal wedge line areas and 2 vertical horizontal wedge line areas, and the surrounding cross wedge line areas include 2 horizontal wedge line areas and 2 vertical horizontal wedge line areas, and the middle wedge line area and the 2 horizontal wedge line areas and 2 vertical horizontal wedge line areas of the surrounding cross wedge line areas are composed of 5 black and white line wedge line areas and 9 black and white line wedge line areas.
[0026] Furthermore, the middle wedge area and the wedge area of 5 black and white lines and the wedge area of 9 black and white lines of the cross wedge area around are rotated to a style with the diverging end facing upward and the contracting end facing downward. The process is:
[0027] The two horizontal wedge line areas and the two vertical horizontal wedge line areas in the middle wedge line area are the left wedge line area and the right wedge line area respectively. The left wedge line area is rotated 90° clockwise and the right wedge line area is rotated 90° counterclockwise to obtain the wedge line area of 5 black and white lines and the wedge line area of 9 black and white lines in the middle wedge line area with the divergent end facing upward and the contraction end facing downward.
[0028] The two horizontal wedge line areas and the two vertical horizontal wedge line areas of the surrounding cross wedge line area are the left wedge line area, the right wedge line area and the vertical lower part of the wedge line area. Rotate the left wedge line area 90° clockwise, rotate the right wedge line area 90° counterclockwise, and rotate the vertical lower part of the wedge line area 180° clockwise to obtain the wedge line area of 5 black and white lines and the wedge line area of 9 black and white lines in the surrounding cross wedge line area with the diverging ends facing upwards and the contracting ends facing downwards.
[0029] Further, in step S4, the effective wedge line area is obtained, and the specific steps are as follows:
[0030] Step S41, selecting 9 black and white line wedge line areas in the rotated middle wedge line area and the two horizontal wedge line areas of the surrounding cross wedge line areas and the two vertical horizontal wedge line areas, wherein the 9 black and white line wedge line areas include the number of black and white wedge line pairs;
[0031] Step S42, by judging the pixel value of each row in the wedge line area of 9 black and white lines, if the number of pixel points in the first row where the wedge line pixel value is less than 50 is greater than 5, then judging and obtaining the pixel value of the next row in the wedge line area of 9 black and white lines, and judging the starting position of the wedge line according to the pixel value;
[0032] Step S43, counting the number of local minimum points of the pixel value row at the starting position of the wedge line, retaining the number of local minimum points whose pixel value differs from the pixel value of the previous pixel point or the pixel value of the next pixel point by more than 20, to filter the number of local minimum points, and finally obtaining the number of local minimum points, which is the number of black and white wedge lines at the 9 starting positions;
[0033] Step S44, counting the number of black and white wedge lines at the 9 starting positions obtained, and comparing the number of black and white wedge lines at the 9 starting positions after counting with the number of black and white wedge lines. If the number of black and white wedge lines at the 9 starting positions after counting is less than the number of black and white wedge lines, the wedge line area of the 9 black and white lines is judged to be an invalid area, and the wedge line area of the 5 black and white lines corresponding to the wedge line area of the 9 black and white lines is judged to be a valid wedge line area. When the number of black and white wedge lines at the 9 starting positions obtained after counting is greater than or equal to the number of black and white wedge lines, the wedge line area of the current 9 black and white lines is judged to be a valid area.
[0034] Among them, the effective wedge line area includes the middle wedge line effective area and the surrounding cross wedge line effective area, wherein the middle wedge line effective area and the surrounding cross wedge line effective area are both composed of 5 black and white line effective wedge line areas or 9 black and white line effective wedge line areas.
[0035] Further, in step S5, the wedge line termination position is obtained, and the specific steps are:
[0036] Step S51, judging the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, obtaining the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, wherein the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area contains the number of black and white line pairs in the effective wedge line area;
[0037] Step S52, starting from the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, performing three detections downward from the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, obtaining the pixel values of the three rows below the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, and taking the average of the pixel values of the three rows below the wedge line starting position detected continuously as the pixel value of the current row;
[0038] Step S53, using a Gaussian filter to smooth the pixel values of the current row, and obtaining the number of local minimum value points of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs after smoothing;
[0039] Step S54, counting the number of local minimum points of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs after the smoothing process, retaining the number of local minimum points of the current row whose pixel value is more than 20 different from the pixel value of the previous pixel point or the pixel value of the next pixel point, to filter the number of local minimum points of the current row, and finally obtaining the number of local minimum points of the current row, i.e., the number of black and white line pairs of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs;
[0040] Step S55, using the same method as the counting of the number of local minimum points of the pixel values of the row at the starting position of the wedge line in step S43, the number of black and white line pairs in the current row of the 5 black and white line pair valid wedge line area or the 9 black and white line pair valid wedge line area is counted to obtain the number of black and white line pairs in the current row of the 5 black and white line pair valid wedge line area or the 9 black and white line pair valid wedge line area;
[0041] Step S56, compare the number of black and white line pairs in the current row of the effective wedge line area of the 5 black and white lines or 9 black and white lines after counting with the number of black and white line pairs in the effective wedge line area. If it is less than the number of black and white line pairs in the effective wedge line area, then perform a next row detection of the number of black and white line pairs in the current row of the effective wedge line area of the 5 black and white lines or 9 black and white lines. If it is less than the number for three consecutive rows, return to the position of the first row comparison to obtain the clear position of the effective wedge line of black and white lines. ;
[0042] Step S57, clear position of effective wedge line for black and white lines Continue to judge, when the number of pixels with a wedge value less than 50 in the clear position of the black and white line valid wedge line is greater than 10, the wedge line end position is obtained based on the current position of the line .
[0043] Further, step S53, the specific steps are:
[0044] In the wedge lines of the 5 black and white line valid wedge line areas, in the first 30% wedge line area, the Gaussian distribution parameter sigma=2 is used, and in the last 70% wedge line area, the Gaussian distribution parameter sigma=1 is used to perform Gaussian filtering, smooth the pixel values of the current row in the wedge lines of the 5 black and white line valid wedge line areas, and obtain the number of local minimum value points of the current row in the 5 black and white line pairs of valid wedge line areas;
[0045] The wedge lines in the valid wedge line area of the 9 black and white lines are Gaussian filtered using the Gaussian distribution parameter sigma=0.8 to obtain the number of local minimum points in the current row of the valid wedge line area of the 9 black and white lines.
[0046] Further, in step S6, the horizontal definition and vertical definition of the middle wedge line effective area and the surrounding cross wedge line effective areas are obtained, and the specific steps are:
[0047] Step S61, combining the effective height of the test card image, the wedge line starting position, the black and white line effective wedge line clear position and the wedge line ending position, the horizontal clarity and vertical clarity of the middle wedge line effective area and the surrounding cross wedge line effective area are solved:
[0048] The horizontal and vertical resolutions of the effective area of the middle wedge line are calculated as follows:
[0049] (1);
[0050] In the formula, Indicates the horizontal and vertical clarity of the effective area of the middle wedge line; Indicates the clear position of the effective wedge line of black and white lines; Indicates the starting position of the wedge line; Indicates the end position of the wedge line; represents the correction factor for the intermediate area; The number of black and white line pairs representing the effective wedge area;
[0051] The horizontal and vertical resolutions of the effective area of the surrounding cross wedge lines are calculated as follows:
[0052] (2);
[0053] In the formula, Indicates the horizontal and vertical clarity of the effective area of the surrounding cross wedge lines; Indicates the correction factor of the surrounding cross wedge area;
[0054] (3);
[0055] In the formula, Indicates the effective height of the test image card.
[0056] Furthermore, a TVLine automatic parsing test system is provided, which is used in any of the TVLine automatic parsing test methods, and comprises:
[0057] A shooting module, used for shooting the ISO12233 test card to obtain a test card image;
[0058] A measuring module, used for measuring the test card image to obtain the effective height of the test card image;
[0059] An operation module is used to intercept a square area of the test card image and a square area of a cross wedge line at the upper left corner, and obtain a middle wedge line area and surrounding cross wedge line areas by processing the intercepted square area and the square area of the cross wedge line at the upper left corner;
[0060] A judgment module is used to judge the middle wedge line area and the surrounding cross wedge line areas to obtain the starting position of the wedge line, and process the starting position of the wedge line to obtain the effective wedge line area, which includes the middle wedge line effective area and the surrounding cross wedge line effective area;
[0061] A comparison module is used to judge the effective wedge line area, obtain the wedge line starting position of the effective wedge line area, and start judging from the wedge line starting position of the effective wedge line area to obtain the clear position of the effective wedge line of the black and white line, and continue to judge the clear position of the effective wedge line of the black and white line to obtain the ending position of the wedge line;
[0062] The calculation module is used to calculate the effective height of the test card image, the starting position of the wedge line, the clear position of the effective wedge line of the black and white lines, and the ending position of the wedge line to obtain the horizontal clarity and vertical clarity of the effective area of the middle wedge line and the effective area of the surrounding cross wedge lines.
[0063] Compared with the existing technology, the present invention has the following beneficial effects: (1) The present invention adopts a shooting device to shoot the ISO12233 test card to obtain a test card image, and automatically selects the wedge line area in the middle of the test card image, as well as the wedge line positions of the upper left, lower left, upper right and lower right areas, and realizes the effective wedge line area selection through the effective wedge line area determination mechanism for the final TVLine resolution calculation.
[0064] (2) The present invention determines the starting position and the ending position of the wedge line in a more accurate manner, and then uses a Gaussian filter and a filtering optimization method of the number of local minima to perform more accurate statistics on the number of black and white line pairs in the effective wedge line area, thereby greatly improving the robustness of TVLine resolution calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0066] The present invention is further described in detail below with reference to implementation cases and accompanying drawings.
[0067] like Figure 1 As shown, a TVLine automatic parsing test method includes the following steps:
[0068] Step S1: photographing the ISO12233 test card to obtain a test card image;
[0069] Step S2: measuring the test card image to obtain the effective height of the test card image;
[0070] Step S3: intercepting a square area of the test card image without black edges and a square area with a cross wedge line in the upper left corner, and obtaining a middle wedge line area and surrounding cross wedge line areas by processing the intercepted square area and the square area with a cross wedge line in the upper left corner;
[0071] Step S4: judging the middle wedge line area and the surrounding cross wedge line areas to obtain the wedge line starting position, processing the wedge line starting position to obtain the effective wedge line area, the effective wedge line area includes the middle wedge line effective area and the surrounding cross wedge line effective area;
[0072] Step S5: judging the effective wedge line area, obtaining the wedge line starting position of the effective wedge line area, and starting judging from the wedge line starting position of the effective wedge line area to obtain the clear position of the effective wedge line of the black and white line, and continuing judging the clear position of the effective wedge line of the black and white line to obtain the ending position of the wedge line;
[0073] Step S6: Calculate the effective height of the test card image in step S2, the starting position of the wedge line in step S4, the clear position of the effective wedge line of black and white lines in step S5, and the ending position of the wedge line to obtain the horizontal clarity and vertical clarity of the middle wedge line effective area and the surrounding cross wedge line effective areas.
[0074] Wherein, in step S1, the test card image is obtained, and the specific steps are:
[0075] Step S11, fix the ISO12233 test card on the light box, use a D65 light source, adjust the brightness of the D65 light source to 3 / 4 of the brightness range of the light box or above, wait for the light source to stabilize, use a shooting device to face the ISO12233 test card, ensure that the ISO12233 test card is located in the middle of the image after shooting, shoot the ISO12233 test card, and obtain a test card image (with a black edge);
[0076] Step S12, dividing the test card image into a middle wedge line area and four areas of upper left, lower left, upper right and lower right, wherein the four areas of upper left, lower left, upper right and lower right are surrounded by cross wedge line areas.
[0077] Wherein, the effective height of the test card image is obtained in step S2, and the specific steps are as follows:
[0078] Step S21, converting the obtained test card image into a grayscale image, using image binarization to operate the converted test card image, using morphological operations to disconnect the areas where the test card image shape and structure are located, and then using connected component marking to find the connected areas in the test card image, taking the largest connected area of the test card image, that is, obtaining the test card image without black edges, and the test card image without black edges includes the distance between the highest point and the lowest point of the test card image;
[0079] Step S22, obtaining the effective height of the test card image by measuring the distance between the highest point and the lowest point of the test card image without black edges .
[0080] Wherein, in step S3, the middle wedge line area and the surrounding cross wedge line areas are obtained, and the specific steps are:
[0081] Step S31, the process of obtaining the middle wedge line area is as follows: the middle wedge line area includes four wedge line areas; a square area at the center of the test card image area without black edges is intercepted, the square area is operated by image binarization, and then a morphological operation is performed, and the middle wedge line area is obtained by screening through an image contour detection method, and the middle wedge line area is obtained by designing the length and width of the middle wedge line area according to the corresponding position relationship between the four middle wedge line areas and the square area;
[0082] Step S32, the process of obtaining the surrounding cross wedge line area is as follows: the surrounding wedge line area is four cross wedge line areas, the cross wedge line square area in the upper left corner of the test card image area without black edges is intercepted, the image of the cross wedge line square area in the upper left corner is binarized using a local adaptive threshold, and then the minimum circumscribed rectangle of the cross wedge line is obtained using a contour screening method, and the minimum circumscribed rectangle of the cross wedge line contains four cross wedge line areas;
[0083] Step S33, by designing the length and width of the square area of the cross wedge line in the upper left corner, using the corresponding position relationship of the four cross wedge line areas in the minimum circumscribed rectangle of the cross wedge line, and the length and width of the square area of the cross wedge line in the upper left corner, and the effective height of the test card image The ratio relationship is obtained, and the square area of the cross wedge line in the upper left corner is obtained;
[0084] Step S34, obtaining surrounding cross wedge line areas by testing the symmetric relationship of the four cross wedge line areas on the card image, wherein the four cross wedge line areas are respectively a cross wedge line square area at the upper left corner, a cross wedge line square area at the lower left corner, a cross wedge line square area at the upper right corner, and a cross wedge line square area at the lower right corner;
[0085] Among them, the middle wedge line area includes 2 horizontal wedge line areas and 2 vertical horizontal wedge line areas, and the surrounding cross wedge line areas include 2 horizontal wedge line areas and 2 vertical horizontal wedge line areas, and the middle wedge line area and the 2 horizontal wedge line areas and 2 vertical horizontal wedge line areas of the surrounding cross wedge line areas are composed of 5 black and white line wedge line areas and 9 black and white line wedge line areas.
[0086] Among them, the wedge line areas of 5 black and white lines in the middle wedge line area and the surrounding cross wedge line areas and the wedge line areas of 9 black and white lines are rotated to a style with the divergent end facing upward and the contraction end facing downward. The process is:
[0087] The two horizontal wedge line areas and the two vertical horizontal wedge line areas in the middle wedge line area are the left wedge line area and the right wedge line area respectively. The left wedge line area is rotated 90° clockwise and the right wedge line area is rotated 90° counterclockwise to obtain the wedge line area of 5 black and white lines and the wedge line area of 9 black and white lines in the middle wedge line area with the divergent end facing upward and the contraction end facing downward.
[0088] The two horizontal wedge line areas and the two vertical horizontal wedge line areas of the surrounding cross wedge line area are the left wedge line area, the right wedge line area and the vertical lower part of the wedge line area. Rotate the left wedge line area 90° clockwise, rotate the right wedge line area 90° counterclockwise, and rotate the vertical lower part of the wedge line area 180° clockwise to obtain the wedge line area of 5 black and white lines and the wedge line area of 9 black and white lines in the surrounding cross wedge line area with the diverging ends facing upwards and the contracting ends facing downwards.
[0089] The effective wedge line area is obtained in step S4, and the specific steps are as follows:
[0090] Step S41, selecting 9 black and white line wedge line areas in the rotated middle wedge line area and the two horizontal wedge line areas of the surrounding cross wedge line areas and the two vertical horizontal wedge line areas, wherein the 9 black and white line wedge line areas include the number of black and white wedge line pairs;
[0091] Step S42, by judging the pixel value of each row in the wedge line area of 9 black and white lines, if the number of pixel points in the first row where the wedge line pixel value is less than 50 is greater than 5, then judging and obtaining the pixel value of the next row in the wedge line area of 9 black and white lines, and judging the starting position of the wedge line according to the pixel value;
[0092] Step S43, counting the number of local minimum points of the pixel value row at the starting position of the wedge line, retaining the number of local minimum points whose pixel value differs from the pixel value of the previous pixel point or the pixel value of the next pixel point by more than 20, to filter the number of local minimum points, and finally obtaining the number of local minimum points, which is the number of black and white wedge lines at the 9 starting positions;
[0093] Step S44, counting the number of black and white wedge lines at the 9 starting positions obtained, and comparing the number of black and white wedge lines at the 9 starting positions after counting with the number of black and white wedge lines. If the number of black and white wedge lines at the 9 starting positions after counting is less than the number of black and white wedge lines, the wedge line area of the 9 black and white lines is judged to be an invalid area, and the wedge line area of the 5 black and white lines corresponding to the wedge line area of the 9 black and white lines is judged to be a valid wedge line area. When the number of black and white wedge lines at the 9 starting positions obtained after counting is greater than or equal to the number of black and white wedge lines, the wedge line area of the current 9 black and white lines is judged to be a valid area.
[0094] Among them, the effective wedge line area includes the middle wedge line effective area and the surrounding cross wedge line effective area, wherein the middle wedge line effective area and the surrounding cross wedge line effective area are both composed of 5 black and white line effective wedge line areas or 9 black and white line effective wedge line areas.
[0095] Wherein, the wedge line termination position is obtained in step S5, and the specific steps are as follows:
[0096] Step S51, judging the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, obtaining the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, wherein the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area contains the number of black and white line pairs in the effective wedge line area;
[0097] Step S52, starting from the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, performing three detections downward from the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, obtaining the pixel values of the three rows below the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, and taking the average of the pixel values of the three rows below the wedge line starting position detected continuously as the pixel value of the current row;
[0098] Step S53, using a Gaussian filter to smooth the pixel values of the current row, and obtaining the number of local minimum value points of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs after smoothing;
[0099] Step S54, counting the number of local minimum points of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs after the smoothing process, retaining the number of local minimum points of the current row whose pixel value is more than 20 different from the pixel value of the previous pixel point or the pixel value of the next pixel point, to filter the number of local minimum points of the current row, and finally obtaining the number of local minimum points of the current row, i.e., the number of black and white line pairs of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs;
[0100] Step S55, using the same method as the counting of the number of local minimum points of the pixel values of the row at the starting position of the wedge line in step S43, the number of black and white line pairs in the current row of the 5 black and white line pair valid wedge line area or the 9 black and white line pair valid wedge line area is counted to obtain the number of black and white line pairs in the current row of the 5 black and white line pair valid wedge line area or the 9 black and white line pair valid wedge line area;
[0101] Step S56, compare the number of black and white line pairs in the current row of the effective wedge line area of the 5 black and white lines or 9 black and white lines after counting with the number of black and white line pairs in the effective wedge line area. If it is less than the number of black and white line pairs in the effective wedge line area, then perform a next row detection of the number of black and white line pairs in the current row of the effective wedge line area of the 5 black and white lines or 9 black and white lines. If it is less than the number for three consecutive rows, return to the position of the first row comparison to obtain the clear position of the effective wedge line of black and white lines. ;
[0102] Step S57, clear position of effective wedge line for black and white lines Continue to judge, when the number of pixels with a wedge value less than 50 in the clear position of the black and white line valid wedge line is greater than 10, the wedge line end position is obtained based on the current position of the line .
[0103] Wherein, step S53 comprises the following specific steps:
[0104] In the wedge lines of the 5 black and white line valid wedge line areas, in the first 30% wedge line area, the Gaussian distribution parameter sigma=2 is used, and in the last 70% wedge line area, the Gaussian distribution parameter sigma=1 is used to perform Gaussian filtering, smooth the pixel values of the current row in the wedge lines of the 5 black and white line valid wedge line areas, and obtain the number of local minimum value points of the current row in the 5 black and white line pairs of valid wedge line areas;
[0105] The wedge lines in the valid wedge line area of the 9 black and white lines are Gaussian filtered using the Gaussian distribution parameter sigma=0.8 to obtain the number of local minimum points in the current row of the valid wedge line area of the 9 black and white lines.
[0106] Among them, in step S6, the horizontal definition and vertical definition of the middle wedge line effective area and the surrounding cross wedge line effective areas are obtained, and the specific steps are:
[0107] Step S61, combining the effective height of the test card image, the wedge line starting position, the black and white line effective wedge line clear position and the wedge line ending position, the horizontal clarity and vertical clarity (unit: LW / PH) of the middle wedge line effective area and the surrounding cross wedge line effective area are solved:
[0108] The horizontal and vertical resolutions of the effective area of the middle wedge line are calculated as follows:
[0109] (1);
[0110] In the formula, Indicates the horizontal and vertical clarity of the effective area of the middle wedge line; Indicates the clear position of the effective wedge line of black and white lines; Indicates the starting position of the wedge line; Indicates the end position of the wedge line; represents the correction factor for the intermediate area; The number of black and white line pairs representing the effective wedge area;
[0111] The horizontal and vertical resolutions of the effective area of the surrounding cross wedge lines are calculated as follows:
[0112] (2);
[0113] In the formula, Indicates the horizontal and vertical clarity of the effective area of the surrounding cross wedge lines; Indicates the correction factor of the surrounding cross wedge area;
[0114] (3);
[0115] In the formula, Indicates the effective height of the test image card.
[0116] A TVLine automatic parsing test system, used in any of the TVLine automatic parsing test methods, comprising:
[0117] A shooting module, used for shooting the ISO12233 test card to obtain a test card image;
[0118] A measuring module, used for measuring the test card image to obtain the effective height of the test card image;
[0119] An operation module is used to intercept a square area of the test card image and a square area of a cross wedge line at the upper left corner, and obtain a middle wedge line area and surrounding cross wedge line areas by processing the intercepted square area and the square area of the cross wedge line at the upper left corner;
[0120] A judgment module is used to judge the middle wedge line area and the surrounding cross wedge line areas to obtain the starting position of the wedge line, and process the starting position of the wedge line to obtain the effective wedge line area, which includes the middle wedge line effective area and the surrounding cross wedge line effective area;
[0121] A comparison module is used to judge the effective wedge line area, obtain the wedge line starting position of the effective wedge line area, and start judging from the wedge line starting position of the effective wedge line area to obtain the clear position of the effective wedge line of the black and white line, and continue to judge the clear position of the effective wedge line of the black and white line to obtain the ending position of the wedge line;
[0122] The calculation module is used to calculate the effective height of the test card image, the starting position of the wedge line, the clear position of the effective wedge line of the black and white lines, and the ending position of the wedge line to obtain the horizontal clarity and vertical clarity of the effective area of the middle wedge line and the effective area of the surrounding cross wedge lines.
[0123] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A TVLine automatic parsing test method, characterized in that: The steps include: Step S1: photographing the ISO12233 test card to obtain a test card image; Step S11, fixing the ISO12233 test card on the light box, using a camera to face the ISO12233 test card, and photographing the ISO12233 test card to obtain a test card image with a black edge; Step S12, dividing the test card image into a middle wedge line area, and four areas of upper left, lower left, upper right and lower right, wherein the four areas of upper left, lower left, upper right and lower right are surrounded by cross wedge line areas; Step S2: measuring the test card image to obtain the effective height of the test card image; Step S21, converting the obtained test card image into a grayscale image, using image binarization to operate the converted test card image, using morphological operations to disconnect the areas where the test card image shape and structure are located, and then using connected component marking to find the connected areas in the test card image, taking the largest connected area of the test card image, that is, obtaining the test card image without black edges, and the test card image without black edges includes the distance between the highest point and the lowest point of the test card image; Step S22, obtaining the effective height of the test card image by measuring the distance between the highest point and the lowest point of the test card image without black edges ; Step S3: intercepting the square area of the test card image and the square area of the cross wedge line in the upper left corner, and obtaining the middle wedge line area and the surrounding cross wedge line areas by processing the intercepted square area and the square area of the cross wedge line in the upper left corner; Step S31, the process of obtaining the middle wedge line area is as follows: the middle wedge line area includes four wedge line areas; a square area at the center of the test card image area without black edges is intercepted, the square area is operated by image binarization, and then a morphological operation is performed, and the middle wedge line area is obtained by screening through an image contour detection method, and the middle wedge line area is obtained by designing the length and width of the middle wedge line area according to the corresponding position relationship between the four middle wedge line areas and the square area; Step S32, the process of obtaining the surrounding cross wedge line area is as follows: the surrounding wedge line area is four cross wedge line areas, the cross wedge line square area in the upper left corner of the test card image area without black edges is intercepted, the image of the cross wedge line square area in the upper left corner is binarized using a local adaptive threshold, and then the minimum circumscribed rectangle of the cross wedge line is obtained using a contour screening method, and the minimum circumscribed rectangle of the cross wedge line contains four cross wedge line areas; Step S33, by designing the length and width of the square area of the cross wedge line in the upper left corner, using the corresponding position relationship of the four cross wedge line areas in the minimum circumscribed rectangle of the cross wedge line, and the length and width of the square area of the cross wedge line in the upper left corner, and the effective height of the test card image The ratio relationship is obtained, and the square area of the cross wedge line in the upper left corner is obtained; Step S34, obtaining surrounding cross wedge line areas by testing the symmetric relationship of the four cross wedge line areas on the card image, wherein the four cross wedge line areas are respectively a cross wedge line square area at the upper left corner, a cross wedge line square area at the lower left corner, a cross wedge line square area at the upper right corner, and a cross wedge line square area at the lower right corner; The middle wedge line area includes two horizontal wedge line areas and two vertical horizontal wedge line areas, and the surrounding cross wedge line areas include two horizontal wedge line areas and two vertical horizontal wedge line areas, and the middle wedge line area and the two horizontal wedge line areas and the two vertical horizontal wedge line areas of the surrounding cross wedge line areas are composed of five black and white line wedge line areas and nine black and white line wedge line areas; Step S4: judging the middle wedge line area and the surrounding cross wedge line areas to obtain the wedge line starting position, processing the wedge line starting position to obtain the effective wedge line area, the effective wedge line area includes the middle wedge line effective area and the surrounding cross wedge line effective area; The two horizontal wedge line areas and the two vertical horizontal wedge line areas in the middle wedge line area need to be rotated, namely the left wedge line area and the right wedge line area. The left horizontal wedge line area is rotated 90° clockwise, and the right horizontal wedge line area is rotated 90° counterclockwise, so that the divergent end of the wedge line area with 5 black and white lines and the wedge line area with 9 black and white lines in the middle wedge line area is facing upward and the contraction end is facing downward. The two horizontal wedge line areas and the two vertical horizontal wedge line areas of the surrounding cross wedge line area need to be rotated, namely the left wedge line area, the right wedge line area and the vertical lower part wedge line area. The left wedge line area is rotated 90° clockwise, the right wedge line area is rotated 90° counterclockwise, and the vertical lower part wedge line area is rotated 180° clockwise, so that the divergent ends of the wedge line areas of the five black and white lines and the nine black and white lines of the surrounding cross wedge line area are facing upward and the contracted ends are facing downward. Step S41, selecting 9 black and white line wedge line areas in the rotated middle wedge line area and the two horizontal wedge line areas of the surrounding cross wedge line areas and the two vertical horizontal wedge line areas, wherein the 9 black and white line wedge line areas include the number of black and white wedge line pairs; Step S42, by judging the pixel value of each row in the wedge line area of 9 black and white lines, if the number of pixel points in the first row where the wedge line pixel value is less than 50 is greater than 5, then judging and obtaining the pixel value of the next row in the wedge line area of 9 black and white lines, and judging the starting position of the wedge line according to the pixel value; Step S43, counting the number of local minimum points of the pixel value row at the starting position of the wedge line, retaining the number of local minimum points whose pixel value differs from the pixel value of the previous pixel point or the pixel value of the next pixel point by more than 20, to filter the number of local minimum points, and finally obtaining the number of local minimum points, which is the number of black and white wedge lines at the 9 starting positions; Step S44, counting the number of black and white wedge lines at the 9 starting positions obtained, and comparing the number of black and white wedge lines at the 9 starting positions after counting with the number of black and white wedge lines. If the number of black and white wedge lines at the 9 starting positions after counting is less than the number of black and white wedge lines, the wedge line area of the 9 black and white lines is judged to be an invalid area, and the wedge line area of the 5 black and white lines corresponding to the wedge line area of the 9 black and white lines is judged to be a valid wedge line area. When the number of black and white wedge lines at the 9 starting positions obtained after counting is greater than or equal to the number of black and white wedge lines, the wedge line area of the current 9 black and white lines is judged to be a valid area. The effective wedge line area includes the middle wedge line effective area and the surrounding cross wedge line effective area, wherein the middle wedge line effective area and the surrounding cross wedge line effective area are both composed of 5 black and white line effective wedge line areas or 9 black and white line effective wedge line areas; Step S5: judging the effective wedge line area, obtaining the wedge line starting position of the effective wedge line area, and starting judging from the wedge line starting position of the effective wedge line area to obtain the clear position of the effective wedge line of the black and white line, and continuing judging the clear position of the effective wedge line of the black and white line to obtain the ending position of the wedge line; Step S51, judging the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, obtaining the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, wherein the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area contains the number of black and white line pairs in the effective wedge line area; Step S52, starting from the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, performing three detections downward from the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, obtaining the pixel values of the three rows below the wedge line starting position of the 5 black and white line effective wedge line area or the 9 black and white line effective wedge line area, and taking the average of the pixel values of the three rows below the wedge line starting position detected continuously as the pixel value of the current row; Step S53, using a Gaussian filter to smooth the pixel values of the current row, and obtaining the number of local minimum value points of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs after smoothing; Step S54, counting the number of local minimum points of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs after the smoothing process, retaining the number of local minimum points of the current row whose pixel value is more than 20 different from the pixel value of the previous pixel point or the pixel value of the next pixel point, to filter the number of local minimum points of the current row, and finally obtaining the number of local minimum points of the current row, i.e., the number of black and white line pairs of the current row in the effective wedge line area of 5 black and white line pairs or the effective wedge line area of 9 black and white line pairs; Step S55, using the same method as the counting of the number of local minimum points of the pixel values of the row at the starting position of the wedge line in step S43, the number of black and white line pairs in the current row of the 5 black and white line pair valid wedge line area or the 9 black and white line pair valid wedge line area is counted to obtain the number of black and white line pairs in the current row of the 5 black and white line pair valid wedge line area or the 9 black and white line pair valid wedge line area; Step S56, compare the number of black and white line pairs in the current row of the effective wedge line area of the 5 black and white lines or 9 black and white lines after counting with the number of black and white line pairs in the effective wedge line area. If it is less than the number of black and white line pairs in the effective wedge line area, then perform a next row detection of the number of black and white line pairs in the current row of the effective wedge line area of the 5 black and white lines or 9 black and white lines. If it is less than the number for three consecutive rows, return to the position of the first row comparison to obtain the clear position of the effective wedge line of black and white lines. ; Step S57, clear position of effective wedge line for black and white lines Continue to judge, when the number of pixels with a wedge value less than 50 in the clear position of the black and white line valid wedge line is greater than 10, the wedge line end position is obtained based on the current position of the line ; Step S6: Calculate the effective height of the test card image in step S2, the starting position of the wedge line in step S4, the clear position of the effective wedge line of black and white lines in step S5, and the ending position of the wedge line to obtain the horizontal clarity and vertical clarity of the middle wedge line effective area and the surrounding cross wedge line effective areas.
2. A TVLine automatic parsing test method according to claim 1, characterized in that: Step S53, the specific steps are: In the wedge lines of the 5 black and white line valid wedge line areas, in the first 30% wedge line area, the Gaussian distribution parameter sigma=2 is used, and in the last 70% wedge line area, the Gaussian distribution parameter sigma=1 is used to perform Gaussian filtering, smooth the pixel values of the current row in the wedge lines of the 5 black and white line valid wedge line areas, and obtain the number of local minimum value points of the current row in the 5 black and white line pairs of valid wedge line areas; The wedge lines in the valid wedge line area of the 9 black and white lines are Gaussian filtered using the Gaussian distribution parameter sigma=0.8 to obtain the number of local minimum points in the current row of the valid wedge line area of the 9 black and white lines.
3. A TVLine automatic parsing test method according to claim 2, characterized in that: In step S6, the horizontal definition and vertical definition of the middle wedge line effective area and the surrounding cross wedge line effective areas are obtained, and the specific steps are: Step S61, combining the effective height of the test card image, the wedge line starting position, the black and white line effective wedge line clear position and the wedge line ending position, the horizontal clarity and vertical clarity of the middle wedge line effective area and the surrounding cross wedge line effective area are solved: The horizontal and vertical resolutions of the effective area of the middle wedge line are calculated as follows: (1); In the formula, Indicates the horizontal and vertical clarity of the effective area of the middle wedge line; Indicates the clear position of the effective wedge line of black and white lines; Indicates the starting position of the wedge line; Indicates the end position of the wedge line; represents the correction factor for the intermediate area; The number of black and white line pairs representing the effective wedge area; The horizontal and vertical resolutions of the effective area of the surrounding cross wedge lines are calculated as follows: (2); In the formula, Indicates the horizontal and vertical clarity of the effective area of the surrounding cross wedge lines; Indicates the correction factor of the surrounding cross wedge area; (3); In the formula, Indicates the effective height of the test image card.
4. A TVLine automatic parsing test system, used for the TVLine automatic parsing test method according to any one of claims 1 to 3, characterized in that: include: A shooting module, used for shooting the ISO12233 test card to obtain a test card image; A measuring module, used for measuring the test card image to obtain the effective height of the test card image; An operation module is used to intercept a square area of the test card image and a square area of a cross wedge line at the upper left corner, and obtain a middle wedge line area and surrounding cross wedge line areas by processing the intercepted square area and the square area of the cross wedge line at the upper left corner; A judgment module is used to judge the middle wedge line area and the surrounding cross wedge line areas to obtain the starting position of the wedge line, and process the starting position of the wedge line to obtain the effective wedge line area, which includes the middle wedge line effective area and the surrounding cross wedge line effective area; A comparison module is used to judge the effective wedge line area, obtain the wedge line starting position of the effective wedge line area, and start judging from the wedge line starting position of the effective wedge line area to obtain the clear position of the effective wedge line of the black and white line, and continue to judge the clear position of the effective wedge line of the black and white line to obtain the ending position of the wedge line; The calculation module is used to calculate the effective height of the test card image, the starting position of the wedge line, the clear position of the effective wedge line of the black and white lines, and the ending position of the wedge line to obtain the horizontal clarity and vertical clarity of the effective area of the middle wedge line and the effective area of the surrounding cross wedge lines.
