A method and device for verifying a sampled image, a computer device and a storage medium
By monitoring the sampled images captured by the image processing module and comparing them with the image data before and after the refresh of the video memory module, the problem of not being able to verify the correctness of the image data captured by the image processing module in the prior art is solved, and the accurate verification of the function of the image processing module is realized.
Patent Information
- Application Number
- CN202410565233.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-05-08
AI Technical Summary
Existing technologies cannot effectively verify whether the image data captured by the image processing module is correct, especially when video data is updated and changed, as the human eye cannot directly check whether the output image of the image processing module is correct.
By monitoring the sampled image captured by the image processing module, the target pixel and other sampled pixels are determined, and compared with the image data before and after the refresh by the video memory module. The first and second comparison results are obtained to determine the correctness of the sampled image captured by the image processing module.
This enables accurate verification of the correctness of the sampled images captured by the image processing module when video data is updated or changed, thereby verifying the completeness of the image processing module's functions.
Smart Images

Figure CN118537595B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a verification method and device of a sampled image, a computer device and a storage medium. BACKGROUND
[0002] Image processing modules are widely used in various video-related devices to realize functions such as video compression, remote display, etc. The image processing module captures image data by directly reading from the video memory or monitoring other video data interfaces. Then, the image data is processed by using the built-in functional units to realize the required algorithm, and the processing result is output to the downstream other modules or written back to the video memory. Therefore, the completeness of the functions of the image processing module is very important.
[0003] At present, the output image of the image processing module is usually directly checked by the human eye to determine the completeness of the functions of the image processing module. However, the video data is updated and changed, and when the image processing module acquires the video data through the video interface, there may be a case that part of the acquired video data is the image data before refreshing and part of the acquired video data is the image data after refreshing. In this case, the human eye cannot directly check whether the output image of the image processing module is correct. The output image of the image processing module depends on the image data captured by the image processing module. Therefore, how to verify the correctness of the image data captured by the image processing module is very crucial. SUMMARY
[0004] Therefore, the present application provides a verification method and device of a sampled image, a computer device and a storage medium to solve the problem that the correctness of the image data captured by the image processing module cannot be verified.
[0005] In a first aspect, the present application provides a method for verifying a sampling image, the method comprising: when an image processing module captures a sampling image, listening to the sampling image, the sampling image comprising N sampling pixels, each sampling pixel in the sampling image corresponding to a sampling optical three primary color RBG value; determining a target pixel in the sampling image, the target pixel being a pixel corresponding to a first refreshing position of a first image refreshed to a second image, the first image being an image before refreshing by a display memory module, and the second image being an image after refreshing by the display memory module; determining N1 first sampling pixels and N2 second sampling pixels in other sampling pixels, the N1 first sampling pixels each being a pixel before refreshing by the display memory module, the N2 second sampling pixels each being a pixel after refreshing by the display memory module, the other sampling pixels being remaining pixels except the target pixel in the sampling image, the number of the other sampling pixels being N-1, and N1+N2=N-1; comparing the N1 first sampling pixels with pixels of the first image to obtain a first comparison result, the first comparison result being used to indicate correctness of the N1 first sampling pixels captured by the image processing module; comparing the N2 second sampling pixels with pixels of the second image to obtain a second comparison result, the second comparison result being used to indicate correctness of the N2 second sampling pixels captured by the image processing module; and determining correctness of the sampling image captured by the image processing module according to the first comparison result and the second comparison result.
[0006] Based on the method of the first aspect, when the image processing module captures the sampling image from the display memory module, the sampling image can be listened to, the target pixel, the N1 first sampling pixels and the N2 second sampling pixels in the sampling image can be determined, the N1 first sampling pixels can be compared with the pixels of the first image to obtain the first comparison result, the N2 second sampling pixels can be compared with the pixels of the second image to obtain the second comparison result, and correctness of the sampling image captured by the image processing module can be determined according to the first comparison result and the second comparison result.
[0007] Since the sampling image is obtained when the image processing module captures the sampling image, the first image is an image before refreshing by the display memory module, and the second image is an image after refreshing by the display memory module, the sampling pixels of the sampling image and the pixels of the first image and the second image can be compared to determine whether the sampling pixels captured by the image processing module during refreshing of the first image to the second image are correct, to determine whether the sampling image captured by the image processing module is correct, and to further verify whether the function of the image processing module is complete.
[0008] In an optional implementation, the target pixel in the sampling image is determined by: traversing each sampling pixel in the sampling image, comparing whether the sampling RBG value corresponding to each sampling pixel satisfies a first preset condition, and when a first sampling pixel satisfying the first preset condition is detected, determining the sampling pixel as the target pixel, the first preset condition being that the sampling RBG value corresponding to the sampling pixel is consistent with the RBG value of the pixel at the pixel position corresponding to the sampling pixel in the second image.
[0009] Based on the above method, the first pixel in the first image corresponding to the first refreshing position of the second image can be determined, that is, the first different RBG value position in the pixels of the first image and the second image, also referred to as the first overlapping position, can be determined, so as to facilitate subsequent determination of whether other sampling pixels are pixels before the refreshing of the display memory module or pixels after the refreshing of the display memory module, taking the target pixel as a starting point.
[0010] In an optional implementation, the N1 first sampling pixels and the N2 second sampling pixels in the other sampling pixels are determined by: obtaining a capturing image speed, a capturing manner of the image processing module, and a scanning manner and a refreshing speed of the display memory module refreshing the image; determining a first distance between the target pixel and each sampling pixel in the other sampling pixels based on the capturing manner of the image processing module; determining a second distance between the target pixel and each sampling pixel in the other sampling pixels based on the scanning manner of the display memory module refreshing the image; and determining the N1 first sampling pixels and the N2 second sampling pixels according to the first distance, the second distance, the capturing image speed, and the refreshing speed.
[0011] Based on the above method, the N1 first sampling pixels and the N2 second sampling pixels can be determined based on the capturing image speed, the capturing manner of the image processing module, and the scanning manner and the refreshing speed of the display memory module refreshing the image, so as to distinguish the sampling pixels before the refreshing of the display memory module from the sampling pixels after the refreshing of the display memory module in the other sampling pixels, and facilitate subsequent comparison of the sampling pixels in the sampling image, the pixels of the first image, and the pixels of the second image.
[0012] In an optional implementation, the other sampling pixels include the to-be-tested pixel, and the determining of the N1 first sampling pixels and the N2 second sampling pixels according to the first distance, the second distance, the capturing image speed, and the refreshing speed includes: determining the to-be-tested pixel as the first sampling pixel or the second sampling pixel according to the first distance between the target pixel and the to-be-tested pixel, the second distance between the target pixel and the to-be-tested pixel, the capturing image speed, and the refreshing speed, including: calculating a first ratio value of the first distance between the target pixel and the to-be-tested pixel and the capturing image speed; calculating a second ratio value of the second distance between the target pixel and the to-be-tested pixel and the refreshing speed; determining the to-be-tested pixel as the first sampling pixel in a case where the first ratio value is less than the second ratio value; and determining the to-be-tested pixel as the second sampling pixel in a case where the first ratio value is greater than the second ratio value.
[0013] Based on the above method, the first ratio value is the capturing time of the image processing module for capturing the sampling image, the second ratio value is the refreshing time of the display memory module for refreshing the image, and based on the capturing time and the refreshing time, it can be determined whether the sampling pixel in the sampling image is refreshed by the display memory module, and then it can be distinguished whether the to-be-tested pixel in the sampling pixel is the first sampling pixel or the second sampling pixel.
[0014] In an optional implementation, the comparing of the N1 first sampling pixels with the pixels of the first image to obtain the first comparison result includes: obtaining the first pixel position of each first sampling pixel in the N1 first sampling pixels; and comparing the sampling RGB value corresponding to each first sampling pixel with the RGB value corresponding to the pixel at the first pixel position in the first image to obtain the first comparison result.
[0015] Based on the above method, the sampling RGB value corresponding to the first sampling pixel and the sampling RGB value corresponding to the pixel at the same first pixel position in the first image can be compared to determine whether the N1 first sampling pixels captured by the image processing module are correct.
[0016] In an optional implementation, the capturing manner includes data row capturing and data block capturing, and the obtaining of the first pixel position of each first sampling pixel in the N1 first sampling pixels includes: in a case where the capturing manner is the data row capturing, obtaining address information of each first sampling pixel accessed by the image processing module to the display memory module; and determining the first pixel position according to the address information; or in a case where the capturing manner is the data block capturing, counting the number of times of capturing the sampling pixel by the image processing module; and determining the first pixel position according to the number of times of capturing the sampling pixel by the image processing module.
[0017] Based on the above method, the pixel position of the first sampling pixel can be determined according to different capturing manners, so that the RGB value of the first sampling pixel and the RGB value of the pixel in the first image can be compared based on the pixel position of the first sampling pixel subsequently.
[0018] In an optional implementation, the comparing of the N2 second sampling pixels with the pixels of the second image to obtain the second comparison result comprises: obtaining a second pixel position of each of the N2 second sampling pixels; and comparing a sampling RGB value corresponding to each of the N2 second sampling pixels with an RGB value corresponding to a pixel at the second pixel position in the second image to obtain the second comparison result.
[0019] Based on the above method, the sampling RGB value corresponding to the second sampling pixel at the same second pixel position and the sampling RGB value corresponding to the pixel of the second image can be compared to determine whether the N2 second sampling pixels captured by the image processing module are correct.
[0020] In an optional implementation, the determining of the correctness of the sampling image captured by the image processing module according to the first comparison result and the second comparison result comprises: in a case where the first comparison result and the second comparison result satisfy a second preset condition, determining that the sampling image captured by the image processing module is correct, the second preset condition being that the sampling RGB value corresponding to each of the first sampling pixels is consistent with the RGB value of the pixel at the first pixel position in the first image, and the sampling RGB value corresponding to each of the second sampling pixels is consistent with the RGB value of the pixel at the second pixel position in the second image; and in a case where the first comparison result and the second comparison result do not satisfy the second preset condition, determining that the sampling image captured by the image processing module is incorrect.
[0021] Based on the above method, whether the sampling image captured by the image processing module is correct can be determined based on whether the sampling RGB value corresponding to each of the first sampling pixels is consistent with the RGB value of the pixel at the first position in the first image and whether the sampling RGB value corresponding to each of the second sampling pixels is consistent with the RGB value of the pixel at the second pixel position in the second image, so as to further verify whether the function of the image processing module is complete.
[0022] In a second aspect, the present application provides a verification device for a sampling image, characterized in that the device comprises: an acquisition module configured to listen to a sampling image when an image processing module captures the sampling image from a display memory module, the sampling image comprising N sampling pixels, each of the sampling pixels in the sampling image corresponding to a sampling RGB value.
[0023] a processing module configured to determine a target pixel in the sampling image, the target pixel being a pixel corresponding to a first refreshing position of a first image refreshed to a second image, the first image being an image before refreshing of the display memory module, and the second image being an image after refreshing of the display memory module.
[0024] The processing module is further configured to determine N1 first sampling pixels and N2 second sampling pixels in the other sampling pixels, the N1 first sampling pixels are all pixels before the refresh of the display memory module, the N2 second sampling pixels are all pixels after the refresh of the display memory module, the other sampling pixels are remaining pixels except the target pixel in the sampling image, the number of the other sampling pixels is N-1, and N1+N2=N-1.
[0025] The processing module is further configured to compare the N1 first sampling pixels with the pixels of the first image to obtain a first comparison result, and the first comparison result is used to indicate the correctness of the N1 first sampling pixels captured by the image processing module.
[0026] The processing module is further configured to compare the N2 second sampling pixels with the pixels of the second image to obtain a second comparison result, and the second comparison result is used to indicate the correctness of the N2 second sampling pixels captured by the image processing module.
[0027] The processing module is further configured to determine the correctness of the sampling image captured by the image processing module according to the first comparison result and the second comparison result.
[0028] In a third aspect, the present application provides a computer device, comprising a memory and a processor, the memory and the processor are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the sampling image verification method in the first aspect or any of the corresponding embodiments.
[0029] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the sampling image verification method in the first aspect or any of the corresponding embodiments.
[0030] In a fifth aspect, the present application further provides a computer program product comprising instructions which, when executed on a computer, cause the computer to perform the method of the aspects described above. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0032] Figure 1 is a schematic diagram of the architecture of the sampling image verification system according to an embodiment of the present application.
[0033] Figure 2is a flowchart of a verification method of a sampled image according to an embodiment of the present application;
[0034] Figure 3 is a pixel refresh diagram at a first time according to an embodiment of the present application;
[0035] Figure 4 is a pixel refresh diagram at a second time according to an embodiment of the present application;
[0036] Figure 5 is a pixel refresh diagram at a third time according to an embodiment of the present application;
[0037] Figure 6 is a structural block diagram of a verification device of a sampled image according to an embodiment of the present application;
[0038] Figure 7 is a hardware structure diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the objects, technical solutions and advantages of embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0040] Video data or image data is usually stored in a display memory. The stored content is color information that each pixel on a display screen should display, for example, optical three primary color values (Red Green Blue, RGB). When a video picture does not change, the display memory stores information of an image with the same size as the display resolution. When the picture changes, an upstream module transmits changed image color information to the display memory and covers existing data of corresponding pixels. A video display interface repeatedly reads information of each pixel and refreshes display color of each pixel according to a fixed time interval. If the video interface reads display information at the same time when video data is updated, a situation that the front half of a picture is unrefreshed content and the back half is refreshed content may occur. Since the situation occurs within a frame and the frame rate of the video is high, a very short image misplacement is captured in vision, which has little effect on actual video watching. Therefore, the protocol of the video interface allows the situation to occur.
[0041] As described in the background, in this case, the human eye cannot directly check whether the output image of the image processing module is correct to determine the functional completeness of the image processing module.
[0042] To address the aforementioned problems, this invention provides a method for verifying sampled images. This method involves monitoring the sampled image when the image processing module captures it from the video memory module, identifying the target pixel, N1 first sampled pixels, and N2 second sampled pixels in the sampled image, comparing the N1 first sampled pixels with pixels in a first image to obtain a first comparison result, comparing the N2 second sampled pixels with pixels in a second image to obtain a second comparison result, and determining the correctness of the sampled image captured by the image processing module based on the first and second comparison results. This approach verifies the completeness of the image processing module's functionality by determining whether the sampled image captured by the image processing module is correct.
[0043] The verification system for the sampled images in this embodiment of the invention can be any Universal Verification Methodology (UVM) verification platform.
[0044] like Figure 1 The diagram shown is a schematic representation of the architecture of a sampled image verification system 10 provided in an embodiment of the present invention. Figure 1 The sampled image verification system 10 includes an image processing module 101, a video memory module 102, and a sampled image verification device 103. Optionally, the sampled image verification system 10 also includes a display interface 104 and a driver 105.
[0045] The image processing module in this embodiment of the invention, for example, image processing module 101, can be any image or video capture and processing circuit. In this embodiment, the image processing module can also be referred to as the device under test (DUT). The image processing module is used to capture sampled images from the video memory module, process the sampled images to obtain an output image, and then transmit the output image back to the video memory module for storage.
[0046] The image verification device in this embodiment of the invention, for example, the image verification device 103, can be a listener and scoreboard assembly. The listener and scoreboard assembly is portable and can be inserted into any UVM verification platform. The image verification device 103 includes a control unit 1031, a slave interface model (also called a bus slave model) 1032, and a comparison module 1033.
[0047] The control unit 1031 comprises a mapping model and a DUT configuration information module. The mapping model comprises a counter or a score board for determining the pixel position of a sample pixel in a sample image captured by the DUT, and determining the corresponding RGB value of the pixel in the corresponding first image or second image according to the pixel position. The DUT configuration information module is configured to receive the configuration information of the DUT.
[0048] In the embodiment of the present application, the bus slave model 1032 is configured to receive the sample image captured by the DUT.
[0049] In the embodiment of the present application, the comparison module 1033 is configured to compare the corresponding RGB values of the pixels in the sample image and the first image (or the second image).
[0050] In the embodiment of the present application, the video memory module, for example, the video memory module 102, can be any video memory, and is configured to store image data and refresh image data.
[0051] In the embodiment of the present application, the display interface 104, for example, the display interface 104, can be any display interface, and is configured to read the video or image data in the video memory module, so as to display the video or image on the display screen.
[0052] In the embodiment of the present application, the driver, for example, the driver 105, is configured to transmit necessary configuration information to the video memory module and the image processing module.
[0053] Optionally, the image processing module 101, the video memory module 102 and the display interface 104 jointly constitute a register translation circuit.
[0054] Figure 1 The sampling image verification system 10 shown is only used for example, and is not used for limiting the technical solutions of the present application. It should be understood by those skilled in the art that the sampling image verification system 10 can also comprise more devices in the specific implementation process, which is not limited.
[0055] According to the embodiment of the present application, a sampling image verification method embodiment is provided. It should be noted that the steps shown in the flowchart of the drawing can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0056] In the embodiment, a sampling image verification method is provided, which can be used in the sampling image verification device described above, Figure 2 is a flowchart of the sampling image verification method according to the embodiment of the present application, as Figure 2 shown, the flowchart comprises the following steps:
[0057] S201: When the image processing module captures a sample image from the video memory module, the sample image is monitored.
[0058] The sample image includes N sample pixels. Each sample pixel in the sample image corresponds to a sample optical three primary color RBG value.
[0059] In an example, the driver transmits the first image and the second image in the configuration information to the video memory module through a register model. The video memory module receives the first image, and in the process of refreshing the first image into the second image according to the refresh mode in the configuration information, the image processing module DUT captures a sample image from the video memory module according to the capture mode in the configuration information. The verification device of the sample image monitors the sample image captured by the DUT.
[0060] The configuration information includes the first image and the pixel corresponding RGB value parameter of the first image, the second image and the pixel corresponding RGB value parameter of the second image, the bandwidth of the bus of the video memory module refreshing the image, the refresh clock frequency and the refresh mode, the bus type of the DUT capturing the sample image, the capture clock frequency and the capture mode of the capture pointer. The capture mode includes data row capture and data block capture. The refresh mode includes data row refresh and data block refresh.
[0061] It can be understood that the first image is the image before the video memory module refreshes. The second image is the image after the video memory module refreshes.
[0062] S202: Determine the target pixel in the sample image.
[0063] The target pixel is the pixel corresponding to the first refresh position of the first image refreshed into the second image.
[0064] In some optional embodiments, the verification device of the sample image traverses each sample pixel in the sample image, compares whether the sample RBG value corresponding to each sample pixel satisfies a first preset condition, and when the first sample pixel satisfying the first preset condition is detected, the sample pixel is determined as the target pixel.
[0065] The first preset condition is that the sample RBG value corresponding to the sample pixel is consistent with the RBG value of the pixel at the pixel position corresponding to the sample pixel in the second image.
[0066] For example, the refresh mode of the video memory module is data row refresh, and the capture mode of the DUT is data block capture. Figure 3 For example, the refresh mode of the video memory module is data row refresh, and the capture mode of the DUT is data block capture. Figure 3This is a pixel refresh diagram at the first moment according to an embodiment of the present invention. The light gray covered area is the refreshed area, and the remaining area is the unrefreshed area. The first sampled pixel captured by the DTU is "0". The verification device of the sampled image traverses the first sampled pixel in the sampled pixels of the sampled image. The first sampled pixel is located in the unrefreshed area, that is, "0" is the sampled pixel before refresh. That is, the sampled RBG value corresponding to the first sampled pixel is consistent with the RBG value of the pixel at the pixel position corresponding to the first sampled pixel in the first image, that is, the first preset condition is not satisfied.
[0067] For example, with Figure 4 For example, Figure 4 This is a pixel refresh diagram at the second moment according to an embodiment of the present invention. The light gray covered area is the refreshed area, and the remaining area is the unrefreshed area. The second sampled pixel captured by the DTU is "1". The verification device of the sampled image traverses the second sampled pixel in the sampled pixels of the sampled image. The second sampled pixel is located in the refreshed area, that is, "1" is the refreshed sampled pixel. That is, the sampled RBG value corresponding to the second sampled pixel is consistent with the RBG value of the pixel at the pixel position corresponding to the second sampled pixel in the second image, that is, the first preset condition is met, that is, the target pixel is determined to be "1".
[0068] S203: Determine N1 first sampled pixels and N2 second sampled pixels from the other sampled pixels.
[0069] The other sampled pixels are the remaining pixels in the sampled image excluding the target pixel. The number of other sampled pixels is N-1.
[0070] In this embodiment of the invention, N1 first sampled pixels are all pixels before the video memory module refresh. N2 second sampled pixels are all pixels after the video memory module refresh. Wherein, N1 + N2 = N - 1.
[0071] In some optional implementations, the image verification device acquires the image capture speed and capture method of the image capture module, and the scanning method and refresh speed of the image refresh module; based on the image capture method of the image processing module, it determines a first distance between the target pixel and each of the other sampled pixels; based on the scanning method of the image refresh module, it determines a second distance between the target pixel and each of the other sampled pixels; and based on the first distance, the second distance, the image capture speed, and the refresh speed, it determines N1 first sampled pixels and N2 second sampled pixels.
[0072] The image capture speed is related to the bus type and capture clock frequency of the DUT capturing the sampled image.
[0073] In the embodiment of the present application, the refresh speed is associated with the bandwidth of the bus of the display memory module refreshing the image and the refresh clock frequency.
[0074] In the embodiment of the present application, the first distance is associated with the capturing mode of the image processing module. For example, if the capturing mode of the image processing module is data block capturing, the first distance between the target pixel "1" and the sampling pixel "4" is 3. Figure 5 For example, Figure 5 is a schematic diagram of refreshing the pixel at the third time according to the embodiment of the present application, the capturing mode of the image processing module is data block capturing, and the first distance between the target pixel "1" and the sampling pixel "4" is 3. For another example, if the capturing mode of the image processing module is data row capturing, the first distance between the target pixel "1" and the sampling pixel "4" is 1.
[0075] In the embodiment of the present application, the second distance is associated with the scanning mode of the display memory module refreshing the image. For example, if the scanning mode of the display memory module refreshing the image is data row refreshing, the second distance between the target pixel "1" and the sampling pixel "3" is 0. Figure 5 For example, if the scanning mode of the display memory module refreshing the image is data row refreshing, the second distance between the target pixel "1" and the sampling pixel "3" is 0. For another example, if the scanning mode of the display memory module refreshing the image is data block refreshing, the second distance between the target pixel "1" and the sampling pixel "3" is 2.
[0076] In some optional embodiments, the other sampling pixels include the to-be-tested pixel. The verification device of the sampling image determines whether the to-be-tested pixel is the first sampling pixel or the second sampling pixel according to the first distance between the target pixel and the to-be-tested pixel, the second distance between the target pixel and the to-be-tested pixel, the capturing speed of the image and the refresh speed.
[0077] In an example, the verification device of the sampling image calculates a first ratio value by calculating the ratio of the first distance between the target pixel and the to-be-tested pixel to the capturing speed of the image, and calculates a second ratio value by calculating the ratio of the second distance between the target pixel and the to-be-tested pixel to the refresh speed. If the first ratio value is less than the second ratio value, it is determined that the to-be-tested pixel is the first sampling pixel. If the first ratio value is greater than the second ratio value, it is determined that the to-be-tested pixel is the second sampling pixel.
[0078] It can be understood that the first ratio value is the capturing time of the DUT capturing the sampling image, and the second ratio value is the refreshing time of the display memory module refreshing the image. If the refresh speed is faster than the capturing speed, the data captured by the DUT after this time will be the refreshed data. If the refresh speed is slower than the capturing speed, the data captured by the DUT after this time is the un-refreshed data. Then it can be determined whether the sampling pixel in the sampling image is refreshed by the display memory module, and it can be further determined whether the to-be-tested pixel in the sampling pixel is the first sampling pixel or the second sampling pixel.
[0079] Optionally, the verification device of the sampling image obtains a capturing image speed at which the image processing module captures the sampling image, a capturing manner, and a scanning manner and a refreshing speed at which the display memory module refreshes the image; and determines the N1 first sampling pixels and the N2 second sampling pixels according to the capturing manner, the scanning manner, the capturing image speed, and the refreshing speed.
[0080] In an example, the verification device of the sampling image determines the N1 first sampling pixels as the sampling pixels after the pixel position corresponding to the target pixel in the sampling image when the capturing manner is data block capturing, the scanning manner is data block capturing, and the capturing image speed is greater than the refreshing speed; or the verification device of the sampling image determines the N1 first sampling pixels as the sampling pixels after the pixel position corresponding to the target pixel in the sampling image when the capturing manner is data row capturing, the scanning manner is data row capturing, and the capturing image speed is greater than the refreshing speed.
[0081] In an example, the verification device of the sampling image determines the N2 second sampling pixels as the sampling pixels after the pixel position corresponding to the target pixel in the sampling image when the capturing manner is data block capturing, the scanning manner is data block capturing, and the capturing image speed is less than the refreshing speed; or the verification device of the sampling image determines the N2 second sampling pixels as the sampling pixels after the pixel position corresponding to the target pixel in the sampling image when the capturing manner is data row capturing, the scanning manner is data row capturing, and the capturing image speed is less than the refreshing speed.
[0082] S204: comparing the N1 first sampling pixels with the pixels of the first image to obtain a first comparison result.
[0083] The first comparison result is used to indicate the correctness of the N1 first sampling pixels captured by the image processing module.
[0084] In some optional embodiments, the verification device of the sampling image obtains a first pixel position of each of the N1 first sampling pixels; and compares a sampling RGB value corresponding to each of the first sampling pixels with an RGB value corresponding to the pixel at the first pixel position in the first image to obtain a first comparison result.
[0085] In an example, the verification device of the sampling image obtains the first pixel position of each of the N1 first sampling pixels by: when the capturing manner is data row capturing, obtaining address information of each of the first sampling pixels accessed by the image processing module to the display memory module; and determining the first pixel position according to the address information; or when the capturing manner is data block capturing, counting a number of times of capturing the sampling pixels by the image processing module; and determining the first pixel position according to the number of times of capturing the sampling pixels by the image processing module.
[0086] For example, in the case that the capturing mode of the DUT is data row capturing, the verification device of the sampled image obtains address information of each first sampled pixel accessed by the DUT to the video memory module, and converts the address information of each first sampled pixel into coordinate information of row and column, i.e., the first pixel position.
[0087] Alternatively, in the case that the capturing mode of the DUT is data block capturing, the verification device of the sampled image counts the number of times of capturing the sampled pixel by the image processing module, converts the number of times of capturing the sampled pixel by the DUT into the number of rows and columns and the number of data blocks, and then determines the first pixel position.
[0088] It can be understood that the first comparison result includes comparison results of N1 first sampled pixels and pixels of the first image. The first comparison result can be that the sampled RGB value corresponding to each first sampled pixel is consistent with the RGB value corresponding to the pixel at the first pixel position in the first image, or that the sampled RGB value corresponding to each first sampled pixel is inconsistent with the RGB value corresponding to the pixel at the first pixel position in the first image, or that the sampled RGB value corresponding to part of the first sampled pixels is inconsistent with the RGB value corresponding to the pixel at the first pixel position in the first image.
[0089] S205: Comparing N2 second sampled pixels with pixels of the second image to obtain a second comparison result.
[0090] The second comparison result is used to indicate the correctness of the N2 second sampled pixels captured by the image processing module.
[0091] In some optional embodiments, the verification device of the sampled image obtains a second pixel position of each second sampled pixel in the N2 second sampled pixels, and compares the sampled RGB value corresponding to each second sampled pixel with the RGB value corresponding to the pixel at the second pixel position in the second image to obtain the second comparison result.
[0092] It can be understood that S205 is described in detail in S204, which is not described here again.
[0093] S206: Determining the correctness of the sampled image captured by the image processing module according to the first comparison result and the second comparison result.
[0094] In some optional embodiments, the verification device of the sampled image determines that the sampled image captured by the image processing module is correct in the case that the first comparison result and the second comparison result satisfy a second preset condition, and determines that the sampled image captured by the image processing module is incorrect in the case that the first comparison result and the second comparison result do not satisfy the second preset condition.
[0095] The second preset condition is that the sampling RGB value corresponding to each first sampling pixel is consistent with the RGB value of the pixel at the first pixel position in the first image, and the sampling RGB value corresponding to each second sampling pixel is consistent with the RGB value of the pixel at the second pixel position in the second image.
[0096] It can be understood that the sampling RGB value of the N1 first sampling pixels of the sampling image is consistent with the RGB value of the pixel of the first image. The sampling RGB value of the N2 second sampling pixels of the sampling image is consistent with the RGB value of the pixel of the second image. That is, it indicates that the sampling image captured by the image processing module is correct.
[0097] Based on the method of S201-S206, the sampling image verification device can compare the sampling pixels of the sampling image with the pixels of the first image and the pixels of the second image to determine whether the sampling pixels captured by the image processing module during the refreshing of the first image to the second image are correct, and to determine whether the sampling image captured by the image processing module is correct, and further to verify whether the function of the image processing module is complete.
[0098] Optionally, after S203, the sampling image verification device can input the N1 first sampling pixels and the N2 second sampling pixels into a reference model to generate golden data.
[0099] The reference model is used to process the N1 first sampling pixels and the N2 second sampling pixels to obtain a processing result. The function of the reference model is consistent with the processing function of the DUT on the captured sampling image.
[0100] Therefore, the sampling image verification device can compare the golden data with the output image data of the DUT to determine whether the output image data of the DUT is correct, and further to determine whether the function of the DUT is complete.
[0101] In the embodiment, a sampling image verification device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0102] The embodiment provides a sampling image verification device, as shown in Figure 6 The device comprises:
[0103] The acquisition module 601 is configured to listen to the sampling image when the image processing module captures the sampling image from the video memory module. The sampling image comprises N sampling pixels, and each sampling pixel in the sampling image corresponds to a sampling RGB value. The acquisition module 601 is configured to listen to the sampling image when the image processing module captures the sampling image from the video memory module. The sampling image comprises N sampling pixels, and each sampling pixel in the sampling image corresponds to a sampling RGB value.
[0104] The processing module 602 is configured to determine a target pixel in the sampling image, the target pixel being a pixel corresponding to a first refreshing position of the first image refreshed to the second image, the first image being an image before refreshing by the display memory module, and the second image being an image after refreshing by the display memory module.
[0105] The processing module 602 is further configured to determine N1 first sampling pixels and N2 second sampling pixels in the other sampling pixels, the N1 first sampling pixels each being a pixel before refreshing by the display memory module, the N2 second sampling pixels each being a pixel after refreshing by the display memory module, the other sampling pixels being remaining pixels in the sampling image except the target pixel, a number of the other sampling pixels being N-1, and N1+N2=N-1.
[0106] The processing module 602 is further configured to compare the N1 first sampling pixels with pixels of the first image to obtain a first comparison result, the first comparison result being used to indicate correctness of the N1 first sampling pixels captured by the image processing module.
[0107] The processing module 602 is further configured to compare the N2 second sampling pixels with pixels of the second image to obtain a second comparison result, the second comparison result being used to indicate correctness of the N2 second sampling pixels captured by the image processing module.
[0108] The processing module 602 is further configured to determine correctness of the sampling image captured by the image processing module according to the first comparison result and the second comparison result.
[0109] In some optional embodiments, the processing module 602 is specifically configured to traverse each sampling pixel in the sampling image, compare whether a sampling RBG value corresponding to each sampling pixel satisfies a first preset condition, and when a first sampling pixel satisfying the first preset condition is detected, determine that the sampling pixel is the target pixel, the first preset condition being that the sampling RBG value corresponding to the sampling pixel is consistent with an RBG value of a pixel at a pixel position corresponding to the sampling pixel in the second image.
[0110] In some optional embodiments, the processing module 602 is further specifically configured to acquire a capturing image speed, a capturing manner of the image processing module for capturing the sampling image, and a scanning manner, a refreshing speed of the display memory module for refreshing the image; the processing module 602 is further specifically configured to determine a first distance between the target pixel and each sampling pixel in the other sampling pixels based on the capturing manner of the image processing module; the processing module 602 is further specifically configured to determine a second distance between the target pixel and each sampling pixel in the other sampling pixels based on the scanning manner of the display memory module for refreshing the image; and the processing module 602 is further specifically configured to determine the N1 first sampling pixels and the N2 second sampling pixels according to the first distance, the second distance, the capturing image speed, and the refreshing speed.
[0111] In some optional embodiments, the other sampling pixels include a to-be-tested pixel, the processing module 602 is further configured to calculate a ratio of a first distance between the target pixel and the to-be-tested pixel to the capture image speed, to obtain a first ratio value; the processing module 602 is further configured to calculate a ratio of a second distance between the target pixel and the to-be-tested pixel to the refresh speed, to obtain a second ratio value; the processing module 602 is further configured to determine that the to-be-tested pixel is the first sampling pixel when the first ratio value is less than the second ratio value; and the processing module 602 is further configured to determine that the to-be-tested pixel is the second sampling pixel when the first ratio value is greater than the second ratio value.
[0112] In some optional embodiments, the processing module 602 is further configured to obtain a first pixel position of each of the N1 first sampling pixels; and the processing module 602 is further configured to compare a sampling RGB value corresponding to each of the first sampling pixels with an RGB value corresponding to a pixel at the first pixel position in the first image, to obtain a first comparison result.
[0113] In some optional embodiments, the capture mode includes data row capture and data block capture; the processing module 602 is further configured to obtain address information of each of the first sampling pixels accessed by the image processing module in the video memory module when the capture mode is the data row capture; the processing module 602 is further configured to determine the first pixel position according to the address information; or the processing module 602 is further configured to count a number of times of capturing the sampling pixels by the image processing module when the capture mode is the data block capture; and the processing module 602 is further configured to determine the first pixel position according to the number of times of capturing the sampling pixels by the image processing module.
[0114] In some optional embodiments, the processing module 602 is further configured to obtain a second pixel position of each of the N2 second sampling pixels; and the processing module 602 is further configured to compare a sampling RGB value corresponding to each of the second sampling pixels with an RGB value corresponding to a pixel at the second pixel position in the second image, to obtain a second comparison result.
[0115] In some optional embodiments, the processing module 602 is further configured to determine that the sampling image captured by the image processing module is correct when the first comparison result and the second comparison result satisfy a second preset condition, the second preset condition being that the sampling RGB value corresponding to each of the first sampling pixels is consistent with the RGB value of the pixel at the first pixel position in the first image, and the sampling RGB value corresponding to each of the second sampling pixels is consistent with the RGB value of the pixel at the second pixel position in the second image; and the processing module 602 is further configured to determine that the sampling image captured by the image processing module is incorrect when the first comparison result and the second comparison result do not satisfy the second preset condition.
[0116] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0117] In this embodiment, the image verification device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0118] This invention also provides a computer device having the above-described features. Figure 6 The device for verifying the sampled image shown.
[0119] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 7 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.
[0120] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0121] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0122] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required for at least one function, etc. The data storage area can store data created by the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid state memory device. In some alternative embodiments, the memory 20 can optionally include memory that is remotely located with respect to the processor 10, and which can be connected to the computer device through a network. Examples of such networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communications network, and combinations thereof.
[0123] The memory 20 can include a volatile memory, such as a random access memory, and / or can include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid state memory device. The memory 20 can also include an array of multi-state flash memory cells, which can be used to store data and / or instructions in multiple states.
[0124] The computer device also includes a communications interface 30 for communicating with other devices or communication networks.
[0125] The embodiments of the present application also provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or implemented as computer code to be originally stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and stored in a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned kinds of storage. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0126] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, can invoke or provide methods and / or technical solutions according to the present application. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source files, executable files, installation package files and the like, and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0127] Although the embodiments of the present application are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A method for verifying sampled images, characterized in that, The method includes: When the image processing module captures a sampled image from the video memory module, it monitors the sampled image, which includes N sampled pixels, and each sampled pixel in the sampled image corresponds to a sampled optical primary color RBG value; The target pixel in the sampled image is determined. The target pixel is the pixel corresponding to the first refresh position when the first image is refreshed to the second image. The first image is the image before the video memory module refreshes, and the second image is the image after the video memory module refreshes. N1 first sampling pixels and N2 second sampling pixels are determined from the other sampling pixels. The N1 first sampling pixels are all pixels before the refresh of the video memory module, and the N2 second sampling pixels are all pixels after the refresh of the video memory module. The other sampling pixels are the remaining pixels in the sampling image other than the target pixel. The number of other sampling pixels is N-1, N1+N2=N-1. The N1 first sampled pixels are compared with the pixels of the first image to obtain a first comparison result. The first comparison result is used to indicate the correctness of the N1 first sampled pixels captured by the image processing module. The N2 second sampled pixels are compared with the pixels of the second image to obtain a second comparison result, which is used to indicate the correctness of the N2 second sampled pixels captured by the image processing module; Based on the first comparison result and the second comparison result, the correctness of the sampled image captured by the image processing module is determined.
2. The method according to claim 1, characterized in that, Determining the target pixel in the sampled image includes: The sampling pixel in the sampled image is traversed, and the sampling RBG value corresponding to each sampling pixel is compared to see if it meets the first preset condition. When the first sampling pixel that meets the first preset condition is detected, the sampling pixel is determined to be the target pixel. The first preset condition is that the sampling RBG value corresponding to the sampling pixel is consistent with the RBG value of the pixel at the same pixel position in the second image.
3. The method according to claim 1, characterized in that, The step of determining N1 first sampled pixels and N2 second sampled pixels from the other sampled pixels includes: The image processing module captures the sampled image at a certain speed and in a certain mode, and the video memory module refreshes the image by a certain scanning mode and in a certain refresh rate. Based on the capture method of the image processing module, a first distance is determined between the target pixel and each of the other sampled pixels; Based on the scanning method of refreshing the image by the video memory module, a second distance is determined between the target pixel and each of the other sampled pixels; The N1 first sampling pixels and the N2 second sampling pixels are determined based on the first distance, the second distance, the image capture speed, and the refresh speed.
4. The method according to claim 3, characterized in that, The other sampled pixels include the pixels to be tested. Determining N1 first sampled pixels and N2 second sampled pixels based on the first distance, the second distance, the image capture speed, and the refresh rate includes: Determining the pixel to be tested as either the first sampled pixel or the second sampled pixel based on a first distance between the target pixel and the pixel to be tested, a second distance between the target pixel and the pixel to be tested, the image capture speed, and the refresh speed includes: Calculate the ratio of the first distance between the target pixel and the pixel to be measured to the speed of the captured image to obtain a first ratio value; Calculate the ratio of the second distance between the target pixel and the pixel to be measured to the refresh rate to obtain the second ratio value; If the first ratio is less than the second ratio, the pixel to be tested is determined to be the first sampled pixel; If the first ratio is greater than the second ratio, the pixel to be tested is determined to be the second sampled pixel.
5. The method according to claim 1, characterized in that, The step of comparing the N1 first sampled pixels with the pixels of the first image to obtain a first comparison result includes: Obtain the position of the first pixel of each of the N1 first sampled pixels; The sampled RGB value corresponding to each first sampled pixel is compared with the RGB value corresponding to the pixel at the first pixel position in the first image to obtain the first comparison result.
6. The method according to claim 5, characterized in that, The capture method includes data row capture and data block capture. Obtaining the first position of each of the N1 first sampled pixels includes: When the capture method is the data row capture, the address information of each first sampled pixel in the video memory module is obtained by the image processing module. The position of the first pixel is determined based on the address information; or, When the capture method is the data block capture, count the number of times the image processing module captures sampled pixels; The position of the first pixel is determined based on the number of times the image processing module captures and samples the pixel.
7. The method according to claim 1, characterized in that, The step of comparing the N2 second sampled pixels with the pixels of the second image to obtain a second comparison result includes: Obtain the position of the second pixel of each of the N2 second sampled pixels; The sampled RGB value corresponding to each second sampled pixel is compared with the RGB value corresponding to the pixel at the second pixel position in the second image to obtain the second comparison result.
8. The method according to claim 7, characterized in that, The step of verifying the correctness of the sampled image captured by the image processing module based on the first comparison result and the second comparison result includes: If the first comparison result and the second comparison result satisfy the second preset condition, the sampled image captured by the image processing module is indeed correct. The second preset condition is that the sampled RGB value corresponding to each first sampled pixel is consistent with the RGB value of the pixel at the first pixel position in the first image, and the sampled RGB value corresponding to each second sampled pixel is consistent with the RGB value of the pixel at the second pixel position in the second image. If the first comparison result and the second comparison result do not meet the second preset condition, then the sampled image captured by the image processing module is indeed incorrect.
9. A verification device for a sampled image, characterized in that, The device includes: The acquisition module is used to monitor the sampled image when the image processing module captures the sampled image from the video memory module. The sampled image includes N sampled pixels, and each sampled pixel in the sampled image corresponds to a sampled optical primary color RBG value. The processing module is used to determine the target pixel in the sampled image, wherein the target pixel is the pixel corresponding to the first refresh position when the first image is refreshed to the second image, the first image is the image before the video memory module refreshes, and the second image is the image after the video memory module refreshes; The processing module is further configured to determine N1 first sampled pixels and N2 second sampled pixels among the other sampled pixels, wherein the N1 first sampled pixels are all pixels before the refresh of the video memory module, and the N2 second sampled pixels are all pixels after the refresh of the video memory module. The other sampled pixels are the remaining pixels in the sampled image other than the target pixel, and the number of the other sampled pixels is N-1, where N1+N2=N-1. The processing module is further configured to compare the N1 first sampled pixels with the pixels of the first image to obtain a first comparison result, wherein the first comparison result is used to indicate the correctness of the N1 first sampled pixels captured by the image processing module; The processing module is further configured to compare the N2 second sampled pixels with the pixels of the second image to obtain a second comparison result, the second comparison result being used to indicate the correctness of the N2 second sampled pixels captured by the image processing module; The processing module is further configured to determine the correctness of the sampled image captured by the image processing module based on the first comparison result and the second comparison result.
10. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the verification method for the sampled image according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to execute the verification method for the sampled image according to any one of claims 1 to 8.
Citation Information
Patent Citations
Shader-based video stream image correction method, device and equipment
CN115082356A
Display system and electronic device
CN116860126A