Picture coupling method and device, equipment and storage medium

By calculating the first pixel data of the to-processed picture and sharing parameter information, the problem of redundancy and waste when storing multiple pictures is solved, and the storage space utilization and processing efficiency are improved.

CN119991460APending Publication Date: 2025-05-13ZHUHAI MOJIE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411989927.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art has redundant waste of storage space when processing and storing multiple pictures, and image compression and decompression consume time, affecting system performance and user experience.

Method used

By acquiring the first picture color depth of the picture to be processed, and adding the first picture parameters to the head data of the coupled picture, the multiple pictures share the same parameter information, and the first pixel data is stored in the initialization data area of ​​the coupled picture according to the picture coupling order.

Benefits of technology

The representation of image data is optimized, which reduces storage redundancy caused by different color depths, saves storage space, improves the space utilization of storage space, and reduces the time consumption of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991460A_ABST
    Figure CN119991460A_ABST
Patent Text Reader

Abstract

The invention provides a picture coupling method and device, equipment and a storage medium, and the method comprises the steps: calculating the first pixel data of a to-be-processed picture through the first picture color depth of the to-be-processed picture, optimizing the representation of picture data, and reducing the storage redundancy caused by different color depths; by adding the first picture parameter to the head data of the coupled picture, the plurality of pictures share the same parameter information, so that the storage of repeated data can be reduced, and the storage space is saved; according to the image coupling sequence, the first pixel data is sequentially stored in the initialized data area of the coupled image, so that the image data is orderly integrated, the space waste caused by disordered storage is avoided, and the space utilization rate of the storage space is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image coupling method, device, equipment and storage medium. Background Art

[0002] Under the current technical framework, the processing and storage of multiple images face a series of challenges. First, the formatted header information of each image needs to be saved separately, such as parameters such as width, height, and format, which will cause redundant waste of storage space in image resources with the same parameters. Although the use of image compression technology can compress the amount of image data and reduce the storage space occupied by image data, it often requires decompression in actual use, which will consume a certain amount of time, thus posing challenges to the overall performance of the system and user experience. In addition, due to cost, volume, and power consumption considerations, the storage space of the image processing system is often limited, and the diverse UI interactions rely on the use of image resources, which greatly limits the performance of such products in visual interaction.

[0003] Therefore, how to improve the space utilization of image resource storage space has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a picture coupling method, apparatus, device and storage medium, aiming to improve the space utilization rate of picture resource storage space.

[0005] In a first aspect, the present application provides a picture coupling method, the method comprising:

[0006] Obtain at least two pictures to be processed, and obtain a first picture color depth corresponding to each of the pictures to be processed;

[0007] Determining first pixel data of the picture to be processed based on a first picture color depth of the picture to be processed;

[0008] Appending the first picture parameter corresponding to each of the to-be-processed pictures to the header data of the coupled pictures to obtain the coupled header data of the coupled pictures;

[0009] Based on the picture coupling sequence corresponding to each of the pictures to be processed, first pixel data of each of the pictures to be processed is sequentially stored in the initialization data area of ​​the coupled picture to obtain second pixel data of the coupled picture;

[0010] Based on the coupled header data and the second pixel data, a coupled picture corresponding to the picture to be processed is obtained.

[0011] In a second aspect, the present application further provides an image coupling device, the image coupling device comprising:

[0012] An image acquisition module, used to acquire at least two images to be processed, and to acquire a first image color depth corresponding to each of the images to be processed;

[0013] A first pixel data calculation module, used to determine first pixel data of the image to be processed based on a first image color depth of the image to be processed;

[0014] A header data appending module, used for appending the first picture parameter corresponding to each of the to-be-processed pictures to the header data of the coupled pictures, to obtain coupled header data of the coupled pictures;

[0015] A second pixel data calculation module is used to store the first pixel data of each of the to-be-processed pictures in sequence into the initialization data area of ​​the coupled picture based on the picture coupling order corresponding to each of the to-be-processed pictures, so as to obtain the second pixel data of the coupled picture;

[0016] A coupling picture data obtaining module is used to obtain a coupling picture corresponding to the picture to be processed based on the coupling header data and the second pixel data.

[0017] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the image coupling method as described above are implemented.

[0018] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the image coupling method as described above are implemented.

[0019] The present application provides a picture coupling method, apparatus, computer equipment and storage medium. The method of the present application includes calculating first pixel data of a picture to be processed by the color depth of the first picture of the picture to be processed, optimizing the representation of picture data, and reducing storage redundancy caused by different color depths; by appending the first picture parameter to the header data of the coupled picture, multiple pictures share the same parameter information, which can reduce the storage of duplicate data and thus save storage space; storing the first pixel data in the initialization data area of ​​the coupled picture in sequence according to the picture coupling order, thereby realizing orderly integration of picture data, avoiding space waste caused by disordered storage, and improving space utilization of storage space. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 A schematic diagram of a flow chart of a first embodiment of a picture coupling method provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a flow chart of a second embodiment of a picture coupling method provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of a multi-image coupling process provided in an embodiment of the present application;

[0024] Figure 4 is a structural schematic diagram of a first embodiment of a picture coupling device provided by the present application;

[0025] Figure 5 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0026] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0029] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0030] Please refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of a first embodiment of a picture coupling method provided in an embodiment of the present application.

[0031] like Figure 1As shown, the picture coupling method includes steps S101 to S104.

[0032] S101, obtaining at least two pictures to be processed, and obtaining a first picture color depth corresponding to each of the pictures to be processed;

[0033] In one embodiment, the image to be processed may be an image downloaded from the network, an image stored locally, or an image collected in real time by a camera. The image to be processed is an image that needs to be stored in a coupled manner.

[0034] In one embodiment, at least two images to be processed used for coupling are required to have the same color format. For example, if coupling is performed on a monochrome screen (one color channel), the images to be processed are required to be grayscale images. A color screen may also be used, in which case the images to be processed are required to be color images of the corresponding color channel. Multiple images to be processed used for coupling are also required to share header data and formatted data areas.

[0035] The header data refers to the metadata part of the image file, including information such as the image size, color depth, and color space. When all images to be processed share the same header data, it means that they have the same basic properties, which helps maintain consistency during the coupling process and simplifies the processing flow. For example, in image processing, if all images have the same size and color depth, then when performing image fusion or stitching, there is no need to process these properties for each image separately, thereby improving efficiency.

[0036] The data area refers to the part of the image that actually stores pixel data. When multiple coupled images to be processed share the same data area, it means that they can be regarded as a continuous data block during storage and processing. This can reduce memory usage and improve data processing efficiency.

[0037] In addition, to ensure data independence, the sum of the color depths of the first images of all the images to be processed that participate in the coupling cannot exceed the screen color depth of the target screen used to perform the coupling operation, that is, the number of images to be processed that participate in the coupling depends on the color depth of the target screen. When coupling images, ensuring data independence means that the data of each image to be processed will not interfere with each other and maintain their respective integrity. By controlling the sum of the color depths of the first images of the images to be processed that participate in the coupling not to exceed the screen color depth of the target screen, it can be ensured that each image can still clearly express its original information after coupling, and details will not be lost due to color depth limitations. The "data" here refers to the first pixel data of the image to be processed.

[0038] Furthermore, the screen color depth of the target screen corresponding to the image to be processed is obtained; based on preset screening rules and the screen color depth, at least two images to be processed are screened out from the set of images to be processed.

[0039] Among them, the preset screening rule is that the sum of the first picture color depths of the pictures to be processed is less than or equal to the screen color depth.

[0040] In one embodiment, the screen color depth refers to the maximum color depth that the target screen can handle. For example, if the screen color depth of the target screen is 8 bits, then it can handle images with a color depth of 8 bits at most. The first image color depth of the image to be processed refers to the number of colors that the image can represent. In the coupling operation, the sum of the first image color depths of all the images to be processed that participate in the coupling operation cannot exceed the screen color depth of the target screen. The target screen refers to the screen of the device used to store the coupled images.

[0041] Specifically, assuming that the screen color depth of the target screen is C, and two pictures are coupled, and their color depths are A and B respectively, then A+B≤C.

[0042] Exemplarily, assuming that the screen color depth of the target screen is 8 bits, the target screen can couple at most 4 to-be-processed pictures whose first picture color depth is 2; or at most, can couple 2 to-be-processed pictures whose first picture color depth is 4; or, at most, can couple 4 to-be-processed pictures whose first picture color depth is 1 and 1 to-be-processed picture whose first picture color depth is 4; in such examples, the maximum sum of the first picture color depths of the to-be-processed pictures involved in the coupling can only be the screen color depth.

[0043] This embodiment requires that the color format of the images to be processed is the same and that the formatting header and data area are shared, so that all the images to be processed that participate in the coupling have the same basic attributes (such as size and color depth). Therefore, when coupling the images, it is not necessary to process these basic attributes separately for each image to be processed, thereby improving the processing efficiency. At the same time, the shared data area means that multiple images to be processed can be regarded as a continuous data block for storage and processing, which can reduce memory usage and improve data processing efficiency. By controlling the sum of the color depths of the first images of the images to be processed that participate in the coupling not to exceed the color depth of the target screen, it is ensured that each image can completely retain the original first pixel data after coupling, and will not lose details due to color depth limitations, thereby maintaining the independence and integrity of the first pixel data.

[0044] Furthermore, if Figure 2 As shown, after obtaining at least two pictures to be processed and obtaining the first picture parameters corresponding to each picture to be processed, the method further includes:

[0045] S201, obtaining a first picture parameter of the picture to be processed;

[0046] In one embodiment, the first picture parameters further include a first picture width, a first picture height, and a first picture color depth.

[0047] In one embodiment, before performing the picture coupling, the first picture parameters of each picture to be processed for the picture coupling may be collected in advance and saved in a database. Each picture to be processed may correspond to a uniquely identifiable picture number. When the first picture parameters of each picture to be processed are saved in the database, the first picture parameters of each picture to be processed are bound to the uniquely identifiable picture number. When the first picture parameters of the picture to be processed need to be used, the corresponding first picture parameters may be searched and extracted from the database according to the picture number of the picture to be processed.

[0048] S202, determining a second picture parameter of a coupled picture based on first picture parameters corresponding to each picture to be processed;

[0049] In one embodiment, the size of a coupled image obtained by coupling multiple images will use the maximum size parameter of the images to be processed that participate in the coupling as the size parameter of the coupled image, so as to ensure the integrity of the image information of all the images to be processed that participate in the coupling. Therefore, the second image parameter of the coupled image can be determined according to the first image parameter of each image to be processed.

[0050] In one embodiment, the second picture parameters include a second picture width, a second picture height, and a second picture color depth.

[0051] In one embodiment, the first picture widths of the pictures to be processed are compared, and the maximum value of the first picture widths is used as the second picture width of the coupled picture; the first picture heights of the pictures to be processed are compared, and the maximum value of the first picture heights is used as the second picture height of the coupled picture; and the sum of the first picture color depths of the pictures to be processed is used as the second picture color depth of the coupled picture.

[0052] Specifically, according to the first picture parameters of each to-be-processed picture involved in the coupling, the first picture width, the first picture height and the first picture color depth of each to-be-processed picture are collected respectively. The first picture widths of each to-be-processed picture are compared to determine the maximum first picture width, and the first picture heights of each to-be-processed picture are compared to determine the maximum first picture height. The maximum first picture width and the maximum first picture height are used as the second picture width and the second picture height of the coupled picture to obtain the size information of the coupled picture.

[0053] In one embodiment, the sum of the first picture color depths of the pictures to be processed that participate in the coupling must be less than or equal to the target screen used to perform the coupling operation, and the coupled picture is obtained by coupling the pictures to be processed. Therefore, the screen color depth of the target screen cannot be used as the color depth of the coupled picture, and the sum of the first picture color depths of the pictures to be processed that participate in the coupling is used as the second picture color depth of the coupled picture.

[0054] S203: Arrange the pictures to be processed in the coupled picture based on the second picture parameter and the preset alignment mode, so as to perform a header data appending operation and a pixel calculation operation on each picture to be processed.

[0055] In one embodiment, the pictures to be processed within the range of the second picture parameters (ie, the second picture width and the second picture height) may be arranged according to a preset alignment method set by the user.

[0056] Among them, the preset alignment methods may include overall center, upper left, top center, upper right, middle right, overall center, lower right, bottom center, lower left, and middle left.

[0057] For example, if the user chooses to arrange the images to be processed in the overall center alignment mode, then all the images to be processed will be aligned at the center of the coupled image to maintain symmetry and balance. Specifically, according to the image width and height of the coupled image, the lines connecting the midpoints of the two width sides and the two height sides are respectively taken, and the intersection of the lines connecting the midpoints of the width sides and the midpoints of the height sides is the center of the coupled image.

[0058] It can be understood that different alignment methods will cause the relative positions of the images to be processed in the coupled images to be different, and the first image parameters of each image to be processed involved in the coupling are also different. Therefore, different preset alignment methods will affect the pixel superposition and mixing methods, resulting in different pixel value calculation results for each pixel point in the coupled image.

[0059] This embodiment determines the second picture parameters (including width, height and color depth) of the coupled picture by obtaining the first picture parameters of the picture to be processed, so as to ensure the integrity of the picture information of all the pictures to be processed that participate in the coupling. By arranging the pictures to be processed in the coupled picture according to a preset alignment, the pixel value of each pixel in the coupled picture can be accurately calculated, thereby generating a high-quality coupled picture.

[0060] Continue as Figure 1 As shown, after step S101, the following steps are also included:

[0061] S102, determining first pixel data of the picture to be processed based on a first picture color depth of the picture to be processed;

[0062] In one embodiment, the calculation formula of the first pixel data can be expressed as:

[0063] P = 2 n -1

[0064] Among them, P represents the first pixel data corresponding to the image to be processed, and n is the first image color depth corresponding to the image to be processed.

[0065] For example, for a to-be-processed picture whose color depth is 2, the first pixel data is 2 2 -1, binary number 11 (decimal number 3); for the first image to be processed with a color depth of 4, its first pixel data is 2 4 -1, binary 1111 (decimal 15).

[0066] S103, appending the first picture parameter corresponding to each of the to-be-processed pictures to the header data of the coupled pictures to obtain the coupled header data of the coupled pictures;

[0067] In one embodiment, the header data of the coupled image includes information describing the image attributes and format of the coupled image, wherein the image attributes may include image size, color mode, bit depth, etc., and the image format may be an image file format such as JPEG, PNG, EPS, etc. The header data is usually located at the beginning of the image file and is text-readable, that is, the header data of the coupled image is editable.

[0068] During the picture coupling process, for each picture to be processed participating in the coupling, the header data of one of the pictures to be processed is selected as the header data template of the coupled picture, and then the first picture parameters corresponding to all the pictures to be processed participating in the coupling are appended to the header data template to form the header data of the coupled picture, so that each picture to be processed participating in the coupling shares the formatted header data.

[0069] Among them, the first image parameters appended to the header data of the coupled image may include the first image width, the first image height and the first image color depth of the image to be processed, and may also include other relevant image description information, such as image resolution, compression information, color space, number of color channels, transparency channel, etc.

[0070] This embodiment reduces the storage space occupied by the image resources by reusing the formatting header and sharing the data area.

[0071] S104, based on the picture coupling sequence corresponding to each of the pictures to be processed, sequentially storing the first pixel data of each of the pictures to be processed into the initialization data area of ​​the coupled picture, to obtain the second pixel data of the coupled picture;

[0072] In one embodiment, before calculating the second pixel data of the coupled picture, the pixel data in the data area for storing the second pixel data of the coupled picture is initialized to 0, thereby obtaining an initialized data area of ​​the coupled picture. In the coupling operation, the pixel data of each picture to be processed will occupy a specific number of bits in the initialized data area of ​​the coupled picture.

[0073] During the coupling process, the pixel values ​​of each pixel point in the coupled image corresponding to the first pixel data of each image to be processed are arranged in the order of image coupling to obtain the pixel value corresponding to each pixel point in the coupled image. By traversing all the pixel points in the coupled image, the second pixel data of the coupled image can be obtained.

[0074] For example, assuming that there are two stations involved in the coupling of unprocessed pictures, the pixel values ​​of the same pixel point in the coupled picture corresponding to the first pixel data of the two unprocessed pictures are a and b respectively, and the number of data bits that the pixel values ​​of the two unprocessed pictures need to occupy is determined according to the color depth of the two unprocessed pictures. For example, the number of data bits of the coupled pictures is 8 bits, the number of data bits that the pixel value a of the first unprocessed picture needs to occupy is 2, and the number of data bits that the pixel value b of the second unprocessed picture needs to occupy is 6. Then, the pixel value a and the pixel value b are arranged in the order of picture superposition, occupying the 8-bit data bit number of the coupled picture, to realize the assignment of the pixel value of the pixel point in the coupled picture.

[0075] Specifically, the overall process of picture coupling can be as follows Figure 3 As shown, first, select the picture resources for coupling, that is, at least two pictures to be processed that participate in the coupling; take the header data of one of the pictures to be processed as the header data template of the coupled picture; initialize the pixel data in the data area of ​​the coupled picture to 0, and obtain the initialized data area. Obtain the first picture parameters of all the pictures to be processed that participate in the coupling, that is, parameters such as width, height, and color depth; according to the number of data bits of the color depth occupied by each picture to be processed, offset the first pixel data corresponding to each picture to be processed and perform a logical "or" operation with the first pixel data to obtain the second pixel data of the coupled picture; append the first picture parameters (picture width, height, color depth, etc.) of each picture to be processed to the header data of the coupled picture; repeat the above logic, traverse all pictures to be processed, until the data coupling operation of all pictures to be processed is completed, and a coupled picture is generated.

[0076] Furthermore, based on the picture coupling order corresponding to each picture to be processed and the first picture color depth of each picture to be processed, the pixel offset position of the first pixel data corresponding to each picture to be processed in the initialization data area is determined; based on the pixel offset position corresponding to each picture to be processed, the first pixel data corresponding to each pixel point in the coupled picture is stored in the initialization data area in sequence to obtain the second pixel data of the coupled picture.

[0077] For example, for a target screen with a color depth of 8 bits, suppose two images with a color depth of 2 and one with a color depth of 4 are coupled to obtain a coupled image with a color depth of 8 bits. In the coupled image, the serial numbers of the images to be processed are 1, 2, and 3 respectively. For the first image with a color depth of 2, the mask is 2 2-1, binary number 11 (decimal 3), for the first image to be processed with a color depth of 4, the mask is 2 4 -1, binary 1111 (decimal 15). The first pixel data of the first image to be processed will occupy the 0th and 1st bits of the 8 bits, the first pixel data of the second image to be processed will occupy the 2nd and 3rd bits of the 8 bits, and the first pixel data of the third image to be processed will occupy the 4th to 7th bits of the 8 bits, which can be expressed as follows:

[0078] D=D|D0

[0079] D=D|(D1<<2)

[0080] D=D|(D2<<4)

[0081] Where D represents the pixel value of the coupled image, D0 represents the pixel value of the first image to be processed, D1 represents the pixel value of the second image to be processed, and D2 represents the pixel value of the third image to be processed. Because the mask of the first image to be processed is 2 2 -1, the number of data bits occupied by the binary number 11 is 2, so the first pixel data of the first image to be processed will occupy the 0th and 1st bits in the 8bit; at this time, the 0th and 1st bits are already occupied, and the point occupied by the first pixel data of the second image to be processed needs to be shifted back by 2 bits, which is expressed as (D1<<2), that is, the first pixel data of the second image to be processed is stored starting from the 2nd bit, and the mask corresponding to the first pixel data of the second image to be processed is also 2 2 -1, the number of data bits occupied by the binary number 11 is 2, so the first pixel data of the second image to be processed occupies the 2nd and 3rd bits in the 8bit; at this time, the first four bits in the 8bit are already occupied, and the first pixel data of the third image to be processed needs to be shifted back by four bits (the total number of data bits occupied by the first two images to be processed), which is expressed as (D1<<4), starting from the fifth data bit in the 8bit, and the first pixel data of the third image to be processed is 2 4 -1, binary 1111 occupies four bits, so the third image to be processed occupies the 4th to 7th bits in 8 bits.

[0082] Among them, the pixel offset bit of D0 is 0, and the mask value of the first pixel data of the first picture is 2 2-1, the number of data bits occupied by the binary number 11 is 2, which means that the first pixel data of the first image to be processed occupies the 0th and 1th bits of the second pixel data; the 2 in (D1<<2) means that the pixel offset corresponding to the first pixel data of the second image to be processed is 2, which means that the first pixel data of the second image to be processed occupies the third data bit in the 8-bit data bit (that is, the second bit of the 8-bit), and the mask value of the first pixel data of the second image to be processed is 2 2 -1, the number of data bits occupied by the binary number 11 is 2, so the first pixel data of the second image to be processed occupies the 2nd and 3rd bits of the second pixel data; the 4 in (D2<<4) indicates that the pixel offset corresponding to the first pixel data of the third image to be processed is 4, because the first pixel data of the first and second images to be processed already occupy the first 4 data bits of 8 bits, so the third image to be processed needs to be shifted back 4 data bits when stored, and the first pixel data of the third image to be processed is 2 4 -1, binary 1111 occupies four bits, therefore, the first pixel data of the third image to be processed occupies the 4th to 7th bits of the second pixel data; the final synthesized 8-bit second pixel data D is the final pixel value of a pixel point in the coupled image.

[0083] This embodiment ensures the accuracy of data during the coupling process by initializing the data area to 0 and avoids potential data interference. By accurately controlling the position of the pixel data of each image to be processed in the coupled image, the first pixel data of different images to be processed are correctly superimposed and coupled according to the pixel offset bit to obtain the second pixel data of the coupled image, thereby improving the efficiency and quality of image coupling.

[0084] S105. Obtain a coupled picture corresponding to the picture to be processed based on the coupled header data and the second pixel data.

[0085] In one embodiment, coupling the picture data includes coupling the header data and the second pixel data.

[0086] The coupling header data includes the first picture parameters of each to-be-processed picture involved in the coupling, such as picture size (picture width, picture height), color depth, color space and other information. In subsequent application scenarios, users can search for the picture information of each to-be-processed picture involved in the coupling in the coupled picture according to the coupling header data. For example, if the user needs to extract a certain to-be-processed picture in the coupled picture, the coupling header data of a certain coupled picture can be matched through the header data of the to-be-processed picture, indicating that the to-be-processed picture participates in the coupling of the coupled picture, and then the first picture parameters of the corresponding to-be-processed picture are extracted from the coupled picture to generate the to-be-processed picture.

[0087] The second pixel data includes the pixel value of each pixel point in the coupled image; according to the pixel offset bits and pixel arrangement order of each image to be processed participating in the coupling in the second pixel data, the pixel value of each pixel point of each image to be processed participating in the coupling can be extracted from the second pixel data according to the pixel offset bits.

[0088] In one embodiment, for a coupled image, the pixel value of each pixel thereof is obtained by permuting and combining the pixel values ​​of multiple images to be processed that participate in the coupling, and the process of extracting the first pixel data of each image to be processed that participates in the coupling from the coupled image is the inverse process of the image coupling operation.

[0089] Specifically, in the coupled picture, according to the picture coupling order of each picture to be processed and the color depth of the first picture, the pixel value of each picture to be processed participating in the coupling at each pixel point is extracted from the pixel value of each pixel point in the coupled picture, and the pixel values ​​of all pixel points of each picture to be processed can be obtained by traversing all the pixel points in the coupled picture, thereby extracting the first pixel data corresponding to each picture to be processed from the second pixel data of the coupled picture.

[0090] Exemplarily, if the pixel value of a certain pixel in the coupled image is 8-bit data, and the coupled image is coupled by two to-be-processed images with a first image color depth of 2 and one to-be-processed image with a first image color depth of 4, then according to the above coupling process, the number of data bits occupied by the pixel values ​​of the two to-be-processed images with a first image color depth of 2 is both 2 (the binary number of the first pixel data is 11), and the number of data bits occupied by the pixel values ​​of the to-be-processed image with a first image color depth of 4 is 4. If the arrangement order of the above three to-be-processed images is arranged in the order of the first image color depth of 2, 2, and 4, then the pixel value of the first to-be-processed image with a first image color depth of 2 at the pixel point is the 0th and 1st bit values ​​in the 8-bit data, the pixel value of the second to-be-processed image with a first image color depth of 2 at the pixel point is the 2nd and 3rd bit values ​​in the 8-bit data, and the pixel value of the first to-be-processed image with a first image color depth of 4 at the pixel point is the 4th to 7th bit values ​​in the 8-bit data.

[0091] Furthermore, a coupling pixel value of any target pixel point in the coupling picture is obtained; based on the first picture color depth of the target picture in the coupling picture, a pixel offset bit of the target picture is determined; based on the pixel offset bit of the target picture, a pixel value of the target picture at the target pixel point is extracted from the coupling pixel value.

[0092] In one embodiment, by performing a logical “AND” operation on the second pixel data of the coupled picture and the mask corresponding to the picture to be processed, all pixel values ​​of the picture to be processed can be extracted from the second pixel data of the coupled picture.

[0093] For example, it is assumed that the width, height, color depth and other parameters of each to-be-processed picture have been added to the header data of the coupled picture, and the first pixel data of each to-be-processed picture is arranged row by row in the initialization data area. Based on this, the pixel value in the second pixel data of the coupled picture is logically ANDed with the picture mask corresponding to each to-be-processed picture, so as to obtain the pixel value of all pixels in each to-be-processed picture.

[0094] For example, for a target screen with an 8-bit color depth, suppose two first images with a color depth of 2 and one first image with a color depth of 4 are coupled to obtain a coupled image with a second image color depth of 8 bits. Assuming that the pixel value of a certain pixel in the coupled image is D, the specific value methods of the above three images in the pixel are:

[0095] D0=D&3

[0096] D1=(D>>2)&3, D needs to offset the color depth of the first picture to be processed by 2 bits. D2=(D>>4)&15, D needs to offset the color depth of the first and second pictures to be processed, a total of 4 bits.

[0097] Among them, starting from the second picture to be processed, it is necessary to offset the sum of the color depths of the first picture of all the previous pictures to be processed before calculation.

[0098] Specifically, D represents the pixel value of a pixel point in the coupled image, D0 is the pixel value of the first image to be processed whose color depth is 2, D0=D&3 represents the pixel value of the first image to be processed whose color depth is 2 bits obtained by extracting the 0th and 1st pixel data from the 8-bit second pixel data, which is 3; D1 is the pixel value of the second image to be processed whose color depth is 2, D1=(D>>2)&3 represents the pixel value of the second image to be processed whose color depth is 2 is obtained by offsetting the 8-bit second pixel data by two bits (D>>2) and collecting the 2nd and 3rd pixel data, which is 3; D2 is the pixel value of the first image to be processed whose color depth is 4, (D>>4) represents the value of the second pixel data (8-bit data) by offsetting by 4 bits, D2=(D>>4)&15 represents the pixel value of the first image to be processed whose color depth is 4 is obtained by offsetting the 8-bit second pixel data by 4 bits and taking the data from the 4th to the 7th bits, which is 15.

[0099] This embodiment can accurately separate the pixel values ​​of each image to be processed from the pixel values ​​of the coupled images through the application of logical "AND" operations and masks. Even after multiple images are coupled, the independence and integrity of each image data can be maintained, which not only improves the flexibility and reliability of image coupling and decoupling, but also provides accurate data support for subsequent image processing and analysis, thereby enhancing the availability and practicality of image data.

[0100] The present embodiment provides a picture coupling method, which calculates the first pixel data of the picture to be processed by the first picture color depth of the picture to be processed, optimizes the representation of the picture data, and reduces the storage redundancy caused by different color depths; by appending the first picture parameter to the header data of the coupled picture, multiple pictures share the same parameter information, which can reduce the storage of duplicate data, thereby saving storage space; according to the picture coupling order, the first pixel data is stored in the initialization data area of ​​the coupled picture in sequence, thereby realizing the orderly integration of the picture data, avoiding the space waste caused by disordered storage, effectively improving the storage efficiency of the picture, and improving the space utilization rate of the storage space.

[0101] See also Figure 4 , Figure 4 1 is a schematic diagram of the structure of a first embodiment of an image coupling device provided by the present application, wherein the image coupling device is used to execute the aforementioned image coupling method.

[0102] like Figure 4 As shown, the image coupling device 300 includes: an image acquisition module 301, a first pixel data calculation module 302, a header data appending module 303, a second pixel data calculation module 304 and a coupled image data acquisition module 305.

[0103] The picture acquisition module 301 is used to acquire at least two pictures to be processed, and acquire the first picture color depth corresponding to each of the pictures to be processed;

[0104] A first pixel data calculation module 302, configured to determine first pixel data of the image to be processed based on a first image color depth of the image to be processed;

[0105] A header data appending module 303, used to append the first picture parameters corresponding to each of the to-be-processed pictures to the header data of the coupled pictures, so as to obtain coupled header data of the coupled pictures;

[0106] A second pixel data calculation module 304 is used to store the first pixel data of each of the to-be-processed pictures in sequence into the initialization data area of ​​the coupled pictures based on the picture coupling order corresponding to each of the to-be-processed pictures, so as to obtain the second pixel data of the coupled pictures;

[0107] The coupling picture data obtaining module 305 is used to obtain a coupling picture corresponding to the picture to be processed based on the coupling header data and the second pixel data.

[0108] In one embodiment, the picture acquisition module 301 includes:

[0109] A screen color depth acquisition unit, used to acquire the screen color depth of a target screen for performing a coupling operation;

[0110] A picture screening unit, configured to screen out at least two pictures to be processed from a set of pictures to be processed based on a preset screening rule and the screen color depth;

[0111] Among them, the preset screening rule is that the sum of the first picture color depths of the pictures to be processed is less than or equal to the screen color depth.

[0112] In one embodiment, the first picture parameter further includes a first picture width and a first picture height;

[0113] The image coupling device 300 further includes an image alignment module, including:

[0114] A first picture parameter acquisition unit, used to acquire a first picture parameter of the picture to be processed;

[0115] A second picture parameter determination unit, configured to determine a second picture parameter of the coupled picture based on the first picture parameters corresponding to each of the pictures to be processed;

[0116] The picture alignment unit is used to align and arrange each of the pictures to be processed based on the second picture parameters and a preset alignment method, so as to perform a header data appending operation and a pixel calculation operation on each of the pictures to be processed.

[0117] In one embodiment, the first picture parameter includes a first picture width, a first picture height, and a first picture color depth; the second picture parameter includes a second picture width, a second picture height, and a second picture color depth;

[0118] The second picture parameter determination unit includes:

[0119] A second picture width determination subunit, configured to compare the first picture widths of the pictures to be processed, and use the maximum first picture width as the second picture width of the coupled picture;

[0120] A second picture height determination subunit, configured to compare the first picture heights of the pictures to be processed, and use the maximum first picture height as the second picture height of the coupled picture;

[0121] The second picture color depth determination subunit is used to use the sum of the first picture color depths of the to-be-processed pictures as the second picture color depth of the coupled picture.

[0122] In one embodiment, the second pixel data calculation module 304 includes:

[0123] a first pixel offset determination unit, configured to determine a pixel offset of the first pixel data corresponding to each of the to-be-processed pictures in the initialization data area based on the picture coupling order corresponding to each of the to-be-processed pictures and the first picture color depth of each of the to-be-processed pictures;

[0124] The second pixel data obtaining unit is used to store the first pixel data corresponding to each pixel point in the coupled image in the initialization data area in sequence based on the pixel offset bit corresponding to each of the images to be processed, so as to obtain the second pixel data of the coupled image.

[0125] In one embodiment, the image coupling device 300 further includes a pixel extraction module, including:

[0126] A coupling pixel value acquisition unit, used to acquire a coupling pixel value of any target pixel point in the coupling picture;

[0127] a second pixel offset determination unit, configured to determine a pixel offset of the target picture based on a first picture color depth of the target picture in the coupled picture;

[0128] A pixel value extraction unit is used to extract the pixel value of the target image at the target pixel point from the coupled pixel value based on the pixel offset bit of the target image.

[0129] In one embodiment, the first pixel data calculation module 302 includes:

[0130] A first pixel data calculation unit, configured to calculate first pixel data of the image to be processed based on the color depth of the first image in a calculation formula for the first pixel data;

[0131] The calculation formula of the first pixel data can be expressed as:

[0132] P = 2 n -1

[0133] Among them, P represents the pixel mask value of the first pixel data corresponding to the image to be processed, and n is the color depth of the first image corresponding to the image to be processed.

[0134] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned picture coupling method embodiment, and will not be repeated here.

[0135] The apparatus provided in the above embodiment may be implemented in the form of a computer program. The computer program may be Figure 5 Runs on the computer device shown.

[0136] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0137] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0138] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the image coupling methods.

[0139] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0140] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any one of the image coupling methods.

[0141] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0142] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0143] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0144] Obtain at least two pictures to be processed, and obtain a first picture color depth corresponding to each of the pictures to be processed;

[0145] Determining first pixel data of the picture to be processed based on a first picture color depth of the picture to be processed;

[0146] Appending the first picture parameter corresponding to each of the to-be-processed pictures to the header data of the coupled pictures to obtain the coupled header data of the coupled pictures;

[0147] Based on the picture coupling sequence corresponding to each of the pictures to be processed, first pixel data of each of the pictures to be processed is sequentially stored in the initialization data area of ​​the coupled picture to obtain second pixel data of the coupled picture;

[0148] Based on the coupled header data and the second pixel data, a coupled picture corresponding to the picture to be processed is obtained.

[0149] In one embodiment, when the processor implements the acquiring of at least two pictures to be processed, it is used to implement:

[0150] Obtaining the screen color depth of the target screen corresponding to the image to be processed;

[0151] Based on the preset screening rules and the screen color depth, screening out at least two of the to-be-processed pictures from the to-be-processed picture set;

[0152] Among them, the preset screening rule is that the sum of the first picture color depths of the pictures to be processed is less than or equal to the screen color depth.

[0153] In one embodiment, before implementing the determining the first pixel data of the picture to be processed based on the first picture color depth of the picture to be processed, the processor is further configured to implement:

[0154] Obtaining a first picture parameter of the picture to be processed;

[0155] Determining second picture parameters of the coupled pictures based on the first picture parameters corresponding to each of the pictures to be processed;

[0156] Based on the second picture parameters and the preset alignment method, the pictures to be processed are aligned and arranged so as to perform a header data appending operation and a pixel calculation operation on each picture to be processed.

[0157] In one embodiment, the first picture parameter includes a first picture width, a first picture height, and a first picture color depth; the second picture parameter includes a second picture width, a second picture height, and a second picture color depth;

[0158] When the processor implements the determining of the second picture parameter of the coupled picture based on the first picture parameter corresponding to each of the pictures to be processed, the processor is used to implement:

[0159] Comparing the first picture widths of the pictures to be processed, and taking the first picture width with the maximum value as the second picture width of the coupled picture;

[0160] Compare the first picture heights of the pictures to be processed, and use the maximum first picture height as the second picture height of the coupled picture;

[0161] The sum of the first picture color depths of the pictures to be processed is used as the second picture color depth of the coupled picture.

[0162] In one embodiment, when the processor implements the picture coupling order corresponding to each of the pictures to be processed, sequentially stores the first pixel data of each of the pictures to be processed into the initialization data area of ​​the coupled picture, and obtains the second pixel data of the coupled picture, it is used to implement:

[0163] Determine, based on the picture coupling order corresponding to each of the to-be-processed pictures and the first picture color depth of each of the to-be-processed pictures, a pixel offset of the first pixel data corresponding to each of the to-be-processed pictures in the initialization data area;

[0164] Based on the pixel offset bits corresponding to each of the to-be-processed pictures, the first pixel data corresponding to each pixel point in the coupled picture is sequentially stored in the initialization data area to obtain the second pixel data of the coupled picture.

[0165] In one embodiment, after implementing the picture coupling sequence corresponding to each of the pictures to be processed, sequentially storing the first pixel data of each of the pictures to be processed in the initialization data area of ​​the coupled picture, and obtaining the second pixel data of the coupled picture, the processor is further used to implement:

[0166] Obtaining a coupling pixel value of any target pixel point in the coupling image;

[0167] Determining a pixel offset of the target picture based on a first picture color depth of the target picture in the coupled picture;

[0168] Based on the pixel offset bit of the target image, a pixel value of the target image at the target pixel point is extracted from the coupled pixel value.

[0169] In one embodiment, when the processor determines the first pixel data of the picture to be processed based on the first picture color depth of the picture to be processed, it is configured to implement:

[0170] Calculating first pixel data of the image to be processed based on the color depth of the first image according to a calculation formula for first pixel data;

[0171] The calculation formula of the first pixel data can be expressed as:

[0172] P = 2 n -1

[0173] Among them, P represents the first pixel data corresponding to the image to be processed, and n is the first image color depth corresponding to the image to be processed.

[0174] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the program instructions to implement any one of the image coupling methods provided in the embodiments of the present application.

[0175] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0176] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A picture coupling method, characterized in that: The method comprises: Obtain at least two pictures to be processed, and obtain a first picture color depth corresponding to each of the pictures to be processed; Determining first pixel data of the picture to be processed based on a first picture color depth of the picture to be processed; Appending the first picture parameter corresponding to each of the to-be-processed pictures to the header data of the coupled pictures to obtain the coupled header data of the coupled pictures; Based on the picture coupling sequence corresponding to each of the pictures to be processed, first pixel data of each of the pictures to be processed is sequentially stored in the initialization data area of ​​the coupled picture to obtain second pixel data of the coupled picture; Based on the coupled header data and the second pixel data, a coupled picture corresponding to the picture to be processed is obtained.

2. The image coupling method according to claim 1, characterized in that: The obtaining of at least two pictures to be processed includes: Obtaining the screen color depth of the target screen corresponding to the image to be processed; Based on the preset screening rules and the screen color depth, screening out at least two of the to-be-processed pictures from the to-be-processed picture set; Among them, the preset screening rule is that the sum of the first picture color depths of the pictures to be processed is less than or equal to the screen color depth.

3. The image coupling method according to claim 1, characterized in that: Before determining the first pixel data of the picture to be processed based on the first picture color depth of the picture to be processed, the method further includes: Obtaining a first picture parameter of the picture to be processed; Determining second picture parameters of the coupled pictures based on the first picture parameters corresponding to each of the pictures to be processed; Based on the second picture parameters and the preset alignment method, the pictures to be processed are aligned and arranged so as to perform a header data appending operation and a pixel calculation operation on each picture to be processed.

4. The image coupling method according to claim 3, characterized in that: The first picture parameters include a first picture width, a first picture height, and a first picture color depth; the second picture parameters include a second picture width, a second picture height, and a second picture color depth; The determining, based on the first picture parameters corresponding to each of the to-be-processed pictures, the second picture parameters of the coupled pictures includes: Comparing the first picture widths of the pictures to be processed, and taking the first picture width with the maximum value as the second picture width of the coupled picture; Compare the first picture heights of the pictures to be processed, and use the maximum first picture height as the second picture height of the coupled picture; The sum of the first picture color depths of the pictures to be processed is used as the second picture color depth of the coupled picture.

5. The image coupling method according to claim 1, characterized in that: The step of storing the first pixel data of each of the to-be-processed pictures in sequence into an initialization data area of ​​the coupled pictures based on the picture coupling order corresponding to each of the to-be-processed pictures, and obtaining the second pixel data of the coupled pictures, comprises: Determine, based on the picture coupling order corresponding to each of the to-be-processed pictures and the first picture color depth of each of the to-be-processed pictures, a pixel offset of the first pixel data corresponding to each of the to-be-processed pictures in the initialization data area; Based on the pixel offset bits corresponding to each of the to-be-processed pictures, the first pixel data corresponding to each pixel point in the coupled picture is sequentially stored in the initialization data area to obtain the second pixel data of the coupled picture.

6. The image coupling method according to claim 1, characterized in that: After storing the first pixel data of each of the to-be-processed pictures in sequence into the initialization data area of ​​the coupled picture based on the picture coupling sequence corresponding to each of the to-be-processed pictures and obtaining the second pixel data of the coupled picture, the method further includes: Obtaining a coupling pixel value of any target pixel point in the coupling image; Determining a pixel offset of the target picture based on a first picture color depth of the target picture in the coupled picture; Based on the pixel offset bit of the target image, a pixel value of the target image at the target pixel point is extracted from the coupled pixel value.

7. The image coupling method according to claim 1, characterized in that: The determining, based on the first picture color depth of the picture to be processed, first pixel data of the picture to be processed includes: Calculating first pixel data of the image to be processed based on the color depth of the first image according to a calculation formula for first pixel data; The calculation formula of the first pixel data can be expressed as: P=2 n -1 Among them, P represents the first pixel data corresponding to the image to be processed, and n is the first image color depth corresponding to the image to be processed.

8. A picture coupling device, characterized in that: The picture coupling device comprises: An image acquisition module, used to acquire at least two images to be processed, and to acquire a first image color depth corresponding to each of the images to be processed; A first pixel data calculation module, used to determine first pixel data of the image to be processed based on a first image color depth of the image to be processed; A header data appending module, used for appending the first picture parameter corresponding to each of the to-be-processed pictures to the header data of the coupled pictures, to obtain coupled header data of the coupled pictures; A second pixel data calculation module, configured to sequentially store the first pixel data of each of the to-be-processed pictures into an initialization data area of ​​a coupled picture based on a picture coupling sequence corresponding to each of the to-be-processed pictures, and obtain second pixel data of the coupled picture; A coupling picture data obtaining module is used to obtain a coupling picture corresponding to the picture to be processed based on the coupling header data and the second pixel data.

9. A computer device, characterized in that: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the picture coupling method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the picture coupling method according to any one of claims 1 to 7 are implemented.