Bright and dark line positioning method, electronic equipment and computer readable storage medium
By acquiring and analyzing the gradient parameters and directions of the image in the display screen and automatically positioning the light and dark lines, the accuracy and intelligence of the light and dark lines in the display screen stitching are solved, and the display effect is improved.
Patent Information
- Application Number
- CN202411677999.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is prone to light and dark lines during the splicing of display screens, resulting in poor display effects, and artificial positioning methods have problems such as inaccurate positioning and lack of intelligence.
By obtaining the image to be identified, the gradient parameters and gradient direction of each pixel are determined, and the light and dark lines are automatically positioned based on these parameters and the parameters of the screen to be tested.
It realizes accurate and automatic positioning of light and dark lines in the display screen, solves the problem of inaccurate positioning of humans, improves the display effect, and realizes an intelligent light and dark line recognition process.
Smart Images

Figure CN119479513A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of LED display technology, and in particular relates to a bright and dark line positioning method, an electronic device and a computer-readable storage medium. Background Art
[0002] In order to obtain a larger and more continuous display screen, multiple display screen cabinets and light boards are usually assembled to splice multiple display screens together. However, due to the manufacturing accuracy of the display screen, the manual installation accuracy and other reasons, bright lines or dark lines will appear at the seams between the display screen cabinets and the light boards, affecting the display effect of the display screen and thus reducing the user's viewing experience.
[0003] At present, the gap between display cabinets or light boards can be reduced by adjusting the structure of the display cabinet or light board, but the adjustment method is susceptible to human error, and the problem of light and dark lines will still exist after adjustment. At present, the light and dark lines can also be adjusted by software algorithms, but the process of adjusting the light and dark lines by software algorithms is also to first perceive the light and dark lines through human vision and locate the light and dark lines. Due to the large number of display cabinets and light boards, manual positioning may result in positioning deviations, and there are problems such as inaccurate light and dark line positioning and lack of intelligence. Summary of the invention
[0004] The embodiments of the present application provide a bright and dark line positioning method, an electronic device, and a computer-readable storage medium, which can solve the problem of how to accurately position the bright and dark lines in a display screen.
[0005] In a first aspect, an embodiment of the present application provides a method for locating bright and dark lines, comprising: acquiring an image to be identified, the image to be identified comprising a test image generated according to parameters of a screen to be tested; determining gradient parameters and gradient directions of each pixel in the image to be identified; and locating at least one bright or dark line in the image to be identified according to the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested.
[0006] The first aspect provides a method for locating bright and dark lines, which obtains an image to be identified including a test image generated according to parameters of the screen to be tested, and determines the gradient parameters and gradient directions of each pixel in the image to be identified; and locates at least one bright and dark line in the image to be identified according to the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested. In this way, the bright and dark lines in the screen to be tested can be automatically and accurately located through the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested, thereby solving the problem of inaccurate positioning of bright and dark lines caused by manual positioning.
[0007] In a possible implementation of the first aspect, at least one bright and dark line in the image to be identified is located according to the gradient parameters and gradient direction of each pixel in the image to be identified and the parameters of the screen to be tested, including: screening each pixel according to the gradient parameters and gradient direction of each pixel in the image to be identified to determine a plurality of bright and dark pixels; determining the direction of the bright and dark line to which each bright and dark pixel belongs according to the position information of each bright and dark pixel and the parameters of the screen to be tested; locating at least one bright and dark line according to the position information of each bright and dark pixel and the direction of the bright and dark line to which each bright and dark pixel belongs. In this implementation, a plurality of bright and dark pixels are determined according to the gradient parameters and gradient direction of the pixels, so that the bright and dark pixels on the bright and dark line can be accurately determined, and then the direction of the bright and dark line to which the bright and dark pixels belong is determined according to the position information of the bright and dark pixels and the parameters of the screen to be tested, so that the direction of the bright and dark line is clear. In this way, when the bright and dark pixels and the directions of the bright and dark pixels are determined, at least one bright and dark line can be accurately located according to the position information of each bright and dark pixel and the direction of the bright and dark line to which each bright and dark pixel belongs.
[0008] In a possible implementation of the first aspect, each pixel is screened according to the gradient parameter and gradient direction of each pixel in the image to be identified to determine a plurality of light and dark pixels, including: comparing each pixel with the gradient parameters and gradient directions of pixels surrounding each pixel, respectively; if the gradient parameters and gradient directions of each pixel are greater than the gradient parameters and gradient directions of pixels surrounding each pixel, the pixel is determined as a candidate pixel; and the candidate pixels are screened according to the gradient parameters of each pixel in the candidate pixels to determine a plurality of light and dark pixels.
[0009] In a possible implementation of the first aspect, the candidate pixels are screened according to the gradient parameters of each pixel in the candidate pixels to determine a plurality of bright and dark pixels, including: for each pixel in the candidate pixels, the gradient parameters of the pixel are compared with a preset maximum gradient threshold and a preset minimum gradient threshold respectively; if the gradient parameter of the pixel is greater than the maximum gradient threshold, the pixel is determined to be a bright and dark pixel; if the gradient parameter of the pixel is less than the minimum gradient threshold, the pixel is deleted; if the gradient parameter of the pixel is less than the maximum gradient threshold and the gradient parameter of the pixel is greater than the minimum gradient threshold, whether the pixel is a bright and dark pixel is determined according to the position information of the pixel. In this implementation, the maximum gradient threshold and the minimum gradient threshold are preset, the bright and dark pixels are screened, the accuracy of determining the bright and dark pixels is improved, and the error of selecting the bright and dark pixels is reduced.
[0010] In a possible implementation of the first aspect, determining whether a pixel is a light or dark pixel according to the position information of the pixel includes: searching whether the pixel includes light or dark pixels around the pixel according to the position information of the pixel; if the pixel includes light or dark pixels around the pixel, determining the pixel as a light or dark pixel; if the pixel does not include light or dark pixels around the pixel, deleting the pixel. In this implementation, for a pixel that is not determined to be a light or dark pixel according to a preset maximum gradient threshold and a preset minimum gradient threshold, further determining whether the pixel is a light or dark pixel according to the position information, if there is a light or dark pixel that can be connected to the pixel, the pixel is considered to be a light or dark pixel, thereby improving the accuracy of determining light or dark pixels and reducing the error of selecting light or dark pixels.
[0011] In a possible implementation of the first aspect, the direction of the light and dark lines to which the light and dark pixels belong is determined according to the position information of each light and dark pixel and the parameters of the screen to be tested, including: performing calculations according to the position information of each light and dark pixel and the parameters of the screen to be tested to obtain the relative position information of each light and dark pixel; and determining the direction of the light and dark lines to which each light and dark pixel belongs according to the relative position information of each light and dark pixel. In this implementation, the relative position information of the light and dark pixels in the image to be identified can be determined, and the direction of the light and dark lines to which the light and dark pixels belong in the image to be identified can be further determined, and the direction of the light and dark lines in the image to be identified can be further refined to improve the accuracy of determining the light and dark lines.
[0012] In a possible implementation of the first aspect, determining the gradient parameter and gradient direction of each pixel in the image to be identified includes: preprocessing the pixels, the preprocessing including grayscale processing and denoising; calculating the preprocessed pixels to obtain the gradient parameter and gradient direction of each pixel. In this implementation, the pixels in the image to be identified are preprocessed to ensure that the pixels in the image to be identified remain clear, and to avoid the influence of blurring of the image to be identified on the hardness of identifying bright and dark pixels.
[0013] In a possible implementation of the first aspect, the method further includes: supplementing the position information of each unidentified bright and dark pixel in the bright and dark line according to the starting point and the end point of the bright and dark line to obtain the supplemented bright and dark line; adjusting the brightness of the lamp beads around each bright and dark pixel in the supplemented bright and dark line to complete the correction of the bright and dark line of the screen to be tested. In this implementation, since the direction of the bright and dark line is horizontal or vertical, the starting point and the end point of the bright and dark line are determined, and the position information of other unidentified bright and dark pixels between the starting point and the end point can be supplemented according to the starting point and the end point, so that the bright and dark pixels on the bright and dark line are complete. In order to achieve a better display effect of the screen to be tested, the brightness of the lamp beads around the bright and dark lines can be adjusted so that the bright and dark lines are corrected.
[0014] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to execute the method in the first aspect or any possible implementation of the first aspect when calling the computer program.
[0015] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising: a computer program is stored in the computer-readable storage medium, and when the computer program is executed, it is used to execute the method in the first aspect or any possible implementation of the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the method in the first aspect or any possible implementation manner of the first aspect.
[0017] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 It is a schematic diagram of a bright and dark line positioning system architecture provided by an embodiment of the present application;
[0020] Figure 2 is a schematic flow chart of a bright and dark line positioning method provided in an embodiment of the present application;
[0021] Figure 3 is an exemplary flow chart of a test image generation and display process provided by an embodiment of the present application;
[0022] Figure 4 is a test image corresponding to a light board provided in an embodiment of the present application;
[0023] Figure 5 is a test image corresponding to a box provided in an embodiment of the present application;
[0024] Figure 6 This is a structural block diagram of a bright and dark line positioning device provided by an embodiment of the present application;
[0025] Figure 7It is a structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0026] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0027] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0028] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0029] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0030] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0031] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0032] The bright and dark line positioning system applicable to the embodiment of the present application is first described below.
[0033] Figure 1 FIG. 1 is a schematic diagram of a bright and dark line positioning system architecture applicable to an embodiment of the present application. Figure 1 As shown, the bright and dark line positioning system includes: a display screen 110 and an electronic device 120. Among them, the electronic device 120 may include a camera, which is not limited in the embodiment of the present application. It should be noted that the display screen 110 and the electronic device 120 are communicatively connected and can transmit data to each other. It should be understood that in the embodiment of the present application, the display screen 110 and the electronic device 120 can be communicatively connected via a wireless connection (such as Bluetooth, Wireless Fidelity (Wireless Fidelity, Wi-Fi) network), etc., or can be communicatively connected via a wired connection (such as High Definition Multimedia Interface (High Definition Multimedia Interface, HDMI), Video Graphics Array (VGA) interface, Universal Serial Bus (USB) interface, etc.), which is not limited in the embodiment of the present application.
[0034] It should be understood that Figure 1 The illustrated system architecture does not constitute a specific limitation on the architecture of the bright and dark line positioning system applicable to the present application example. In other embodiments of the present application, the architecture of the bright and dark line positioning system applicable to the present application example may include: Figure 1 The embodiments of the present application are not limited to the more or fewer components shown, or different components, etc.
[0035] For example, the embodiments of the present application may also be applied to a system including a camera device. For another example, the embodiments of the present application may also be applied to an electronic device including a camera device and a display screen. The embodiments of the present application are not limited here.
[0036] The bright and dark line positioning method provided by the embodiment of the present application will be described in detail below.
[0037] Figure 2 A schematic flow chart of the bright and dark line positioning method provided in the present application is shown. Figure 2 The method shown can be applied to Figure 1 In the bright and dark line positioning system architecture shown in FIG. Figure 2 The method shown is applied to Figure 1 The electronic device in the light and dark line positioning system architecture is shown, but this should not limit the embodiments of the present application.
[0038] like Figure 2As shown, the method includes: S210 to S230, wherein:
[0039] S210, obtaining an image to be recognized.
[0040] The image to be identified includes a test image generated according to parameters of the screen to be tested.
[0041] In an embodiment of the present application, the image to be identified can be directly acquired by the electronic device, or it can be acquired indirectly. Exemplarily, the image to be identified can be directly acquired by the electronic device including a camera device or a camera device, or it can be photographed by the camera device and sent to an electronic device connected to the camera device, so that the electronic device indirectly acquires it. It should be noted that whether the electronic device acquires it directly or indirectly, the test image needs to be displayed on the screen to be tested before it can be acquired.
[0042] S220, determining the gradient parameter and gradient direction of each pixel in the image to be identified.
[0043] In a possible implementation, the preprocessed pixels are calculated according to edge detection operators (such as Sobel operator, Canny operator, Prewitt operator, and Roberts operator, etc.), simple gradient method, median difference method, etc. to obtain gradient parameters of the pixels. The gradient direction can be determined by the gradient parameters.
[0044] Exemplarily, the embodiments of the present application take the Sobel operator in the edge detection operator as an example to illustrate the process of an electronic device determining the gradient parameter and gradient direction of a pixel.
[0045] The Sobel operator is a discrete differential operator that combines Gaussian smoothing and differential derivation, and can more accurately calculate the gradient of an image. The Sobel operator uses 3*3 kernel convolution factors representing the horizontal and vertical directions to calculate the gradients of the image to be processed in the horizontal and vertical directions after grayscale processing.
[0046] Specifically, the embodiment of the present application predefines a Sobel operator template, that is, defines a horizontal convolution kernel and a vertical convolution kernel, wherein the horizontal convolution kernel is used to detect changes in the image in the horizontal direction, and the vertical convolution kernel is used to detect changes in the vertical direction.
[0047] For example, the horizontal convolution kernel is expressed as: The vertical convolution kernel is expressed as:
[0048] The Sobel operator template is convolved with the image to be identified to obtain the first-order derivatives of the image to be identified in the horizontal and vertical directions, G xand G y ,in,
[0049]
[0050] G x Represents the first-order derivative of the image to be recognized in the horizontal direction, G y It represents the first-order derivative of the image to be recognized in the vertical direction, and img represents the image to be recognized.
[0051] In a possible implementation, any of the following calculation formulas may be used to determine the gradient parameter corresponding to each pixel in the image to be identified:
[0052]
[0053] G=G x +G y ;
[0054] Among them, G represents the gradient parameter corresponding to the pixel point.
[0055] In a possible implementation, the following calculation formula may be used to determine the gradient direction of each pixel in the image to be identified:
[0056]
[0057] Optionally, in order to improve the accuracy of identifying bright and dark lines in the image to be identified, the image to be identified may be firstly grayscale processed and denoised, and then the gradient parameter and gradient direction of each pixel in the processed image to be identified may be determined.
[0058] Specifically, S220 includes S220a and S220b:
[0059] S220a, pre-processing the pixels.
[0060] Among them, preprocessing includes grayscale processing and denoising processing.
[0061] Exemplarily, the grayscale processing of the image to be recognized is performed by any method such as maximum method, average method, desaturation method, etc., and the denoising processing of the image to be recognized is performed by any method such as median filtering, Gaussian filtering, etc.
[0062] The image to be identified is processed in grayscale and denoised to avoid blurring of the image to be identified, which would affect the accuracy of image recognition.
[0063] S220b, calculating the preprocessed pixels to obtain the gradient parameter and gradient direction of each pixel.
[0064] It should be noted that the implementation process of S220b can refer to the implementation process in S220, the only difference is whether it is the original pixel (that is, the pixel in the image to be identified) or the pre-processed pixel, and the embodiments of the present application will not be repeated here.
[0065] S230 , locating at least one bright or dark line in the image to be identified according to the gradient parameter and gradient direction of each pixel in the image to be identified and the parameters of the screen to be tested.
[0066] Exemplarily, in the embodiment of the present application, S230 may specifically include:
[0067] S2301, screening each pixel according to the gradient parameter and gradient direction of each pixel in the image to be identified, and determining a plurality of bright and dark pixels.
[0068] In an embodiment of the present application, each pixel can be checked to determine whether the gradient parameter and gradient direction of the point are the largest among those around the point, to obtain candidate pixels, and then select from the candidate pixels to determine multiple bright and dark pixels.
[0069] Specifically, S2301 includes S2301a and S2301b, wherein:
[0070] S2301a, compare the gradient parameters and gradient directions of each pixel with those of the pixels surrounding each pixel respectively. If the gradient parameters and gradient directions of each pixel are greater than the gradient parameters and gradient directions of the pixels surrounding each pixel, determine the pixel as a candidate pixel.
[0071] In a possible implementation, each pixel is first compared with the gradient parameters of the pixels around it. When the gradient parameter of the pixel is greater than the gradient parameters of the pixels around it, the gradient direction of the pixel is then compared with the gradient direction of the pixels around it. If the gradient direction of the pixel is also greater than the gradient direction of the pixels around it, the pixel is determined as a candidate pixel.
[0072] In another possible implementation, each pixel is first compared with the gradient direction of the pixels around it. When the gradient direction of the pixel is greater than the gradient direction of the pixels around it, the pixel is then compared with the gradient parameters around it. If the gradient parameter of the pixel is also greater than the gradient parameter of the pixels around it, the pixel is determined as a candidate pixel.
[0073] In another possible implementation, the gradient parameters and gradient directions of the pixels surrounding each pixel are first compared to determine the maximum gradient parameter and the maximum gradient direction among the pixels surrounding each pixel. Then, the gradient parameter and the gradient direction of each pixel are respectively compared with the maximum gradient parameter and the maximum gradient direction among the pixels surrounding each pixel. When the gradient parameter and the gradient direction of each pixel are greater than the maximum gradient parameter and the maximum gradient direction, the pixel is determined as a candidate pixel.
[0074] Exemplarily, the pixels around each pixel include: upper adjacent pixels (i.e., pixels located directly above the pixel), lower adjacent pixels (i.e., pixels located directly below the pixel), left adjacent pixels (i.e., pixels located directly to the left of the pixel), right adjacent pixels (i.e., pixels located directly to the right of the pixel), upper left adjacent pixels (i.e., pixels located to the upper left of the pixel and forming a diagonal with the pixel), upper right adjacent pixels (i.e., pixels located to the upper right of the pixel and forming a diagonal with the pixel), lower left adjacent pixels (i.e., pixels located to the lower left of the pixel and forming a diagonal with the pixel), and lower right adjacent pixels (i.e., pixels located to the lower right of the pixel and forming a diagonal with the pixel). It can be understood that each pixel can be at any position in the display screen, and the number of pixels around pixels at different positions is different. For example, when each pixel is located at the top corner of the display screen (including: upper left corner, lower left corner, upper right corner, lower right corner), the number of pixels around the pixel is three. When each pixel is located at a non-vertex position around the display screen, the number of pixels around the pixel is five, that is, the number of pixels around the pixel is different when the pixel is located at different positions on the screen.
[0075] It should be noted that if the gradient parameter of each pixel is less than or equal to the gradient parameter of the pixels surrounding each pixel, and / or the gradient direction of each pixel is less than or equal to the gradient direction of the pixels surrounding each pixel, these pixels will be deleted and not retained.
[0076] S2301b, screening the candidate pixels according to the gradient parameter of each pixel in the candidate pixels to determine a plurality of bright and dark pixels.
[0077] For example, since the gradient parameter of a pixel can reflect how fast the brightness of the pixel changes, a large gradient parameter indicates a fast brightness change, and the pixel is likely to be a pixel on the light-dark line, while a small gradient parameter indicates a uniform brightness display, and the pixel is generally not a pixel on the light-dark line. Based on this, two gradient thresholds can be preset, namely the maximum gradient threshold and the minimum gradient threshold, and the gradient parameter, maximum gradient threshold, and minimum gradient threshold of each pixel in the candidate pixels are compared to complete the identification of light and dark pixels.
[0078] Specifically, S2301b includes: for each pixel in the candidate pixels, comparing the gradient parameter of the pixel with a preset maximum gradient threshold and a preset minimum gradient threshold respectively.
[0079] A1. If the gradient parameter of a pixel is greater than the maximum gradient threshold, the pixel is determined as a bright or dark pixel.
[0080] If the gradient parameter of a pixel is greater than the maximum gradient threshold, it means that the brightness of the pixel changes rapidly and has a large brightness difference with the surrounding pixels. The pixel is on the bright-dark line, that is, a bright-dark pixel.
[0081] A2. If the gradient parameter of a pixel is less than the minimum gradient threshold, the pixel is deleted.
[0082] If the gradient parameter of a pixel is less than the minimum gradient threshold, it means that the brightness of the pixel is relatively uniform and close to the brightness of the surrounding pixels. The pixel is not on the bright-dark line and is deleted.
[0083] A3. If the gradient parameter of the pixel is less than the maximum gradient threshold and the gradient parameter of the pixel is greater than the minimum gradient threshold, determine whether the pixel is a bright or dark pixel according to the position information of the pixel.
[0084] If the gradient parameter of a pixel is less than the maximum gradient threshold and the gradient parameter of the pixel is greater than the minimum gradient threshold, then it is impossible to determine whether the pixel is a light or dark pixel based on the gradient parameter of the pixel. Whether the pixel is a light or dark pixel can be determined based on the position information of the pixel. If the pixel is surrounded by other light or dark pixels, the pixel can be connected by other light or dark pixels, possibly forming a light or dark line, and the pixel is determined to be a light or dark pixel.
[0085] In SS2301b, some bright and dark pixels have been determined. Further, other pixels whose brightness or darkness has not yet been determined can be judged based on the determined bright and dark pixels.
[0086] Specifically, determining whether a pixel is a bright or dark pixel according to the pixel position information in A3 includes: searching whether the pixel is surrounded by bright or dark pixels according to the pixel position information; if the pixel is surrounded by bright or dark pixels, determining the pixel as a bright or dark pixel; if the pixel is not surrounded by bright or dark pixels, deleting the pixel.
[0087] In some embodiments, based on the position information of a pixel, the position information of pixels around the pixel is determined, and then based on the position information of pixels around the pixel, it is searched whether the pixel corresponding to the position information is a bright or dark pixel that has been determined.
[0088] Furthermore, in order to reduce the search time, the pixels corresponding to the position information of the pixels around the pixel are searched in sequence. When a bright or dark pixel is found, the search for the pixels around the pixel that have not been searched is stopped.
[0089] It is understandable that, when there are bright and dark pixels around a pixel, the bright and dark pixels can be connected to the pixel to form a bright and dark line, so the pixel can be determined as a bright and dark pixel. When there are no bright and dark pixels around a pixel, the pixel cannot be connected to other bright and dark pixels, and will not be connected to other pixels to form a bright and dark line, so the pixel is not a bright and dark pixel and is deleted.
[0090] Since bright and dark pixels with the same horizontal position information belong to the same bright and dark line, and bright and dark pixels with the same vertical position information belong to the same bright and dark line, multiple bright and dark lines can be determined based on the position information of each bright and dark pixel, and each bright and dark line includes multiple bright and dark pixels.
[0091] S2302, determining the direction of the bright and dark line to which each bright and dark pixel belongs according to the position information of each bright and dark pixel and the parameters of the screen to be tested.
[0092] Specifically, S2302 includes S2302a and S2302b, wherein:
[0093] S2302a, performing calculations based on the position information of each bright and dark pixel and the parameters of the screen to be tested to obtain the relative position information of each bright and dark pixel.
[0094] In some embodiments, taking the light board as an example, the relative position information of each bright and dark pixel is determined according to the position information of each bright and dark pixel, the position information of any top corner pixel of the screen to be tested and the size information of each light board. Any top corner of the display screen includes: the upper left corner, the lower left corner, the upper right corner, or the lower right corner.
[0095] Exemplarily, the relative position information of each bright and dark pixel satisfies the following formula:
[0096] x=(x line -X led ) / w panel ,
[0097] y=(y line -Y led ) / h panel ,
[0098] Among them, x represents the relative position information of bright and dark pixels in the horizontal direction, x line Indicates the horizontal position information of bright and dark pixels, X ledIndicates the horizontal position information of the top left corner pixel of the screen to be tested, w panel Indicates the width of a light board. y indicates the relative position information of bright and dark pixels in the vertical direction. line Indicates the vertical position information of bright and dark pixels, Y led Indicates the vertical position information of the top left corner pixel of the screen to be tested, h panel It should be noted that the above formula is explained by taking the top corner pixel of the upper left corner of the screen to be tested as an example, and the calculation formula of other top corner pixels of the screen to be tested can be obtained by simply transforming the above formula, which will not be described in detail in the embodiment of the present application.
[0099] The position information of the top pixel in the upper left corner of the screen to be tested in the above formula (X led , Y led ) can be directly obtained by the electronic device from the screen to be tested, the size information of each light board can also be directly obtained by the electronic device from the screen to be tested, or the electronic device can obtain the size information of the screen to be tested, that is, the width and height of the screen to be tested, and the number of light boards corresponding to the horizontal and vertical directions in the screen to be tested, and the electronic device can calculate the size information of each light board.
[0100] Specifically, the width and height of each light panel satisfy the following formula:
[0101] w panel =W / num1,
[0102] h panel =H / num2,
[0103] Wherein, W is the width of the screen to be tested, num1 is the number of light boards in the horizontal direction, H is the height of the screen to be tested, and num2 is the number of light boards in the vertical direction.
[0104] S2302b, determining the direction of the bright-dark line to which each bright-dark pixel belongs according to the relative position information of each bright-dark pixel.
[0105] In a possible implementation, the direction of each bright or dark line can be determined based on the relative position information of any bright or dark pixel in each bright or dark line. Preferably, the direction of each bright or dark line is determined based on the relative position information of the starting bright or dark pixel or the ending bright or dark pixel in each bright or dark line.
[0106] In another possible implementation, the orientation of the bright and dark line to which each bright and dark pixel belongs is determined based on the position information of the bright and dark pixels, the relative position information of the bright and dark pixels, the position information of any vertex pixel of the screen to be tested, and the size information of each light board.
[0107] In some embodiments, the position information of each bright or dark pixel may be used to determine whether the bright or dark line to which the pixel belongs is in the horizontal direction or the vertical direction, and then the specific direction of the bright or dark line in the screen to be tested may be determined in combination with the parameters of the screen to be tested.
[0108] Exemplarily, determining whether the light and dark line to which the pixel belongs belongs to the horizontal direction or the vertical direction according to the position information of each light and dark pixel is specifically implemented as follows: according to the position information of each light and dark pixel, determining the number of light and dark pixels corresponding to the light and dark line to which the light and dark pixel belongs in the horizontal direction and the vertical direction respectively, comparing the number of light and dark pixels corresponding to the light and dark line to which the light and dark pixel belongs in the horizontal direction and the vertical direction respectively, and determining the direction of the light and dark line to which the light and dark pixel belongs. If the number of light and dark pixels corresponding to the light and dark line in the horizontal direction is greater than the number of light and dark pixels corresponding to the light and dark line in the vertical direction, then the direction of the light and dark line is determined to be the horizontal direction, and if the number of light and dark pixels corresponding to the light and dark line in the horizontal direction is less than or equal to the number of light and dark pixels corresponding to the light and dark line in the vertical direction, then the direction of the light and dark line is determined to be the vertical direction.
[0109] For example, for each bright and dark line, the starting pixel and the ending pixel of the bright and dark line can be determined according to the position information of the bright and dark pixels included in the bright and dark line. Specifically, for the bright and dark pixels with the same position information in the vertical direction, they belong to the same bright and dark line. In the horizontal direction, the difference between the position information of the ending pixel and the position information of the starting pixel represents the number of pixels included in the bright and dark line in the horizontal direction. It can be understood that the number of bright and dark pixels corresponding to the bright and dark line in the vertical direction is one. For ease of understanding, the number of bright and dark pixels corresponding to the bright and dark line in the horizontal direction and the vertical direction can be understood as the width w and height h of a bright and dark line.
[0110] For another example, the number of bright and dark pixels corresponding to the bright and dark lines to which the bright and dark pixels belong in the horizontal and vertical directions may also be obtained by counting the number of bright and dark pixels on the bright and dark lines. It can be understood that the bright and dark pixels with the same position information in the vertical direction may be arranged in ascending order in the horizontal direction to form a bright and dark line, and the number of bright and dark pixels corresponding to the bright and dark lines in the horizontal and vertical directions may be obtained by counting the number of pixels with the same position information in the vertical or horizontal direction in the position information of the bright and dark pixels.
[0111] The embodiment of the present application can determine whether the bright or dark line is in the horizontal direction or the vertical direction, and can further determine whether the bright or dark line is on the left or the right in the horizontal direction, and whether it is above or below the screen to be tested in the vertical direction.
[0112] When it is determined that the direction of the bright and dark lines to which the bright and dark pixels belong is horizontal, the horizontal orientation of the bright and dark lines to which each bright and dark pixel belongs is determined based on the horizontal position information of the bright and dark pixels, the relative position information of the bright and dark pixels in the horizontal direction, the horizontal position information of the pixels at any vertex of the screen to be tested, and the horizontal size information of each light board.
[0113] In some embodiments, when it is determined that the direction of the bright and dark lines to which the bright and dark pixels belong is vertical, the vertical orientation of the bright and dark lines to which each bright and dark pixel belongs is determined based on the vertical position information of the bright and dark pixels, the relative position information of the bright and dark pixels in the vertical direction, the vertical position information of the pixels at any top corner of the screen to be tested, and the vertical size information of each light board.
[0114] Specifically, the orientation of the bright and dark line to which each bright and dark pixel belongs is determined in the following manner:
[0115] orientation x =min(x line -(x+1)*w panel -X led , x line -x*w panel -X led ),
[0116] orientation y =min(y line -(y+1)*w panel -Y led ,y line -y*w panel -Y led ),
[0117] Among them, orientation x Represents the horizontal position of the light and dark lines to which the bright and dark pixels belong, including left and right; orientation y Represents the vertical position of the light and dark lines to which the light and dark pixels belong, including up and down.
[0118] If orientation x =x line -(x+1)*w panel -X led , then the horizontal orientation of the bright and dark lines to which the bright and dark pixels belong is left; if orientation x =x line -x*w panel -X led , then the horizontal direction of the bright and dark lines to which the bright and dark pixels belong is right; if orientationy =y line -(y+1)*w panel -Y led , then the vertical orientation of the bright and dark lines to which the bright and dark pixels belong is upward; if orientation y =y line -y*w panel -Y led , then the vertical position of the bright and dark lines to which the bright and dark pixels belong is downward.
[0119] Optionally, in order to avoid that the bright and dark elements in the bright and dark lines are not recognized, the unrecognized bright and dark elements can be supplemented to make the recognition of the bright and dark lines more accurate. Based on this, the bright and dark line positioning method provided in the embodiment of the present application also includes:
[0120] According to the starting point and the end point of the bright and dark line, the position information of each unidentified bright and dark pixel in the bright and dark line is supplemented to obtain the supplemented bright and dark line.
[0121] Since the bright and dark lines are in the horizontal or vertical direction, taking the coordinate position information as an example, they increase along the x-axis or y-axis. Therefore, when the starting point and end point of the bright and dark lines are known, the position information of each bright and dark pixel in the bright and dark lines can be determined according to the position information of the starting point and end point of the bright and dark lines, thereby supplementing the unidentified bright and dark pixels in the bright and dark lines.
[0122] In the embodiment of the present application, after the bright and dark lines are determined, in order to improve the display effect of the screen to be tested, the bright and dark lines on the screen to be tested need to be corrected.
[0123] Exemplarily, the brightness of the lamp beads around each bright and dark pixel in the completed bright and dark lines is adjusted to complete the bright and dark line correction of the screen to be tested.
[0124] In a possible implementation, the correction coefficients of the lamp beads around the bright and dark pixels are adjusted to achieve the purpose of adjusting the bright and dark pixels and complete the brightness correction. Specifically, the brightness of the lamp beads around the bright and dark lines is increased, the average brightness of the lamp beads around the bright and dark lines is taken for display, or the brightness of the lamp beads around the bright and dark lines is adjusted smoothly in a gradient manner.
[0125] Optionally, there are usually multiple light boards on the screen to be tested, and there are bright and dark lines across the light boards. Since the bright and dark lines are in the same direction, when identifying the direction, it is only necessary to keep the direction of the starting position information consistent. The position information increases in the horizontal or vertical direction to determine the relative position information of all the bright and dark lines.
[0126] Exemplarily, when a bright or dark line spans across multiple light boards, the position information of the starting pixel in the bright or dark line is calculated based on the parameters of the screen to be tested to determine the position information of the ending pixel in the bright or dark line.
[0127] For example, taking the direction of the bright and dark lines as the horizontal direction, the end point pixel coordinates satisfy the following formula:
[0128] x end =x+w,
[0129] y end =y.
[0130] Since the bright and dark lines are located in the gap of the light board or the box, the correction of the bright and dark lines requires the correction of the lamp beads on the light board or the box at the adjacent position. At this time, the position information and orientation information of the adjacent bright and dark lines need to be supplemented. For example: the position information and orientation information of the bright and dark lines are (15, 1, 'down'), then the adjacent position information and orientation information (15, 2, 'up') need to be supplemented. Exemplarily, the position information and orientation information of the bright and dark lines in the embodiment of the present application are determined based on the known bright and dark line information.
[0131] It should be noted that the division operation in the above formula may be an integer division operation to obtain the integer part of the quotient.
[0132] Optionally, in S210, the image to be identified is obtained only when the test image is displayed on the screen to be tested. Therefore, before S210, the embodiment of the present application provides an exemplary flow chart of the generation and display process of the test image, such as Figure 3 As shown, including:
[0133] S310, connecting the screen to be tested.
[0134] For example, the screen to be tested may be Figure 1 The display screen in the medium-bright dark line positioning system. Electronic devices can be connected to the screen to be tested through wired connection and wireless connection. For details, please refer to Figure 1 The connection method between the display screen and the electronic device will not be described in detail in the embodiments of the present application.
[0135] S320, obtaining parameters of the screen to be tested.
[0136] In some embodiments, when the electronic device is connected to the screen to be tested, the electronic device can obtain parameters of the screen to be tested.
[0137] In some embodiments, the parameters of the screen to be tested include screen parameters and configuration parameters, the screen parameters are used to indicate the resolution of the screen to be tested, and the configuration parameters are used to indicate the number of types to be tested in the screen to be tested.
[0138] Exemplarily, the type to be tested includes at least one of the light board and the box of the screen to be tested, the configuration parameters may include the number of corresponding parameters to be tested in the horizontal and vertical directions of the screen to be tested, and the resolution of the screen to be tested includes the number of corresponding pixels of the screen to be tested in the horizontal and vertical directions.
[0139] S330, generating a test image according to the parameters of the screen to be tested.
[0140] In a possible implementation, the resolution corresponding to the type to be tested can be determined according to the screen parameters and configuration parameters of the screen to be tested, and then the test image can be generated according to the resolution corresponding to the type to be tested and the number of types to be tested. The resolution corresponding to the type to be tested is used to indicate the number of pixels corresponding to the type to be tested in the horizontal direction and the vertical direction respectively.
[0141] Exemplarily, taking the type to be tested as a light board as an example, the configuration parameters may include the number of light boards in the horizontal direction and the number of light boards in the vertical direction. The number of pixels corresponding to each light board in the horizontal direction and the vertical direction can be determined based on the number of pixels corresponding to the screen to be tested in the horizontal direction and the vertical direction, the number of light boards in the horizontal direction and the number of light boards in the vertical direction, respectively. Thus, a test chart corresponding to the light board can be generated based on the number of light boards in the horizontal direction, the number of light boards in the vertical direction, the number of pixels corresponding to each light board in the horizontal direction, and the number of pixels corresponding to each light board in the vertical direction. It can be understood that the number of pixels corresponding to each light board in the horizontal direction can be determined based on the number of light boards in the horizontal direction and the number of pixels corresponding to the screen to be tested in the horizontal direction. Similarly, the number of pixels corresponding to each light board in the horizontal direction can also be obtained, which will not be repeated in this application.
[0142] It should be noted that the specific process of generating the test image corresponding to the cabinet is similar to the specific description of generating the test image corresponding to the light board in the above example, and will not be repeated here for the sake of brevity.
[0143] For example, Figure 4 The figure shows a test image corresponding to a light board provided in an embodiment of the present application. Figure 4 In the embodiment, the number of light panels in the horizontal direction is 16, and the number in the vertical direction is also 12. Figure 5 The figure shows a test image corresponding to a box provided in an embodiment of the present application. Figure 5 In the example, the number of boxes in the horizontal direction is 4, and the number in the vertical direction is also 4. It can be understood that although Figure 4 The number of pixels corresponding to each light board in the horizontal direction and the number of pixels corresponding to each light board in the vertical direction are not shown, but the corresponding pixels do exist in the actual test image.
[0144] S340: Send instruction information to the screen to be tested.
[0145] The indication information is used to instruct the screen to be tested to display a test image.
[0146] In some embodiments, the indication information can be generated for the electronic device to receive user selections. It can be understood that the user can choose to test the light board of the screen to be tested, or can choose to test the cabinet of the screen to be tested. Each time, the light board or the cabinet can be instructed to be tested, that is, the indication information includes the light board or the cabinet, or can include both the light board and the cabinet. When the indication information includes the light board and the cabinet, the screen to be tested can be displayed in a default order. The default order can be light board first and then cabinet, or cabinet first and then light board. The present application does not limit this. Alternatively, the indication information can include the display order indicated by the user, so that the electronic device displays the test image in the display order indicated by the indication information.
[0147] In summary, an embodiment of the present application provides a method for locating bright and dark lines, by acquiring an image to be identified including a test image generated according to parameters of a screen to be tested, determining the gradient parameters and gradient directions of each pixel in the image to be identified; locating at least one bright and dark line in the image to be identified according to the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested. In this way, the bright and dark lines in the screen to be tested can be automatically and accurately located through the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested, thereby solving the problem of inaccurate positioning of the bright and dark lines in the screen to be tested by manual positioning, and there is no need to manually adjust the bright and dark lines, thereby saving time and effort in the process of identifying the bright and dark lines of the screen to be tested, and realizing an intelligent process of identifying the bright and dark lines of the screen to be tested.
[0148] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0149] Corresponding to the bright and dark line positioning method in the above embodiment, Figure 6 This is a structural block diagram of a bright and dark line locating device provided in an embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.
[0150] See also Figure 6 , the device comprises:
[0151] An acquisition module 601 is used to acquire an image to be recognized, where the image to be recognized includes a test image generated according to parameters of a screen to be tested;
[0152] A determination module 602 is used to determine the gradient parameter and gradient direction of each pixel in the image to be identified;
[0153] The positioning module 603 is used to locate at least one bright or dark line in the image to be identified according to the gradient parameters and gradient direction of each pixel in the image to be identified and the parameters of the screen to be tested.
[0154] Optionally, the positioning module 603 is also used to: screen each pixel according to the gradient parameters and gradient direction of each pixel in the image to be identified to determine multiple light and dark pixels; determine the direction of the light and dark lines to which each light and dark pixel belongs according to the position information of each light and dark pixel and the parameters of the screen to be tested; and locate at least one light and dark line according to the position information of each light and dark pixel and the direction of the light and dark line to which each light and dark pixel belongs.
[0155] Optionally, the positioning module 603 is further used to: compare each pixel with the gradient parameters and gradient directions of the pixels around each pixel, and if the gradient parameters and gradient directions of each pixel are greater than the gradient parameters and gradient directions of the pixels around each pixel, determine the pixel as a candidate pixel;
[0156] The candidate pixels are screened according to the gradient parameter of each pixel in the candidate pixels to determine a plurality of bright and dark pixels.
[0157] Optionally, the positioning module 603 is further used to: screen the candidate pixels according to the gradient parameter of each pixel in the candidate pixels to determine a plurality of bright and dark pixels, including:
[0158] For each pixel in the candidate pixels, the gradient parameter of the pixel is compared with a preset maximum gradient threshold and a preset minimum gradient threshold respectively;
[0159] If the gradient parameter of a pixel is greater than the maximum gradient threshold, the pixel is determined as a bright or dark pixel;
[0160] If the gradient parameter of a pixel is less than the minimum gradient threshold, the pixel is deleted;
[0161] If the gradient parameter of the pixel is less than the maximum gradient threshold and the gradient parameter of the pixel is greater than the minimum gradient threshold, whether the pixel is a bright or dark pixel is determined according to the position information of the pixel.
[0162] Optionally, the positioning module 603 is further used to determine whether a pixel is a bright or dark pixel according to the position information of the pixel, including:
[0163] According to the position information of the pixel, find out whether the surrounding area of the pixel includes bright and dark pixels;
[0164] If the pixel is surrounded by bright and dark pixels, the pixel is determined as a bright and dark pixel;
[0165] If there are no bright or dark pixels around the pixel, the pixel will be deleted.
[0166] Optionally, the determination module 602 is further used to: calculate according to the position information of each bright and dark pixel and the parameters of the screen to be tested to obtain the relative position information of each bright and dark pixel;
[0167] According to the relative position information of each bright and dark pixel, the direction of the bright and dark line to which each bright and dark pixel belongs is determined.
[0168] Optionally, the positioning module 603 is further used for:
[0169] Preprocess the pixels, including grayscale processing and denoising;
[0170] The preprocessed pixels are calculated to obtain the gradient parameters and gradient direction of each pixel.
[0171] Optionally, the device further comprises:
[0172] A supplementing module is used to supplement the position information of each unidentified bright and dark pixel in the bright and dark line according to the starting point and the end point of the bright and dark line to obtain the supplemented bright and dark line;
[0173] The correction module is used to adjust the brightness of the lamp beads around each bright and dark pixel in the completed bright and dark lines to complete the bright and dark line correction of the screen to be tested.
[0174] In summary, the embodiments of the present application provide a bright and dark line positioning device and a bright and dark line positioning method, which obtain an image to be identified including a test image generated according to the parameters of the screen to be tested, and determine the gradient parameters and gradient directions of each pixel in the image to be identified; according to the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested, at least one bright and dark line in the image to be identified is positioned, so that the bright and dark lines in the screen to be tested can be automatically and accurately positioned through the gradient parameters and gradient directions of each pixel in the image to be identified and the parameters of the screen to be tested, thereby solving the problem of inaccurate positioning of the bright and dark lines in the screen to be tested by manual positioning, and there is no need to manually adjust the bright and dark lines, so that the process of identifying the bright and dark lines of the screen to be tested is time-saving and labor-saving, and the process of intelligently identifying the bright and dark lines of the screen to be tested is realized.
[0175] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Figure 7 A structural block diagram of an electronic device provided in an embodiment of the present application, such as Figure 7 As shown, the electronic device provided in this embodiment includes: a memory 71 and a processor 72, the memory 71 is used to store a computer program 73; the processor 72 is used to execute the method described in the above method embodiment when calling the computer program 73.
[0176] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0177] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiment is implemented.
[0178] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the method described in the above method embodiment when executing the computer program product.
[0179] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0180] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0181] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0182] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A bright and dark line positioning method, characterized in that: The method comprises: Acquire an image to be recognized, wherein the image to be recognized includes a test image generated according to parameters of a screen to be tested; Determining the gradient parameter and gradient direction of each pixel in the image to be identified; At least one bright or dark line in the image to be identified is located according to the gradient parameter and gradient direction of each pixel in the image to be identified and the parameters of the screen to be tested.
2. The method according to claim 1, characterized in that The step of locating at least one bright or dark line in the image to be identified according to the gradient parameter and gradient direction of each pixel in the image to be identified and the parameters of the screen to be tested comprises: According to the gradient parameter and gradient direction of each pixel in the image to be identified, each pixel is screened to determine a plurality of bright and dark pixels; Determine the direction of the bright and dark line to which each bright and dark pixel belongs according to the position information of each bright and dark pixel and the parameters of the screen to be tested; The at least one bright and dark line is located according to the position information of each bright and dark pixel and the direction of the bright and dark line to which each bright and dark pixel belongs.
3. The method according to claim 2, characterized in that The step of screening each pixel according to the gradient parameter and gradient direction of each pixel in the image to be identified to determine a plurality of bright and dark pixels includes: Compare the gradient parameters and gradient directions of each pixel with those of the pixels around each pixel, and if the gradient parameters and gradient directions of each pixel are greater than the gradient parameters and gradient directions of the pixels around each pixel, determine the pixel as a candidate pixel; The candidate pixels are screened according to the gradient parameter of each pixel in the candidate pixels to determine a plurality of the bright and dark pixels.
4. The method according to claim 3, characterized in that The step of screening the candidate pixels according to the gradient parameter of each pixel in the candidate pixels to determine a plurality of the bright and dark pixels comprises: For each of the candidate pixels, comparing the gradient parameter of the pixel with a preset maximum gradient threshold and a preset minimum gradient threshold respectively; If the gradient parameter of the pixel is greater than the maximum gradient threshold, the pixel is determined as the bright and dark pixel; If the gradient parameter of the pixel is less than the minimum gradient threshold, deleting the pixel; If the gradient parameter of the pixel is less than the maximum gradient threshold and the gradient parameter of the pixel is greater than the minimum gradient threshold, it is determined whether the pixel is the bright or dark pixel according to the position information of the pixel.
5. The method according to claim 4, characterized in that The determining whether the pixel is the bright or dark pixel according to the position information of the pixel comprises: According to the position information of the pixel, searching whether the pixel is surrounded by bright and dark pixels; If the pixel is surrounded by the bright and dark pixels, the pixel is determined to be the bright and dark pixel; If the pixel is not surrounded by the bright or dark pixels, the pixel is deleted.
6. The method according to claim 1, characterized in that Determining the direction of the bright and dark line to which each bright and dark pixel belongs according to the position information of each bright and dark pixel and the parameters of the screen to be tested includes: Calculating according to the position information of each of the bright and dark pixels and the parameters of the screen to be tested to obtain the relative position information of each of the bright and dark pixels; According to the relative position information of each of the bright and dark pixels, the direction of the bright and dark line to which each of the bright and dark pixels belongs is determined.
7. The method according to claim 1, characterized in that The step of determining the gradient parameter and gradient direction of each pixel in the image to be identified includes: Preprocessing the pixels, wherein the preprocessing includes grayscale processing and denoising processing; The preprocessed pixels are calculated to obtain the gradient parameter and gradient direction of each pixel.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: According to the starting point and the end point of the bright and dark line, the position information of each of the unidentified bright and dark pixels in the bright and dark line is supplemented to obtain a supplemented bright and dark line; The brightness of the lamp beads around each of the light and dark pixels in the completed light and dark lines is adjusted to complete the light and dark line correction of the screen to be tested.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the method according to any one of claims 1 to 8 when calling the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Image grayscale data correction method and system, storage medium and electronic equipment
CN120823135A