Image generation method and DSC testing method
By generating flexible test images, the problem of insufficient diversity of test data in DSC algorithm testing is solved, and the reliability and accuracy of the test are improved.
Patent Information
- Application Number
- CN202411524035.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In DSC algorithm testing, it is difficult for the prior art to flexibly generate DPX files containing random headers, resulting in insufficient diversity and effectiveness of test data, affecting the reliability of the test.
By inputting the configuration information of the test scene into the target component, a file header, an image header and a direction header are generated, and inputting them into the image generation model, a flexible test image is generated to meet the needs of different test scenarios.
Improve the diversity and effectiveness of test data in DSC tests, thereby improving the reliability and accuracy of the test.
Smart Images

Figure CN119048611B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to the field of image generation, image processing and image display technology. Background Art
[0002] In the Display Stream Compression (DSC) test, the Digital Picture Exchange (DPX) format is required as the input file and output file to test the accuracy of the DSC algorithm. DPX is a file used to store and express images or videos. DPX files consist of a file header, an image header, a direction header, and an image. In the verification process of the DSC algorithm, a large number of DPX files containing random headers and images are required. Therefore, it is necessary to develop a tool that can flexibly generate DPX files containing random headers and images. Summary of the invention
[0003] The purpose of the present invention is to provide an image generation method and a DSC test method, which can flexibly generate test images according to the needs of the test scene, help to improve the diversity and effectiveness of test data in the DSC test, thereby improving the reliability of the DSC test.
[0004] In a first aspect, the present invention provides an image generation method, comprising:
[0005] Input the configuration information of the test scenario into the target component, and obtain the file header, image header and direction header output by the target component;
[0006] The file header, the image header and the direction header are input into the image generation model to obtain a test image generated by the image generation model.
[0007] In some embodiments, the configuration information includes image metadata and test requirement data; wherein, the configuration information of the test scene is input into the target component to obtain the file header, image header and direction header output by the target component, including: generating a file header based on the image metadata; the file header is used to provide image attribute information for generating a test image; generating an image header based on the image metadata and the test requirement data; the image header is used to provide test scene characteristics and image structure information for generating a test image; generating a direction header based on the image metadata and the test requirement data; the direction header is used to provide the position of the test image in the display for generating a test image.
[0008] In some embodiments, the file header, image header and direction header are input into the image generation model to obtain a test image generated by the image generation model, including: arbitrarily generating a target pixel; calling the target pixel to generate a test image according to the file header, image header and direction header.
[0009] In some embodiments, the target pixel is a white pixel, wherein calling the target pixel to generate a test image according to a file header, an image header, and a direction header includes: calling a white pixel; a white pixel is a pixel point composed entirely of white; and based on the file header, an image header, and a direction header, looping the white pixel to generate a test image.
[0010] In some embodiments, the target pixel is a black pixel, wherein calling the target pixel to generate a test image according to a file header, an image header, and a direction header includes: calling a black pixel; a black pixel is a pixel point composed entirely of black; and based on the file header, an image header, and a direction header, looping the black pixel to generate a test image.
[0011] In some embodiments, the target pixel is a random pixel, wherein calling the target pixel to generate a test image according to a file header, an image header, and a direction header includes: calling a random pixel; the random pixel is a pixel point composed of any color; based on the file header, the image header, and the direction header, looping the random pixel to generate a test image.
[0012] In some embodiments, the target pixel is an index pixel, wherein calling the target pixel to generate a test image according to a file header, an image header, and a direction header includes: calling the index pixel; the index pixel is a pixel point of preset coordinates; based on the file header, the image header, and the direction header, looping the index pixel to generate a test image.
[0013] In some embodiments, the image generation method also includes: calculating the size of the test image based on the configuration information to obtain a predicted value of the size of the test image; comparing the true value of the size of the test image with the predicted value of the size of the test image to obtain an error value; the error value is used to determine whether the test image can be used as a test image for the DSC test.
[0014] In a second aspect, the present invention provides a DSC test method, applied to a transmitting end, comprising:
[0015] Obtain a first DPX file corresponding to the test scene; the first DPX file stores a first test image, a file header, an image header, and a direction header corresponding to the first test image; the first test image, the file header, the image header, and the direction header corresponding to the first test image are obtained by the method described in the first aspect;
[0016] Encoding the first test image by a DSC encoder to obtain a test image data stream;
[0017] Send the test image data stream to the receiving end.
[0018] In a third aspect, the present invention provides a DSC testing method, applied to a receiving end, comprising:
[0019] The test image data stream sent by the sending end is decoded by an image processor to obtain a second DPX file; the second DPX file stores a second test image, a file header, an image header and a direction header corresponding to the second test image; the test image data stream is obtained by the method described in the second aspect;
[0020] The first test image and the second test image are compared to obtain a test result; the first test image is obtained by the method described in the first aspect.
[0021] The beneficial effect of the solution provided by the embodiment of the present disclosure is that it can flexibly generate test images according to the needs of the test scene, which helps to improve the diversity and effectiveness of test data in DSC testing, thereby improving the reliability of DSC testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a flow chart of an image generation method provided by an embodiment of the present invention;
[0023] Figure 2 A schematic diagram of the composition structure of a DPX file provided in an embodiment of the present invention;
[0024] Figure 3 Schematic diagram of the DSC test method provided in the embodiment of the present invention Figure 1 ;
[0025] Figure 4 A schematic diagram of a process for generating a DPX file provided in an embodiment of the present invention;
[0026] Figure 5 Schematic diagram of the DSC test method provided in the embodiment of the present invention Figure 2 . DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0028] In the related art, for the test of DSC algorithm, in order to ensure the diversity and authenticity of the test data, real image files are usually used as test samples. However, since regression testing is required frequently during the test process, higher requirements are placed on the number and type of test samples, and direct reliance on existing real image files may not be able to meet this demand. Therefore, a tool that can flexibly generate test data is developed to meet the special needs of DSC testing. The test data not only contains test images, but also embeds metadata that matches the DSC test scenario, which is crucial for accurately simulating and verifying the performance of the DSC system. Therefore, how to generate constrained random test data is crucial to verifying the accuracy of the DSC algorithm.
[0029] In order to at least partially solve one or more of the above problems and other potential problems, the present disclosure proposes an image generation method, which includes: inputting the configuration information of the test scene into the target component to obtain the file header, image header and direction header output by the target component; inputting the file header, image header and direction header into the image generation model to obtain the test image generated by the image generation model. The technical solution of the present disclosure can flexibly generate test images according to the needs of the test scene, which helps to improve the diversity and effectiveness of test data in DSC testing, thereby improving the reliability of DSC testing.
[0030] Figure 1 is a flow chart of an image generating method according to an embodiment of the present disclosure, such as Figure 1 As shown, the method comprises at least the following steps:
[0031] S101: Input configuration information of the test scenario into the target component to obtain a file header, an image header, and a direction header output by the target component;
[0032] S102: Input the file header, the image header and the direction header into the image generation model to obtain a test image generated by the image generation model.
[0033] In some embodiments, the test scenario is a specific environment and condition designed to test a certain performance of the DSC algorithm. The test scenario may include: a normal test scenario and a special test scenario. Among them, the normal test scenario refers to a series of test environments or conditions based on daily or regular usage, which are intended to verify the function and performance of the DSC algorithm under standard operation. For example, a scenario for testing compression efficiency. The special test scenario refers to a test environment or condition for special situations that are not common but may occur. For example, a scene for testing extreme colors.
[0034] In some embodiments, the configuration information refers to a series of data required to simulate the test scenario. The configuration data may include: image metadata and test requirement data. The image metadata refers to data used to describe the test image itself and related information to be generated. For example, image name, image size, etc. The test requirement data refers to a series of data defined according to the test scenario. For example, the number of pixels per row.
[0035] In some embodiments, the target component is a piece of code that can implement parsing the configuration information of the test scene into a file header, an image header, and a direction header. The target component can be packaged separately and called at any time to obtain the file header, image header, and direction header; the target component can also be packaged in an image generation model, in which case the target component is a part of the image generation model.
[0036] In some embodiments, the file header is the beginning of the DPX file. The file header contains key information for identifying the file type, version, and controlling how the rest of the file is interpreted. The file header typically includes but is not limited to the following information:
[0037] 1. File name: refers to the identification of the file, which is used to distinguish and identify different DPX files in DSC testing.
[0038] 2. File identification: used to indicate that the file is in DPX format and the version of DPX format. Specifically, there is a specific byte sequence in the DPX file, which is a magic number. The magic number is used to identify the file as a DPX file and indicate the byte order of the file (big endian or little endian).
[0039] 3. Image data offset: used to indicate the starting position of the test image in the DPX file.
[0040] 4. File size: This may include the size of the entire file or the size of a specific portion.
[0041] 5. Date stamp: It is a timestamp that records the exact date and time when the DPX file is created, modified, or a specific event occurs.
[0042] 6. Data Description: Detailed information about the encoding and storage of the test images.
[0043] The information included in the above file header is in the form of identification values and occupies a fixed bit width in a specific order in the file header.
[0044] The fixed size of the file header is 768 bytes.
[0045] In some embodiments, the image header can be part of the file header; or it can exist independently and be located after the file header. The image header contains detailed data for describing the test image. The image header usually includes but is not limited to the following information:
[0046] 1. Number of pixels per row: used to describe the number of pixels contained in each row of the test image.
[0047] 2. Data symbol: refers to the byte order (big endian or little endian) or bit order (high bit first or low bit first) of pixel data.
[0048] 3. Descriptor: A code or flag used to describe specific attributes or characteristics of a test image, which may include information such as the test image type and color space.
[0049] 4. Bits per element: Used to describe the number of bits used for each pixel or color channel in the test image, which determines the color depth and possible color range of the test image.
[0050] 5. Image size: includes the width and height of the test image, usually in pixels. Image size is one of the most basic properties of an image and determines the size of the test image when it is displayed.
[0051] The fixed size of the image header is 640 bytes.
[0052] In some embodiments, the direction header is used to describe the position of the test image in the display. For example, the upper left corner of the display of electronic device A. The direction header may also include: information on how the test image is positioned on the display. For example, the rotation angle (applicable to situations where the test image needs to be rotated for display), the mirror effect (applicable to situations where the image needs to be flipped left and right or up and down). In addition, the direction header also includes the source information of the test image and user-defined information. Exemplarily, if the test image comes from the Internet, the Uniform Resource Locator (URL) address is the source information of the test image. Among them, the fixed size of the direction header is 256 bytes.
[0053] In some embodiments, the image generation model is used to generate a test image, and the image generation model contains a target component. Here, the structure of the image generation model is not specifically limited. In practical applications, the image generation model includes the target component and can achieve the above functions.
[0054] In some embodiments, the test image is part of a DPX file. The test image is randomly generated according to the configuration information of the test scene. In this way, the test image can be flexibly generated according to the needs of the test scene, which helps to improve the diversity and effectiveness of the test data in the DSC test, thereby improving the reliability of the DSC test.
[0055] In some embodiments, the DPX file is used to test the accuracy of the DSC algorithm. Figure 2 The following is a schematic diagram showing the composition structure of a DPX file: Figure 2 As shown, the DPX file may include: a file header, an image header, a direction header, and a test image. The test image is obtained by the above-mentioned image processing method.
[0056] According to the solution of the embodiment of the present disclosure, the configuration information of the test scene is input into the target component to obtain the file header, image header and direction header output by the target component; the file header, image header and direction header are input into the image generation model to obtain the test image generated by the image generation model. In this way, the test image can be flexibly generated according to the needs of the test scene, which helps to improve the diversity and effectiveness of the test data in the DSC test, thereby improving the reliability of the DSC test.
[0057] In an embodiment of the present disclosure, the configuration information includes image metadata and test requirement data; wherein, the configuration information of the test scene is input into the target component to obtain a file header, an image header and a direction header output by the target component, including: generating a file header according to the image metadata; the file header is used to provide image attribute information for generating a test image; generating an image header according to the image metadata and the test requirement data; the image header is used to provide test scene features and image structure information for generating a test image; generating a direction header according to the image metadata and the test requirement data; the direction header is used to provide the position of the test image in the display for generating a test image.
[0058] In some embodiments, the image metadata refers to a series of data or information embedded in the image file, which is used to describe the attributes, characteristics, source, copyright status and other relevant information of the image, but does not directly constitute the visual part of the image content. In short, image metadata is data about the image, which provides key information for generating the image.
[0059] In some embodiments, the test requirement data refers to a series of specific test data set to verify the performance of the DSC algorithm in a test scenario.
[0060] In some embodiments, the image attribute information refers to a data set describing basic physical characteristics and parameters of the image, which define the basic appearance and storage method of the image. The image attribute information includes but is not limited to:
[0061] 1. Resolution: The width and height of an image, usually expressed in pixels.
[0062] 2. Color depth: The number of colors that each pixel can represent, which is used to determine the color range and detail of the image.
[0063] 3. Bit depth: The number of bits for each color channel (such as red, green, blue (RGB)), which is used to determine the color accuracy of the image.
[0064] 4. File size: The amount of space the image file takes up on the storage media.
[0065] 5. Pixel density (Pixels Per Inch, PPI): The number of pixels per inch (or per centimeter), which is used to determine the clarity and display effect of the image.
[0066] In some embodiments, the test scene characteristics refer to a series of parameters and conditions set to simulate a specific test environment or condition, and these characteristics define the scene represented by the test image. In the verification of the DSC algorithm, the test scene characteristics are used to generate test images with specific properties and behaviors in order to evaluate the performance and performance of the DSC algorithm in different scenarios. Test scene characteristics may include but are not limited to:
[0067] 1. Scene type: such as indoor, outdoor, urban, rural, etc., defines the background and elements of the test image.
[0068] 2. Object attributes: such as shape, size, color, texture, etc., which define the characteristics of the objects in the test image.
[0069] 3. Special effects: such as blur, sharpening, color adjustment, etc., define the display effect of the test image; can be used to test the compatibility of the DSC algorithm with image processing.
[0070] In some embodiments, the image structure information refers to the spatial relationship and arrangement between pixels in the image, and how these pixels together constitute the overall structure and features of the image. In the verification of the DSC algorithm, image structure information is crucial for evaluating the algorithm's ability to preserve image details during compression and decompression. Image structure information includes but is not limited to:
[0071] 1. Edges and contours: the boundaries and shapes of objects in the image.
[0072] 2. Texture and details: The texture and tiny features on the image surface.
[0073] 3. Layers and depth: the context and depth information of different elements in the image.
[0074] 4. Color distribution: the distribution and variation of colors in the image.
[0075] In some embodiments, the position in the display refers to the specific position and layout of the test image when it is displayed on the target display. This usually involves the relative position, alignment, and possible other layout parameters of the image on the display screen. Specifically, the "position of the display" may include the following aspects:
[0076] 1. Screen coordinates: This refers to the specific coordinate position of the test image on the monitor screen, usually with the upper left corner of the screen as the origin, the right as the positive direction of the X axis, and the downward as the positive direction of the Y axis. By specifying the starting coordinates of the image (i.e. the coordinates of the upper left corner or other specified points), the approximate position of the image on the screen can be determined.
[0077] 2. Alignment: It is also important to test the alignment of the image on the display, such as whether it is centered, left-aligned, right-aligned, or top-aligned.
[0078] 3. Scaling: In some cases, the test image may need to be scaled according to the resolution or size of the monitor to ensure that the image can be fully and clearly displayed on the screen.
[0079] 4. Multi-screen support: If the test scenario involves multiple displays, the layout and position relationship of the images between different displays also need to be considered. This may require setting up a cross-screen coordinate system or using specific multi-screen display technology to achieve this.
[0080] In this way, generating a file header, an image header, and a direction header through the configuration information of the test scene helps to improve the flexibility of generating test images, thereby improving the practicality and pertinence of the DSC algorithm test.
[0081] In the disclosed embodiment, the file header, image header and direction header are input into the image generation model to obtain a test image generated by the image generation model, including: arbitrarily generating a target pixel; calling the target pixel to generate a test image according to the file header, image header and direction header.
[0082] In some embodiments, the target pixel refers to a pixel point randomly or specifically selected by the model in order to construct or render the final image during the test image generation process. The pixel point does not directly correspond to the specific information in the input data (such as the file header, image header, or direction header), but serves as a basic unit or starting point in the image generation process. The target pixel includes but is not limited to: white pixels, black pixels, random pixels, and index pixels.
[0083] In some embodiments, the calling of the target pixel to generate a test image according to the file header, the image header, and the direction header includes:
[0084] S01: Read the file header to determine the image file type (such as DPX), version, creation date and other basic information;
[0085] S02: Read the image header to determine the image size (width and height, such as 1920x1080), color depth (usually 8 bits / channel), color mode (RGB), resolution, etc.;
[0086] S03: Read the direction header to determine the position of the image in the display;
[0087] S04: The outer loop traverses each row of the image; at this time, the row counter y is initialized to 0, and when y is less than the image height, step S205 is executed;
[0088] S05: the inner loop traverses each pixel of the row; at this time, in the current row, the column counter x is initialized to 0, and when x is less than the image width, step S206 is executed;
[0089] S06: calling the target pixel and generating RGB values; at this point, the current (x, y) position is the "target pixel"; wherein, the values of the three RGB components of the target pixel are generated, and these values may be random, or calculated based on an algorithm (such as position-based color gradient, noise generation, etc.) or input data (such as data from another image);
[0090] S07: Update column counter x; specifically, increase x by 1 to move to the next column;
[0091] S08: When x reaches the image width, the inner loop ends and prepares to process the next line;
[0092] S09: Update row counter y: Specifically, increase y by 1 to move to the next row;
[0093] S10: When y reaches the image height, the outer loop ends and the test image is output.
[0094] In this way, a test image that meets the requirements of the test scenario can be randomly generated according to the file header, image header and direction header, which helps to improve the accuracy of the DSC algorithm test.
[0095] In the disclosed embodiment, the target pixel is a white pixel, wherein calling the target pixel to generate a test image according to the file header, the image header and the direction header includes: calling the white pixel; the white pixel is a pixel point composed entirely of white; based on the file header, the image header and the direction header, looping the white pixel to generate a test image.
[0096] In some embodiments, the white pixel is a pixel point composed entirely of white. The all-white image is used as a special image to verify the performance of the DSC algorithm in processing special images.
[0097] In some embodiments, the method loops white pixels based on the file header, the image header, and the orientation header to generate a test image, comprising:
[0098] 1. Parse header information: Read and analyze the file header (which may contain basic information about the image, such as format, size, etc.), image header (which may contain detailed parameters of the image, such as resolution, color depth, etc.), and orientation header (the position of the image on the display).
[0099] 2. Initialize white pixel: Create a white pixel as the starting point for generating the test image.
[0100] 3. Loop to generate image: According to the header information, copy the white pixels to various positions of the image through a loop mechanism, or transform the white pixels (such as rotate, scale, etc.) according to the direction information in the header to generate a complete test image.
[0101] In this way, test images corresponding to special test scenarios are generated, which can fully test edge scenarios and special scenarios, help discover potential problems and loopholes in the DSC algorithm, and thus improve the comprehensiveness of the DSC algorithm test.
[0102] In the disclosed embodiment, the target pixel is a black pixel, wherein calling the target pixel to generate a test image according to the file header, the image header and the direction header includes: calling the black pixel; the black pixel is a pixel point composed entirely of black; based on the file header, the image header and the direction header, looping the black pixel to generate the test image.
[0103] In some embodiments, the black pixel is a pixel point composed entirely of black. The all-black image is used as a special image to verify the performance of the DSC algorithm in processing special images.
[0104] In some embodiments, the method of cycling black pixels based on the file header, the image header, and the orientation header to generate a test image includes:
[0105] 1. Parse header information: Read and analyze the file header (which may contain basic information about the image, such as format, size, etc.), image header (which may contain detailed parameters of the image, such as resolution, color depth, etc.), and orientation header (the position of the image on the display).
[0106] 2. Initialize black pixel: Create a black pixel as the starting point for generating the test image.
[0107] 3. Generate images in a loop: According to the header information, copy black pixels to various positions of the image through a loop mechanism, or transform the black pixels (such as rotating, scaling, etc.) according to the direction information in the header to generate a complete test image.
[0108] In this way, test images corresponding to special test scenarios are generated, which can fully test edge scenarios and special scenarios, help discover potential problems and loopholes in the DSC algorithm, and thus improve the comprehensiveness of the DSC algorithm test.
[0109] In the disclosed embodiment, the target pixel is a random pixel, wherein the target pixel is called to generate a test image according to the file header, the image header and the direction header, including: calling the random pixel; the random pixel is a pixel point composed of any color; based on the file header, the image header and the direction header, the random pixel is looped to generate the test image.
[0110] In some embodiments, the random pixel means that the color and position of the pixel are random. Specifically, the "randomness" of the random pixel is reflected in:
[0111] 1. Random color: The color components (such as red, green, blue) of random pixels are randomly generated, and these components can be any possible value in the color space (in most cases, these values will be restricted to a valid range, such as integers from 0 to 255 for images with 8-bit color depth).
[0112] 2. Random Position: Scattered anywhere in the image in a completely random manner, with no specific pattern or regularity.
[0113] In some embodiments, the method loops random pixels based on the file header, the image header, and the orientation header to generate a test image, including:
[0114] 1. Parse header information: Read and analyze the file header (which may contain basic information about the image, such as format, size, etc.), image header (which may contain detailed parameters of the image, such as resolution, color depth, etc.), and orientation header (the position of the image on the display).
[0115] 2. Initialize random pixels: Create a random pixel as a starting point for generating test images.
[0116] 3. Loop to generate images: According to the header information, random pixels are copied to various positions of the image through a loop mechanism, or random pixels are transformed (such as rotation, scaling, etc.) according to the direction information in the header to generate a complete test image.
[0117] In this way, edge scenarios and special scenarios can be fully tested, which helps to discover potential problems and loopholes in the DSC algorithm, thereby improving the comprehensiveness of DSC algorithm testing.
[0118] In the disclosed embodiment, the target pixel is an index pixel, wherein the target pixel is called to generate a test image according to the file header, the image header and the direction header, including: calling the index pixel; the index pixel is a pixel point of preset coordinates; based on the file header, the image header and the direction header, the index pixel is looped to generate a test image.
[0119] In some embodiments, the index pixel is a pixel point referenced by an index (or index value). The "index" generally refers to a number or code that is associated with a specific pixel value or pixel attribute in an image data structure. The index value is equal to the coordinate value of the pixel in the image.
[0120] In some embodiments, the method of looping and indexing pixels based on the file header, the image header, and the orientation header to generate a test image includes:
[0121] 1. Parse header information: Read and analyze the file header (which may contain basic information about the image, such as format, size, etc.), image header (which may contain detailed parameters of the image, such as resolution, color depth, etc.), and orientation header (the position of the image on the display).
[0122] 2. Initialize index pixel: Create an index pixel as the starting point for generating the test image.
[0123] 3. Generate images in a loop: According to the header information, copy the index pixels to various positions of the image through a loop mechanism, or transform the index pixels (such as rotate, scale, etc.) according to the direction information in the header to generate a complete test image.
[0124] In this way, image coordinates can be determined based on pixel values, which helps to improve the efficiency of determining potential problems and vulnerabilities in the DSC algorithm.
[0125] In the disclosed embodiment, the image generation method further includes: calculating the size of the test image according to the configuration information to obtain a predicted value of the size of the test image; obtaining an error value based on a comparison between the true value of the size of the test image and the predicted value of the size of the test image; the error value is used to determine whether the test image can be used as a test image for the DSC test.
[0126] In the disclosed embodiment, the size prediction value of the test image refers to the image size calculated according to the configuration information of the test scene.
[0127] In some embodiments, the true value of the size of the test image refers to the image size obtained by accurately measuring the generated test image.
[0128] In some embodiments, the error value refers to the difference between the true value of the size of the test image and the predicted value of the size of the test image. The error value is used to determine whether the test image can be used as a test image for testing the DSC algorithm. If the error value does not exceed the preset threshold, then the test image can be used as a test image for testing the DSC algorithm; if the error value exceeds the preset threshold, then the test image cannot be used as a test image for testing the DSC algorithm, and the cause of the failure needs to be located.
[0129] In this way, by comparing the true value of the size of the test image with the predicted value of the size of the test image, it is possible to ensure whether the test image meets the requirements of the DSC test, which helps to improve the accuracy and reliability of the test.
[0130] Figure 3 FIG. 1 is a flow chart of a DSC testing method according to an embodiment of the present disclosure. Figure 1 , the DSC test method is applied to the transmitter, such as Figure 3 As shown, the method comprises at least the following steps:
[0131] S301: Obtain a first DPX file corresponding to the test scene; the first DPX file stores a first test image, a file header, an image header, and a direction header corresponding to the first test image, and the first test image, the file header, the image header, and the direction header corresponding to the first test image are obtained by the above-mentioned image generation method;
[0132] S302: Encode the first test image by using a DSC encoder to obtain a test image data stream;
[0133] S303: Send the test image data stream to the receiving end.
[0134] In some embodiments, the first DPX file is used to test the performance of the DSC algorithm. The first DPX file stores a first test image, a file header, an image header, and a direction header corresponding to the first test image.
[0135] Figure 4 A schematic diagram of the process of generating a DPX file is shown in FIG. Figure 4As shown, generating the first DPX file may include: obtaining a first test image, a file header, an image header, and a direction header corresponding to the first test image; writing the file header, the image header, the direction header, and the first test image to obtain a first DPX file. Exemplarily, obtaining a first test image, the first test image is obtained by the above-mentioned image generation method. Obtaining the file header corresponding to the first test image includes: obtaining image metadata, the image metadata includes: image size of 1920×1080, image format of RGB444, pixel width of 8 bits, image generated according to random pixels; generating a file header according to the image metadata, the file header includes: file name 1920×1080_RGB444.dpx (its direction is from left to right, from top to bottom), file size of 768+640+256+7808+1920×1080×3=6228992 bytes, and timestamp of 2024-8-1. The image header corresponding to the first test image includes: image direction, number of pixels per row 1920×3, number of image rows 1080, image quality is high, number of image bits is 6228992×8=49831936bits, uncompressed image, end identifier, image description. The direction header is the upper left corner of the display of electronic device A. Write the above file header, image header, direction header and the first test image to obtain the first DPX file.
[0136] In some embodiments, the image data stream refers to a data stream obtained by encoding the first test image through a DSC encoder. Specifically, the image data stream includes encoded image information, which is organized in a specific format and compression method to reduce the amount of data during transmission, improve transmission efficiency, and restore to the original image or recognizable image data after decoding at the receiving end.
[0137] In this way, the test image is encoded by the DSC encoder, and the encoded image data stream is sent to the receiving end, which can effectively verify the performance of the DSC algorithm.
[0138] Figure 5 FIG. 1 is a flow chart of a DSC testing method according to an embodiment of the present disclosure. Figure 2 , the DSC test method is applied to the receiving end, such as Figure 5 As shown, the method comprises at least the following steps:
[0139] S501: decoding the test image data stream sent by the sending end through an image processor to obtain a second DPX file; the second DPX file stores a second test image, a file header, an image header, and a direction header corresponding to the second test image;
[0140] S502: Compare the first test image and the second test image to obtain a test result; the first test image is obtained by the above-mentioned image generation method.
[0141] In some embodiments, the second DPX file refers to a file obtained by decoding the test image data stream sent by the sending end through an image processor.
[0142] In some embodiments, the test results may be used to:
[0143] 1. Verify image integrity: By comparing the "first test image" and the "second test image", you can verify whether the image integrity is maintained during transmission or processing. Any difference may indicate that an error or data loss occurred during transmission or processing.
[0144] 2. Evaluate image quality: By comparing the "first test image" and the "second test image", it can also be used to evaluate whether the image quality has changed. For example, if the image is compressed or converted during transmission, then comparing the original image and the decoded image can reveal the impact of compression or conversion on image quality.
[0145] 3. Detect transmission errors: During the image transmission process, transmission errors may occur due to network problems, equipment failures, or other factors. By comparing the "first test image" and the "second test image", these errors can be detected and identified, so that corresponding corrective measures can be taken.
[0146] 4. Performance evaluation: In some cases, test images are used to evaluate the performance of image processing systems or transmission systems. By comparing the "first test image" and the "second test image", the performance of the system under different conditions can be quantified, such as transmission speed, processing time, image fidelity, etc.
[0147] 5. Debugging and troubleshooting: In the development process of image processing or transmission systems, comparing test images is an important means of debugging and troubleshooting. By comparing the "first test image" and the "second test image", the problem can be located and corresponding repair measures can be taken.
[0148] In this way, by comparing the “first test image” and the “second test image”, the performance of the DSC algorithm can be effectively verified.
[0149] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. An image generation method, characterized in that: The method comprises: Inputting configuration information of the test scenario into the target component to obtain a file header, an image header and a direction header output by the target component; wherein the configuration information includes image metadata and test requirement data; Inputting the file header, the image header and the direction header into an image generation model to obtain a test image generated by the image generation model; The step of inputting the configuration information of the test scenario into the target component to obtain the file header, image header and direction header output by the target component includes: Generate the file header according to the image metadata; the file header is used to provide image attribute information for generating the test image; Generate the image header according to the image metadata and the test requirement data; the image header is used to provide test scene features and image structure information for generating the test image; Generate the direction header according to the image metadata and the test requirement data; the direction header is used to provide the position of the test image in the display for generating the test image; The step of inputting the file header, the image header and the direction header into an image generation model to obtain a test image generated by the image generation model includes: Generate a target pixel arbitrarily; The target pixel is called to generate the test image according to the file header, the image header and the direction header.
2. The method according to claim 1, characterized in that The target pixel is a white pixel, wherein the calling of the target pixel to generate the test image according to the file header, the image header and the direction header comprises: Calling the white pixel; the white pixel is a pixel point composed entirely of white; The white pixels are cycled based on the file header, the image header, and the direction header to generate the test image.
3. The method according to claim 1, characterized in that The target pixel is a black pixel, wherein the calling of the target pixel to generate the test image according to the file header, the image header and the direction header comprises: Calling the black pixel; the black pixel is a pixel point composed entirely of black; The black pixels are cycled based on the file header, the image header, and the direction header to generate the test image.
4. The method according to claim 1, characterized in that: The target pixel is a random pixel, wherein the calling of the target pixel to generate the test image according to the file header, the image header and the direction header includes: Calling the random pixel; the random pixel is a pixel point composed of any color; The random pixels are looped based on the file header, the image header, and the direction header to generate the test image.
5. The method according to claim 1, characterized in that The target pixel is an index pixel, wherein calling the target pixel to generate the test image according to the file header, the image header and the direction header includes: Calling the index pixel; the index pixel is a pixel point of preset coordinates; The index pixels are looped based on the file header, the image header and the direction header to generate the test image.
6. The method according to claim 1, characterized in that The method further comprises: Calculate the size of the test image according to the configuration information to obtain a predicted value of the size of the test image; An error value is obtained based on a comparison between the true value of the size of the test image and the predicted value of the size of the test image; the error value is used to determine whether the test image can be used as a test image for a DSC test.
7. A DSC test method, applied to a transmitting end, characterized in that: The method comprises: Obtain a first DPX file corresponding to the test scene; the first DPX file stores a first test image, a file header, an image header, and a direction header corresponding to the first test image, and the first test image, the file header, the image header, and the direction header corresponding to the first test image are obtained by the method described in any one of claims 1 to 6; Encoding the first test image by a DSC encoder to obtain a test image data stream; The test image data stream is sent to a receiving end.
8. A DSC test method, applied to a receiving end, characterized in that: The method comprises: The test image data stream sent by the sending end is decoded by an image processor to obtain a second DPX file; the second DPX file stores a second test image, a file header, an image header and a direction header corresponding to the second test image; the test image data stream is obtained by the method of claim 7; The first test image and the second test image are compared to obtain a test result; the first test image is obtained by the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Ultrasonic image reverse displaying method
CN101125090A
Method for segmenting small organs in a medical image
CN109658419A