A fuzzy image comparison method and system for testing a projection system
Through the blurred image comparison method, cutting and comparing the benchmark and pictures to be compared in the screen projection system, the efficiency and accuracy of manual testing are solved, and the efficiency and accuracy of automated testing are achieved.
Patent Information
- Application Number
- CN201910449978.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-28
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2039-05-28
AI Technical Summary
The test of the existing technology of screen projection systems relies on manual comparison, and there are problems such as subjective experience dependence, high labor costs and long test cycles, making it difficult to achieve efficient automated testing.
The blurred image comparison method is used to cut the reference picture and the picture to be compared into multiple sub-pictures, and the micro-regions are divided on each sub-picture. The proportion of different numbers of micro-regions is judged by the RGB value. When the ratio is greater than the threshold, the pictures are determined to be inconsistent.
It realizes rapid and accurate comparison of picture differences in the screen projection system, improves testing efficiency and accuracy, and accelerates the testing process through parallel calculations.
Smart Images

Figure CN110544228B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a fuzzy image comparison method, in particular to a fuzzy image comparison method for testing a projection system, and also to a system for implementing the method, belonging to the field of automated testing technology. Background Art
[0002] With the increase in speed and reduction in fees of basic networks, the diversification of Internet services and the improvement in mobile phone performance, mobile phones have evolved into personal multimedia / computing terminals and have become increasingly inseparable from life. However, in order to take into account portability, the size of mobile phones has been barely maintained below 7 inches, which has brought limitations to some multimedia experiences. For example, watching 4K high-definition videos and enjoying game special effects. Therefore, screen projection technology was born.
[0003] Screen projection is the process of projecting the display content or audio of one device to another device with a larger screen through certain transmission technologies. For example, a large-size monitor, a flat-screen TV, or even a projector. This large-size display device becomes the second screen of a portable device. In this way, we can enjoy high-definition video content and play games on a larger screen.
[0004] However, no matter which screen projection technology is used, strict testing must be done before it is put on the market to ensure the consistency of pictures and videos. The traditional testing method is manual testing. Manual testing has the following disadvantages:
[0005] First, it relies heavily on the subjective experience of individual testers, such as the delay, image quality, and accuracy of displayed content;
[0006] Second, labor costs are getting higher and higher;
[0007] Third, the testing cycle is long. In order to solve the above problems, it has become an inevitable trend to find an effective automated testing method that can liberate testers while ensuring testing efficiency. Summary of the invention
[0008] In view of the deficiencies in the prior art, the primary technical problem to be solved by the present invention is to provide a fuzzy image comparison method for testing a projection system.
[0009] Another technical problem to be solved by the present invention is to provide a fuzzy image comparison system for testing a projection system.
[0010] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical solutions:
[0011] According to a first aspect of an embodiment of the present invention, a blurred image comparison method for testing a screen projection system is provided, comprising the following steps:
[0012] Cut the original images of the reference image and the image to be compared into multiple sub-images;
[0013] Extract a corresponding sub-image from each of the reference image and the image to be compared, divide the sub-image into a plurality of micro-regions, and determine the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions;
[0014] When the ratio of the number of different micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared is inconsistent with the original image.
[0015] Preferably, obtaining the original images of the reference image and the image to be compared includes the following steps:
[0016] Delineate comparison areas based on needs;
[0017] The original image is cut according to the comparison area, and the comparison areas of the reference original image and the original image to be compared are respectively extracted to obtain the original images of the reference image and the image to be compared.
[0018] Preferably, before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the following steps are also included:
[0019] Identify the information of each sub-image in the image to be compared, and sort the sub-images according to the amount of information distribution.
[0020] Preferably, before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the following steps are also included:
[0021] Extract feature points of sub-images in the reference image and the image to be compared respectively;
[0022] Compare the feature points of the corresponding sub-images in the reference image and the image to be compared, and sort the sub-images according to the difference in feature points.
[0023] Preferably, judging the ratio of the number of different micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions, when the ratio of the number of different micro-regions is greater than a ratio threshold, the sub-images in the reference image and the image to be compared are different, comprising the following steps:
[0024] S121, obtaining a pixel point Ti to be compared in a micro-region of a sub-image to be compared; wherein i=1, 2, ... N, and N is the number of pixel points in the micro-region;
[0025] S122, obtaining a reference pixel point Qi in a reference picture sub-image micro-region corresponding to the pixel point Ti to be compared;
[0026] S123, when the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value, the number of different micro-regions M=M+1; otherwise, go to step S124;
[0027] S124, determine whether i is less than N, if yes, then i=i+1, go to step S121; otherwise go to step S125;
[0028] S125, determining whether the ratio of the different numbers of micro-regions is greater than a ratio threshold. If it is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different.
[0029] Preferably, the RGB values of the pixel to be compared are compared with the RGB values of the reference pixel respectively. When at least one value of the difference between the RGB value of the pixel to be compared and the RGB value of the reference pixel is greater than the maximum deviation value, it is determined that the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value.
[0030] Preferably, when the corresponding sub-images in the reference image and the image to be compared are the same, the following steps are also included:
[0031] The proportion of all the different numbers of micro-regions in the image to be compared and the reference image is counted. If the proportion of the different numbers of regions is greater than the micro-region difference threshold, it is determined that the image to be compared is inconsistent with the original image.
[0032] Preferably, one thread is allocated to each sub-image; the fuzzy image comparison is performed in parallel on the multiple sub-images divided therein, and when there are differences between the sub-images in the reference image and the image to be compared, it is determined that the image to be compared is inconsistent with the original image.
[0033] According to a second aspect of an embodiment of the present invention, a blurred image comparison system for testing a projection system is provided, comprising a processor and a memory; a computer program that can be run on the processor is stored on the memory, and when the computer program is executed by the processor, the following steps are implemented:
[0034] Cut the original images of the reference image and the image to be compared into multiple sub-images;
[0035] Extract a corresponding sub-image from each of the reference image and the image to be compared, divide the sub-image into a plurality of micro-regions, and determine the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions;
[0036] When the ratio of the number of different micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared is inconsistent with the original image.
[0037] Preferably, when the computer program is executed by the processor, the following steps are further implemented:
[0038] Identify the information of each sub-image in the image to be compared, and sort the sub-images according to the amount of information distribution. The fuzzy image comparison method for testing the projection system provided by the present invention processes the reference image and the image to be compared, and cuts the original image of the reference image and the image to be compared into multiple sub-images; fuzzy image comparison is performed on each sub-image, and the difference between the image to be compared and the reference image can be quickly compared, so as to complete the test of the projection system well and improve the test efficiency and accuracy. In addition, the multi-core of the central processing unit is used for parallel computing, which speeds up the test speed of the projection system. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a comprehensive comparison between a reference image and an image to be compared in one embodiment of the present invention;
[0040] Figure 2 A flow chart of the fuzzy image comparison method for testing a projection system provided by the present invention;
[0041] Figure 3 A schematic diagram showing comparison of two color blocks with very small color difference in the embodiment provided by the present invention;
[0042] Figure 4 This is a schematic diagram of the structure of a fuzzy image comparison system for testing a projection system in an embodiment provided by the present invention. DETAILED DESCRIPTION
[0043] The technical content of the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] The fuzzy image comparison method for testing a projection system provided in an embodiment of the present invention mainly solves the problem that after projection, the color of the displayed image is randomly distorted and the image edge is randomly jagged, which makes the image look consistent to the naked eye, but it is impossible to use a simple image comparison algorithm to distinguish whether the image to be tested is consistent with the reference image. Figure 1 , for the image to be compared (a) and the reference image (b), as well as the output image (c) after strict comparison of the RGB values of each pixel. From left to right, the first white ring image is the image to be compared, the second white ring image is the reference image, and the third white dot image is the comparison result. It can be seen that it is difficult to see the difference between the first and second images with the naked eye, but there are subtle differences in color and shape. The blue part in the third image is the pixel with different RGB values. When comparing blurred images of the test projection system, both accuracy and computational efficiency must be taken into account. This method uses a relatively simple calculation method, and in order to speed up the calculation, it uses the multi-core of the central processing unit for parallel calculation, and also incorporates other image algorithms.
[0045] like Figure 2 As shown, the fuzzy image comparison method for testing the projection system provided by the present invention includes the following steps: first, cutting the original images of the reference image and the image to be compared into multiple sub-images; then, extracting a corresponding sub-image from each of the reference image and the image to be compared, dividing the sub-image into multiple micro-regions, and judging the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions. When the ratio of the different numbers of micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared and the original image are inconsistent. The above processing is described in detail below.
[0046] S11, cutting the original images of the reference image and the image to be compared into multiple sub-images.
[0047] In the embodiment provided by the present invention, obtaining the original images of the reference image and the image to be compared specifically includes the following steps:
[0048] Define the comparison area based on the requirements (generally refers to the observation area of the test case);
[0049] The original image is cut according to the comparison area, and the comparison areas of the reference original image and the original image to be compared are respectively extracted to obtain the original images of the reference image and the image to be compared.
[0050] Specifically, when doing manual testing, testers usually only focus on the observation area specified in the test case, and the same is true for automated testing. This can reduce the amount of calculation. For example, two The picture (pixel points are , RGB value If all pixels are compared, 3145728 comparison operations are required. However, if the test content is a button on the screen that changes from play to pause, we only need to pay attention to whether the style of this button changes, so the comparison area is limited to the vicinity of this button, such as The only calculations that need to be done are times, which is 0.953% ( ). By defining the comparison area, two "original images" are obtained from the image to be compared and the reference image respectively, and sent to the next step of calculation, which can effectively improve the comparison efficiency.
[0051] Then, in order to reduce the time to obtain the final result, the parallel computing capability of the current CPU can be fully utilized to further cut the original images of the reference image and the image to be compared into sub-images. The comparison area can be divided into 4 The number and size of the cuts are not absolute and can be configured according to specific needs. For example, in the above example, the cuts are divided into 16 In the embodiment provided by the present invention, in order to improve the comparison efficiency, a thread can be allocated to each sub-image to be compared to realize parallel processing of images.
[0052] S12, extracting a corresponding sub-image from the reference image and the image to be compared respectively, dividing the sub-image into a plurality of micro-regions, and judging the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions. When the ratio of the different numbers of micro-regions is greater than a ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is judged that the image to be compared is inconsistent with the original image.
[0053] In an embodiment provided by the present invention, before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the following steps may be further included:
[0054] Identify the information of each sub-image in the image to be compared, and sort the sub-images according to the amount of information distribution.
[0055] In the embodiments provided by the present invention, the information of each sub-image in the image to be compared can be identified, and the sub-images can be sorted according to the amount of information distribution, and the corresponding sub-images can be found in the reference image according to the sub-images in the image to be compared when the fuzzy image comparison is performed later. The information of each sub-image in the reference image can also be identified, and the sub-images can be sorted according to the amount of information distribution, and the corresponding sub-images can be found in the image to be compared according to the sub-images in the reference image when the fuzzy image comparison is performed later, without specific limitation.
[0056] Specifically, the purpose of identifying the information distribution of each sub-image in the image to be compared and sorting it is to find all the sub-images (cut from the original image to be compared) with larger information content, and give priority to comparison. The reason is that the earlier the different sub-images are found, the earlier the original image can be determined to be inconsistent, so that the entire calculation process can be ended earlier, further reducing the time to obtain the result. The method of calculating the amount of information in this step is not unique, and can be selected according to needs. For example, the Hough Transform algorithm can be used to extract the number of straight lines in the sub-image, and the more straight lines, the greater the amount of information. Or for images with more text, a certain optical character recognition (OCR) algorithm is used to calculate the number of characters in the sub-image, and the more characters, the greater the amount of information. After that, the top sub-image is selected according to the sorting for fuzzy image comparison, that is, a corresponding top-ranked sub-image is extracted from the reference image and the image to be compared, and the sub-image is divided into multiple micro-areas, and then subsequent processing is performed.
[0057] In an embodiment provided by the present invention, before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the following steps may be further included:
[0058] Extract feature points of sub-images in the reference image and the image to be compared respectively;
[0059] Compare the feature points of the corresponding sub-images in the reference image and the image to be compared, and sort the sub-images according to the difference in feature points.
[0060] Specifically, in order to find different sub-images earlier, a certain feature point extraction algorithm can be used to compare the sub-image to be compared (the sub-image divided by the image to be compared) and the reference sub-image (the sub-image divided by the reference image), and sort them according to the size of the difference. For example, the scale-invariant feature transform (SIFT) algorithm is used to distinguish and calculate the feature points of the sub-image to be compared and the reference sub-image, and a comparison result is obtained. After all sub-images are calculated once, they are sorted according to the result. In the embodiment provided by the present invention, the Features FromAccelerated SegmentTest algorithm or the color histogram can also be used to sort the sub-image to be compared and the reference sub-image.
[0061] The purpose of the above sorting of sub-images is to put different sub-images at the front of the comparison queue as much as possible to reduce the time to get the result. However, since the image algorithm calculation time in the above sorting process is also very long, it may cause the side effect of slowing down the final result. Therefore, it is necessary to arrange flexibly in practical application. That is, you can choose one of the above sorting steps to operate, or skip the sorting step and directly perform the sub-image re-segmentation process.
[0062] Afterwards, a corresponding sub-image is extracted from the reference image and the image to be compared respectively, and a fuzzy comparison algorithm is run on the sub-image, that is, the sub-image is divided into multiple micro-regions, and the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared is determined according to the RGB values of the pixels contained in the micro-regions. When the ratio of the different numbers of micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared is inconsistent with the original image.
[0063] Specifically, for the characteristics of the image after projection (such as Figure 3 As shown in the figure, there are two color blocks with very small color difference, whose RGB values are (100,100,100) and (105,105,105) respectively. It is difficult for the naked eye to detect their difference. By calibrating a certain amount of RGB value tolerance, pixels with similar colors are considered to be "the same", thus playing a fuzzy comparison role.
[0064] However, the calculation is not performed directly on the entire subgraph, but the subgraph is divided into In the embodiment provided by the present invention, n=5 is taken as an example for explanation. It is just an empirical value and can be modified according to the actual situation. The calculation result of each block (the return value of the fuzzy algorithm: true or false) must be recorded, and the proportion of false blocks (different micro-areas) in all blocks must be counted. If the proportion exceeds 2%, it is determined that the sub-image is different. 2% is also an empirical value. For example The subgraph of Divide into If the results of more than two blocks are false, it exceeds 2%, and the entire sub-graph is determined to be different.
[0065] If a sub-image is found to be different, the entire calculation process is stopped, the images to be compared in the comparison queue are also abandoned, and the two original images are determined to be different.
[0066] The method comprises the following steps: determining the ratio of the number of different micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions; when the ratio of the number of different micro-regions is greater than a ratio threshold, the sub-images in the reference image and the image to be compared are different.
[0067] S121, obtaining a pixel point Ti to be compared in a micro-region of a sub-image to be compared; wherein i=1, 2, ... N, and N is the number of pixel points in the micro-region;
[0068] S122, obtaining a reference pixel point Qi in a reference picture sub-image micro-region corresponding to the pixel point Ti to be compared;
[0069] S123, when the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value, the number of different micro-regions M=M+1; otherwise, go to step S124;
[0070] In the embodiment provided by the present invention, the RGB value of the pixel to be compared is compared with the RGB value of the reference pixel. When at least one of the differences between the RGB value of the pixel to be compared and the RGB value of the reference pixel is greater than the maximum deviation value, it is determined that the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value. Specifically, the maximum deviation value is set to ( ), the RGB value of the pixel to be compared is ( ); The RGB value of the reference pixel is ( );when , , When at least one of the three formulas is satisfied, it is determined that the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value, and the number of different micro-areas M=M+1.
[0071] The following method can be used to determine whether the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value:
[0072] def fuzzy_compare(pic1,pic2,deviation{R,G,B})
[0073] for x=0,x <pic2.width,x++
[0074] for y=0,y <pic_2.height,y++
[0075] if|pic1[x][y][R]-pic2[x][y][R]|>R
[0076] or|pic1[x][y][G]-pic2[x][y][G]|>G
[0077] or|pic1[x][y][B]-pic2[x][y][B]|>B
[0078] return false
[0079] return true
[0080] Where, deviation{R,G,B}: the maximum deviation allowed for each pixel.
[0081] S124, determine whether i is less than N, if yes, then i=i+1, go to step S121; otherwise go to step S125;
[0082] S125, determine whether the ratio of the different numbers of micro-areas is greater than the ratio threshold. When it is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different. The ratio threshold can be set according to the needs, or it can be obtained by mining historical projection data. For example: the sub-image is divided into micro-areas including Pixel array, calculate the deviation value, if more than 50% of the pixels exceed the maximum deviation value, the micro-area is judged to be different.
[0083] In the embodiment provided by the present invention, if the corresponding sub-images in the reference image and the image to be compared are the same, the fuzzy image comparison method for testing the projection system further includes the following steps:
[0084] The proportion of all the different numbers of micro-regions in the image to be compared and the reference image is counted. If the proportion of the different numbers of regions is greater than the micro-region difference threshold, it is determined that the image to be compared is inconsistent with the original image.
[0085] When comparing images, the worst case is that all sub-images will be calculated once. However, even if all micro-regions are compared, the two images may still be different if the entire area to be compared is not determined to be different. It is necessary to count all micro-regions that exceed the maximum deviation. If the proportion of micro-regions that exceed the maximum deviation to all micro-regions exceeds the micro-region difference threshold, the entire area to be compared is determined to be different.
[0086] In order to obtain a stricter result, we can specify another empirical value as the micro-region distinction threshold. In an embodiment provided by the present invention, an empirical value of 5% is used as an example for explanation. If the number of different blocks in all sub-images exceeds 5% of the number of all blocks in all sub-images, the two original images are determined to be different.
[0087] The so-called stricter result is: the naked eye is the same, but the calculation results are different. This ratio is rare in our practice. It can be compensated by manual secondary inspection, which is allowed in actual engineering. However, if the naked eye is different, but the algorithm determines that they are the same, it is a serious misjudgment. This kind of misjudgment must be avoided.
[0088] Through the above series of calculations, it can be determined whether the image to be compared is the reference image.
[0089] In summary, the fuzzy image comparison method for testing the projection system provided by the present invention processes the reference image and the image to be compared, and cuts the original images of the reference image and the image to be compared into multiple sub-images; then, the image fuzzy comparison method is used to extract a corresponding sub-image in the reference image and the image to be compared, respectively, and the sub-image is divided into multiple micro-regions, and the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared is judged according to the RGB values of the pixels contained in the micro-regions. When the ratio of the different numbers of micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared and the original image are inconsistent. This method can well complete the test of the projection system, improve the test efficiency and accuracy, and can meet the test requirements of the existing projection system. In addition, the multi-core of the central processing unit is used for parallel computing, which speeds up the test speed of the projection system.
[0090] The present invention also provides a fuzzy image comparison system for testing a projection system. Figure 4 As shown, the system includes a processor 42 and a memory 41 storing instructions executable by the processor 42;
[0091] The processor 42 may be a general-purpose processor, such as a central processing unit (CPU), or a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0092] The memory 41 is used to store program code and transmit the program code to the CPU. The memory 41 may include a volatile memory, such as a random access memory (RAM); the memory 41 may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid state drive; the memory 41 may also include a combination of the above-mentioned types of memory.
[0093] Specifically, the blurred image comparison system for testing the projection system provided in the embodiment of the present invention includes a processor 42 and a memory 41; the memory 41 stores a computer program that can be run on the processor 42, and when the computer program is executed by the processor 42, the following steps are implemented:
[0094] S21, cutting the original images of the reference image and the image to be compared into multiple sub-images;
[0095] S22, extracting a corresponding sub-image from the reference image and the image to be compared respectively, dividing the sub-image into a plurality of micro-regions, and determining the ratio of the number of different micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions; when the ratio of the number of different micro-regions is greater than a ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared is inconsistent with the original image.
[0096] When obtaining the original images of the reference image and the image to be compared, the computer program is executed by the processor 42 to implement the following steps:
[0097] Delineate comparison areas based on needs;
[0098] The original image is cut according to the comparison area, and the comparison areas of the reference original image and the original image to be compared are respectively extracted to obtain the original images of the reference image and the image to be compared.
[0099] Before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the computer program further implements the following steps when executed by the processor 42:
[0100] Identify the information of each sub-image in the image to be compared, and sort the sub-images according to the amount of information distribution.
[0101] Before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the computer program further implements the following steps when executed by the processor 42:
[0102] Extract feature points of sub-images in the reference image and the image to be compared respectively;
[0103] Compare the feature points of the corresponding sub-images in the reference image and the image to be compared, and sort the sub-images according to the difference in feature points.
[0104] The ratio of the number of different micro-regions in the sub-images of the reference image and the image to be compared is determined according to the RGB values of the pixels contained in the micro-regions. When the ratio of the number of different micro-regions is greater than a ratio threshold, the sub-images in the reference image and the image to be compared are different. The computer program is executed by the processor 42 to implement the following steps.
[0105] S221, obtaining a pixel point Ti to be compared in a micro-region of a sub-image to be compared; wherein i=1, 2, ... N, and N is the number of pixel points in the micro-region;
[0106] S222, obtaining a reference pixel point Qi in a reference picture sub-image micro-region corresponding to the pixel point Ti to be compared;
[0107] S223, when the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value, the number of different micro-regions M=M+1; otherwise, go to step S224;
[0108] S224, determine whether i is less than N, if yes, then i=i+1, go to step S221; otherwise go to step S225;
[0109] S225 , determining whether the ratio of the different numbers of micro-regions is greater than a ratio threshold. If it is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different.
[0110] When the computer program is executed by the processor 42, the following steps are implemented:
[0111] The RGB values of the pixels to be compared are compared with the RGB values of the reference pixels respectively. When at least one value of the difference between the RGB value of the pixel to be compared and the RGB value of the reference pixel is greater than the maximum deviation value, it is determined that the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value.
[0112] When the corresponding sub-images in the reference image and the image to be compared are the same, the computer program is executed by the processor 42 to further implement the following steps:
[0113] The proportion of all the different numbers of micro-regions in the image to be compared and the reference image is counted. If the proportion of the different numbers of regions is greater than the micro-region difference threshold, it is determined that the image to be compared is inconsistent with the original image.
[0114] When the computer program is executed by the processor 42, the following steps are implemented:
[0115] A thread is allocated to each sub-image; the fuzzy images of the multiple sub-images are compared in parallel. When there are sub-images in the reference image and the image to be compared that are different, it is determined that the image to be compared is inconsistent with the original image.
[0116] The embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium here stores one or more programs. The computer-readable storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state hard disk; the memory may also include a combination of the above-mentioned types of memory. When the one or more programs in the computer-readable storage medium can be executed by one or more processors, it can implement the above-mentioned steps or all steps of the blurred image comparison method in the above-mentioned method embodiment.
[0117] The above is a detailed description of the fuzzy image comparison method and system for testing the projection system provided by the present invention. For those skilled in the art, any obvious changes made to it without departing from the essential spirit of the present invention will constitute an infringement of the patent right of the present invention and will bear corresponding legal responsibilities.
Claims
1. A fuzzy image comparison method for testing a projection system, characterized in that The steps include: Cut the original images of the reference image and the image to be compared into multiple sub-images; A corresponding sub-image is extracted from each of the reference image and the image to be compared, and the sub-image is divided into a plurality of micro-regions. The ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared is determined according to the RGB values of the pixels contained in the micro-regions. The method includes the following sub-steps: S121, obtaining the pixel point Ti to be compared in the micro-region of the sub-image of the image to be compared; wherein i=1, 2, ... N, N is the number of pixels in the micro-region; S122, obtaining the reference pixel point Qi in the micro-region of the sub-image of the reference image corresponding to the pixel point Ti to be compared; S123, when the difference between the pixel point to be compared and the reference pixel point is greater than the maximum deviation value, the number of different micro-regions M=M+1; otherwise, go to step S124; S124, determine whether i is less than N, if so, i=i+1, go to step S121; otherwise, go to step S125; S125, determine whether the ratio of the different numbers of micro-regions is greater than the ratio threshold, When the ratio of the number of different micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared is inconsistent with the original image.
2. The fuzzy image comparison method for testing a projection system according to claim 1, characterized in that Obtaining the original images of the reference image and the image to be compared includes the following steps: Delineate comparison areas based on needs; The original image is cut according to the comparison area, and the comparison areas of the reference original image and the original image to be compared are respectively extracted to obtain the original images of the reference image and the image to be compared.
3. The fuzzy image comparison method for testing a projection system according to claim 1, characterized in that Before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the following steps are also included: Identify the information of each sub-image in the image to be compared, and sort the sub-images according to the amount of information distribution.
4. The fuzzy image comparison method for testing a projection system according to claim 1, characterized in that Before dividing the sub-images extracted from the reference image and the image to be compared into a plurality of micro-regions, the following steps are also included: Extract feature points of sub-images in the reference image and the image to be compared respectively; Compare the feature points of the corresponding sub-images in the reference image and the image to be compared, and sort the sub-images according to the difference in feature points.
5. The fuzzy image comparison method for testing a projection system according to claim 1, characterized in that: The RGB values of the pixels to be compared are compared with the RGB values of the reference pixels respectively. When at least one value of the difference between the RGB value of the pixel to be compared and the RGB value of the reference pixel is greater than the maximum deviation value, it is determined that the difference between the pixel to be compared and the reference pixel is greater than the maximum deviation value.
6. The fuzzy image comparison method for testing a projection system according to claim 1, characterized in that When the corresponding sub-images in the reference image and the image to be compared are the same, the following steps are also included: The proportion of all the different numbers of micro-regions in the image to be compared and the reference image is counted. If the proportion of the different numbers of regions is greater than the micro-region difference threshold, it is determined that the image to be compared is inconsistent with the original image.
7. The fuzzy image comparison method for testing a projection system according to claim 1, characterized in that: A thread is allocated to each sub-image; the fuzzy images of the multiple sub-images are compared in parallel. When there are sub-images in the reference image and the image to be compared that are different, it is determined that the image to be compared is inconsistent with the original image.
8. A fuzzy image comparison system for testing a projection system, used to implement the fuzzy image comparison method described in claims 1 to 7, characterized in that The invention comprises a processor and a memory; the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the following steps are implemented: Cut the original images of the reference image and the image to be compared into multiple sub-images; Extract a corresponding sub-image from each of the reference image and the image to be compared, divide the sub-image into a plurality of micro-regions, and determine the ratio of the different numbers of micro-regions in the sub-images of the reference image and the image to be compared according to the RGB values of the pixels contained in the micro-regions; When the ratio of the number of different micro-regions is greater than the ratio threshold, the sub-images in the reference image and the image to be compared are different, and it is determined that the image to be compared is inconsistent with the original image.
9. The fuzzy image comparison system for testing a projection system according to claim 8, characterized in that When the computer program is executed by the processor, the following steps are also implemented: Identify the information of each sub-image in the image to be compared, and sort the sub-images according to the amount of information distribution.
Citation Information
Patent Citations
Method for eliminating repeated image and apparatus
CN103377473A
Road picture detecting method and device
CN108629795A