Image processing method, device, equipment and storage medium
By creating a bitmap matrix and storing the pixels that can be displayed after splicing in sequence, the problem of excessive storage space and bandwidth in large-screen splicing control is solved, and efficient image data storage and splicing are achieved.
Patent Information
- Application Number
- CN202111626975.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-12-28
AI Technical Summary
When using large-screen splicing or video splicing display, existing technologies require storing a large amount of text and identifiers to describe the pixel position relationships of image data, resulting in excessive storage space and bandwidth requirements.
By creating a bitmap matrix, the target pixels of the images to be stitched are distinguished from other pixels and stored in memory in the order of the bitmap matrix. Only the pixels that can be displayed after stitching are stored, and data transmission is managed using multi-channel memory and temporary memory.
It saves storage space and bandwidth, ensures the correct display of the stitched image, and reduces storage requirements.
Smart Images

Figure CN114298885B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, apparatus, device and storage medium. Background Art
[0002] Currently, when performing large-screen splicing or video splicing display, the sender of image data stores multiple image data to be spliced in a memory, so that a processor performing image splicing can select different image data from the memory for reading and splicing display.
[0003] However, in the above process, when storing each image data that needs to be spliced, each pixel constituting the image and the positional relationship between each pixel in the image are stored in the memory. In order to clearly express the positional relationship between each pixel in the image, a large amount of text and identifiers are required to describe it, so that the storage of image data requires the use of a larger storage bandwidth and occupies a larger storage space. Summary of the invention
[0004] In view of this, the embodiments of the present application provide an image processing method, apparatus, device and storage medium, which are conducive to saving storage space and storage bandwidth of the memory.
[0005] It mainly includes the following aspects:
[0006] In a first aspect, an embodiment of the present application provides an image processing method, comprising:
[0007] After acquiring at least one image to be stitched, for each of the images to be stitched, according to at least one pixel to be stitched among all the pixels included in the image to be stitched, a bitmap matrix corresponding to the image to be stitched is created; wherein each element constituting the bitmap matrix corresponds one-to-one to a pixel at a corresponding position in the image to be stitched, and a representation method of a target element in each element is different from a representation method of other elements except the target element, and the target element is an element corresponding to the pixel to be stitched;
[0008] The bitmap matrix is stored in a memory, and the pixel points to be spliced corresponding to each target element are stored in the memory according to the arrangement order of each target element in the bitmap matrix.
[0009] Optionally, before creating a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched, the image processing method further includes:
[0010] For each of the images to be stitched, according to the display area of the image to be stitched in the target image, the pixel points included in the display area of the image to be stitched are determined as the pixel points to be stitched; wherein the target image is an image obtained by stitching the images to be stitched according to a preset stitching method.
[0011] Optionally, the memory is a multi-channel memory, and the multi-channel memory includes at least one storage area, and one storage area corresponds to one first data transmission channel; the image processing method further includes:
[0012] The target data corresponding to different images to be spliced are stored in a storage area through different first data transmission channels; wherein the target data includes a bitmap matrix and pixels to be spliced.
[0013] Optionally, after creating a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched, for each of the storage areas, the image processing method further includes:
[0014] When the size of the remaining storage space of the temporary storage is greater than or equal to the size of the first preset storage space, storing the target data in the temporary storage;
[0015] When the remaining storage space size of the temporary storage is less than or equal to the size of the second preset storage space, the target data stored in the temporary storage is stored in the storage area.
[0016] Optionally, one storage area corresponds to one second data transmission channel; and the image processing method further includes:
[0017] The target data stored in the storage area corresponding to the second data transmission channel is read through a different second data transmission channel.
[0018] Optionally, for each of the images to be stitched, the image processing method further includes:
[0019] Reading a bitmap matrix stored in the memory;
[0020] The pixel points to be spliced stored in the memory are read according to the arrangement order, and the pixel points to be spliced corresponding to each target element are spliced according to the position information of each target element in the bitmap matrix.
[0021] In a second aspect, an embodiment of the present application provides an image processing device, including:
[0022] A creation module, for, after acquiring at least one image to be stitched, creating, for each of the images to be stitched, a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched; wherein each element constituting the bitmap matrix corresponds one-to-one to a pixel at a corresponding position in the image to be stitched, and a representation method of a target element in each element is different from a representation method of other elements except the target element, and the target element is an element corresponding to the pixel to be stitched;
[0023] The first storage module is used to store the bitmap matrix into a memory, and store the to-be-joined pixel points corresponding to each target element into the memory according to the arrangement order of each target element in the bitmap matrix.
[0024] Optionally, before the creation module is used to create a bitmap matrix corresponding to the image to be stitched according to at least one pixel point to be stitched among all the pixels included in the image to be stitched, it is further used to:
[0025] For each of the images to be stitched, according to the display area of the image to be stitched in the target image, the pixel points included in the display area of the image to be stitched are determined as the pixel points to be stitched; wherein the target image is an image obtained by stitching the images to be stitched according to a preset stitching method.
[0026] Optionally, the memory is a multi-channel memory, and the multi-channel memory includes at least one storage area, and one storage area corresponds to one first data transmission channel; the image processing device further includes:
[0027] The second storage module is used to store target data corresponding to different images to be spliced into the storage area through different first data transmission channels; wherein the target data includes a bitmap matrix and pixels to be spliced.
[0028] Optionally, after the creation module is used to create a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched, for each of the storage areas, the image processing device further includes:
[0029] A third storage module, configured to store the target data into the temporary storage when the size of the remaining storage space of the temporary storage is greater than or equal to the size of the first preset storage space;
[0030] The fourth storage module is used to store the target data stored in the temporary storage into the storage area when the remaining storage space size of the temporary storage is less than or equal to the size of the second preset storage space.
[0031] Optionally, one storage area corresponds to one second data transmission channel; the image processing device further includes:
[0032] The first reading module is used to read the target data stored in the storage area corresponding to the second data transmission channel through different second data transmission channels.
[0033] Optionally, for each of the images to be stitched, the image processing device further includes:
[0034] A second reading module, used for reading the bitmap matrix stored in the memory;
[0035] The execution module is used to read the pixel points to be spliced stored in the memory according to the arrangement order, and splice the pixel points to be spliced corresponding to each target element according to the position information of each target element in the bitmap matrix.
[0036] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any image processing method described in the first aspect when executing the computer program.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image processing method described in any one of the first aspects are performed.
[0038] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0039] The image processing method provided by the embodiment of the present application, after acquiring the image to be stitched, creates a bitmap matrix corresponding to the image to be stitched, and after storing the bitmap matrix in a memory, according to the arrangement order of each target element in the bitmap matrix, orderly stores the pixel points to be stitched in the image to be stitched corresponding to each target element in the memory, wherein the pixel points to be stitched in the image to be stitched are the uncovered pixel points that can be displayed after stitching, and only the pixel points that can be displayed in the image to be stitched after stitching are stored, while the pixel points that are covered and cannot be displayed after stitching are not stored, which is beneficial to saving the storage space and storage bandwidth of the memory, and according to the positional relationship between the target elements in the bitmap matrix, the positional relationship between the pixel points to be stitched can be determined, so that the area (composed of the pixel points to be stitched) that can be displayed in each image to be stitched after stitching can be correctly restored.
[0040] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flowchart of an image processing method provided in Embodiment 1 of the present application is shown;
[0043] Figure 2 An example diagram showing a method for creating a bitmap matrix corresponding to an image to be spliced provided in the first embodiment of the present application;
[0044] Figure 3 An example diagram showing a storage method of pixels to be spliced provided in the first embodiment of the present application is shown;
[0045] Figure 4 An example diagram of a target image provided by the first embodiment of the present application is shown;
[0046] Figure 5 A schematic diagram of the structure of an image processing device provided in Embodiment 2 of the present application is shown;
[0047] Figure 6 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present application is shown. DETAILED DESCRIPTION
[0048] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0049] The embodiments of the present application provide an image processing method, apparatus, device and storage medium, which are described below through embodiments.
[0050] Embodiment 1
[0051] Figure 1 A flowchart of an image processing method provided in the first embodiment of the present application is shown. Figure 1 As shown, the image processing method comprises the following steps:
[0052] Step S101: after acquiring at least one image to be stitched, for each of the images to be stitched, according to at least one pixel to be stitched among all the pixels included in the image to be stitched, a bitmap matrix corresponding to the image to be stitched is created; wherein each element constituting the bitmap matrix corresponds one-to-one to a pixel at a corresponding position in the image to be stitched, and a representation method of a target element in each element is different from a representation method of other elements except the target element, and the target element is an element corresponding to the pixel to be stitched.
[0053] Specifically, the image to be spliced refers to an image that needs to be spliced and displayed, and each image to be spliced is composed of a number of pixels. The pixel to be spliced is: an uncovered pixel that can be displayed after the images to be spliced are spliced, so the pixel to be spliced needs to be stored. One image to be spliced corresponds to a bitmap matrix, and the size of the bitmap matrix is related to the pixel size of the image to be spliced. For example, if the pixel size of the image to be spliced is 63×524 pixels, then the size of the bitmap matrix corresponding to the image to be spliced is 524 rows and 63 columns; that is, the bitmap matrix includes 63 column element sets, and each column element set includes 524 elements; in the bitmap matrix, each element corresponds to a pixel in the image to be spliced, and the position of the element in the bitmap matrix is the same as the position of the pixel corresponding to the element in the image to be spliced, for example, if the element is located in the second row and second column in the bitmap matrix, then the pixel corresponding to the element is the pixel in the second row and second column in the image to be spliced. In addition, the representation of elements includes bit type data representation, such as: numerical, letter, identifier and other representations, and different representations include different values of the same representation and different representations. Different values of the same representation, for example: in each element, the number 1 is used to represent the target element, and the number 0 is used to represent other elements except the target element; different representations, for example: in each element, the number a is used to represent the target element, and the number 0 is used to represent other elements except the target element.
[0054] For example, Figure 2 An example diagram showing a method for creating a bitmap matrix corresponding to an image to be spliced provided in the first embodiment of the present application is shown. Figure 2As shown, in the image to be stitched 201 above the arrow, each box represents a pixel in the image to be stitched, wherein the box filled with a diagonal pattern represents the pixel to be stitched, and below the arrow is: a bitmap matrix 202 created for the image to be stitched 201, in which each element corresponds to a pixel at a corresponding position in the image to be stitched 201, wherein the element with a value of 1 corresponds to the pixel to be stitched in the image to be stitched 201, that is: the value of the target element is 1, and the element with a value of 0 corresponds to other pixels in the image to be stitched 201 except the pixel to be stitched. Therefore, when the four pixels in the first row of the image to be stitched 201 are all filled with a diagonal line pattern, the values of the four target elements in the first row of the bitmap matrix 202 are all 1; when the first two pixels in the second row of the image to be stitched 201 are filled with a diagonal line pattern, and the last two pixels are not filled with a diagonal line pattern, among the four elements in the second row of the bitmap matrix 202, the values of the first two target elements are all 1, and the values of the last two elements are all 0; when the first two pixels in the third row of the image to be stitched 201 are filled with a diagonal line pattern, and the last two pixels are not filled with a diagonal line pattern, among the four elements in the third row of the bitmap matrix 202, the values of the first two target elements are all 1, and the values of the last two elements are all 0; when the four pixels in the fourth row of the image to be stitched 201 are not filled with a diagonal line pattern, the values of the four elements in the fourth row of the bitmap matrix 202 are all 0.
[0055] It should be noted that the bitmap matrix corresponding to the image to be stitched represents the position information and display information of the image to be stitched in the stitched image.
[0056] Step S102: storing the bitmap matrix into a memory, and storing the to-be-joined pixel points corresponding to each target element into the memory according to the arrangement order of each target element in the bitmap matrix.
[0057] Specifically, for each image to be stitched, each pixel to be stitched in the image to be stitched is a pixel that can be displayed after stitching, so each pixel to be stitched needs to be stored in a memory. In addition, in order to be able to determine the positional relationship between each stitched pixel read out during reading, a bitmap matrix used to represent the positional relationship between each pixel to be stitched needs to be stored in the memory.
[0058] In order to store the pixels to be spliced in order, the pixels to be spliced corresponding to the target elements can be stored according to the arrangement order of the target elements in the bitmap matrix. The arrangement order includes but is not limited to from left to right and then from top to bottom, and from top to bottom and then from left to right.
[0059] For example, Figure 3An example diagram showing a storage method of pixels to be spliced provided in the first embodiment of the present application is shown. Figure 3 As shown, in the dotted box above the arrow, there are an image to be stitched 301 and a bitmap matrix 302 corresponding to the image to be stitched 301, wherein in the image to be stitched 301, each box represents a pixel, and the pixels to be stitched are A, B, C and D respectively; the bitmap matrix 302 includes elements with a value of 0 and target elements with a value of 1, the target element with a value of 1 on the leftmost side of the first row corresponds to the pixel A to be stitched, the target element with a value of 1 on the rightmost side of the first row corresponds to the pixel B to be stitched, the target element with a value of 1 in the middle of the second row corresponds to the pixel C to be stitched, and the target element with a value of 1 on the rightmost side of the third row corresponds to the pixel C to be stitched. The target element with a value of 1 corresponds to the pixel D to be spliced; if the arrangement order of each target element in the bitmap matrix is set to be from left to right first, and then from top to bottom; then the order of storing each pixel to be spliced in the memory 303 below the arrow is to first store the leftmost pixel A to be spliced in the first row, then store the rightmost pixel B to be spliced in the first row, then store the middle pixel C to be spliced in the second row, and finally store the rightmost pixel D to be spliced in the third row. After storing the pixel D to be spliced, the pointer on the left side of the memory 303 used to represent the last stored data is located at the storage space for storing the pixel D to be spliced.
[0060] It should be noted that the choice of memory can be set according to actual conditions, such as DDR (Double Data Rate, double data rate synchronous dynamic random access memory). The choice of memory is not specifically limited here.
[0061] It needs to be explained again that the above bitmap matrix is stored in the form of bit type data.
[0062] Figure 1The provided image processing method creates a bitmap matrix corresponding to the image to be spliced after acquiring the image to be spliced, and after storing the bitmap matrix in a memory, according to the arrangement order of each target element in the bitmap matrix, orderly stores the pixel points to be spliced in the image to be spliced corresponding to each target element in the memory, wherein the pixel points to be spliced in the image to be spliced are the non-covered pixel points that can be displayed after splicing, and only the pixel points that can be displayed in the image to be spliced after splicing are stored, and the pixel points that are covered and cannot be displayed after splicing are not stored, which is conducive to saving the storage space and storage bandwidth of the memory, and according to the positional relationship between each target element in the bitmap matrix, the positional relationship between each pixel point to be spliced can be determined, so that the area (composed of each pixel point to be spliced) that can be displayed in each image to be spliced after splicing can be correctly restored, and in addition, the elements in the stored bitmap matrix are all bit type data, and compared with storing a large amount of text descriptions, the bitmap matrix occupies less storage space, which is also conducive to saving the storage space and storage bandwidth of the memory.
[0063] In another feasible implementation, the above image processing method is applied to a programmable device, such as FPGA (Field Programmable Gate Array).
[0064] In a feasible implementation manner, before executing the above step S101, the above image processing method can also be implemented in the following manner:
[0065] For each of the images to be stitched, according to the display area of the image to be stitched in the target image, the pixel points included in the display area of the image to be stitched are determined as the pixel points to be stitched; wherein the target image is an image obtained by stitching the images to be stitched according to a preset stitching method.
[0066] Specifically, after each image to be stitched is stitched according to a preset stitching method, a target image is obtained. In the target image, each image to be stitched can display (appear, not be covered) a partial area, namely: the display area. In other words, other areas except the display area in each image to be stitched cannot be displayed after stitching; therefore, the above-mentioned stitching process of each image to be stitched is equivalent to the stitching process of the display area in each image to be stitched, so the pixel points included in the display area in each image to be stitched are determined as the pixel points to be stitched.
[0067] It should be noted that there is at least one display area in each of the images to be stitched, and the display areas in the images to be stitched are different from each other.
[0068] It should be noted again that the sizes of the images to be stitched may be the same or different, and no specific limitation is made here.
[0069] For example, Figure 4 An example diagram of a target image provided by the first embodiment of the present application is shown. Figure 4 As shown, in the dotted box above the arrow, there are the images to be stitched 401 and the images to be stitched 402 of the same pixel size, wherein each box represents a pixel point, the image to be stitched 401 is composed of pixel points A, pixel points B, pixel points C, pixel points D, pixel points E, pixel points F, pixel points G, pixel points H and pixel points I, and the image to be stitched 402 is composed of pixel points 1, pixel points 2, pixel points 3, pixel points 4, pixel points 5, pixel points 6, pixel points 7, pixel points 8 and pixel points 9. Below the arrow is the target image 403 obtained by stitching the image to be stitched 401 and the stitched image 402, wherein the pixel size of the target image is the same as that of the images to be stitched 401 and the stitched image 402. The pixel sizes are the same, and the target image is composed of pixel A, pixel B, pixel 3, pixel D, pixel E, pixel 6, pixel 7, pixel 8 and pixel 9. It can be seen that the display area in the image to be stitched 401 is: the area composed of pixel A, pixel B, pixel D and pixel E, so the pixels to be stitched in the image to be stitched 401 are pixel A, pixel B, pixel D and pixel E; the display area in the image to be stitched 402 is: the area composed of pixel 3, pixel 6, pixel 7, pixel 8 and pixel 9, so the pixels to be stitched in the image to be stitched 401 are pixel 3, pixel 6, pixel 7, pixel 8 and pixel 9.
[0070] In a feasible implementation scheme, the memory is a multi-channel memory, and the multi-channel memory includes at least one storage area, and one storage area corresponds to a first data transmission channel; the image processing method can also be implemented in the following way: storing target data corresponding to different images to be spliced into the storage area through different first data transmission channels; wherein the target data includes a bitmap matrix and pixels to be spliced.
[0071] Specifically, the first data transmission channel is a channel for storing data in a storage space of a memory. In the memory, one storage area corresponds to one first data transmission channel. Different storage areas store target data corresponding to different images to be processed, and different storage areas correspond to different base address information (the base address information includes the start address and the end address of each storage space included in the storage area). For each image to be spliced, the storage area where the storage space is located is determined according to the acquired start address and the end address of the storage space storing the target data corresponding to the image to be spliced, so that the target data corresponding to the image to be spliced is stored in the storage space in the storage area through the first data transmission channel corresponding to the storage area.
[0072] In another feasible implementation, the memory includes at least one storage area, each storage area includes at least one storage slice, each slice includes at least one storage block, each storage block corresponds to a starting address and an ending address, and the starting address and the ending address are used to represent the effective address range of the maximum storable space of the storage block; wherein different storage areas are used to store different image data, and different image data refer to: different image data for splicing, such as: different images to be spliced into an image, or different videos to be spliced on a screen; different storage slices in the same storage area are used to store different image data from the same source, such as images of different frames in the same video; different storage blocks in the same storage slice of the same storage area are used to store different types of data corresponding to the same image data, such as a bitmap matrix including pixels to be spliced and the image in an image.
[0073] In a feasible implementation manner, after executing the above step S101, for each of the storage areas, the image processing method can also be implemented by the following steps:
[0074] Step S201: when the size of the remaining storage space of the temporary storage is greater than or equal to the size of the first preset storage space, the target data is stored in the temporary storage.
[0075] Step S202: When the remaining storage space size of the temporary storage is less than or equal to the size of the second preset storage space, the target data stored in the temporary storage is stored in the storage area.
[0076] Specifically, in order to ensure a stable speed of writing data into the memory, the data can be written into a temporary memory first, and the size of the storage space of the temporary memory occupied by the data stored in the temporary memory is obtained in real time, and the size of the remaining storage space of the temporary memory is determined according to the size of the storage space of the temporary memory occupied by the stored data. When the size of the remaining storage space of the temporary memory is greater than or equal to the size of the preset storage space, the target data corresponding to the image to be stitched is written into the temporary memory.
[0077] In addition, when the size of the storage space of the temporary memory occupied by the data stored in the temporary memory is obtained in real time, it is determined whether the amount of the stored data is greater than or equal to the preset amount, which is equivalent to determining whether the size of the remaining storage space of the temporary memory is less than or equal to the size of the second preset storage space. If it is less than or equal to the size of the second preset storage space, the stored target data is read from the temporary memory and the read target data is written into the memory.
[0078] It should be noted that when reading the stored target data from the temporary memory and writing it to the memory, a preset number of target data can be read each time and the read target data can be written to the memory, or all the target data stored in the temporary memory can be read at one time and the read target data can be written to the memory.
[0079] It should be noted again that, for each image to be stitched, when the target data corresponding to the image to be stitched is stored in the temporary memory, all the target data stored in the temporary memory is read, and the read target data is written into the memory.
[0080] It should be noted again that the size of the first preset space may be the same as or different from the size of the second preset space.
[0081] It should be noted again that the selection of the above-mentioned temporary storage can be set according to actual needs, such as selecting FIFO (First Input First Output) or RAM (Random Access Memory) as the temporary storage. The selection of the temporary storage is not specifically limited here.
[0082] It needs to be explained again that one storage area in the memory corresponds to at least one temporary storage area, for example, one storage area corresponds to two temporary storage areas, namely temporary storage area 1 and temporary storage area 2, wherein temporary storage area 1 is used to store the bitmap matrix corresponding to the image to be stitched, and temporary storage area 2 is used to store the pixels to be stitched included in the image to be stitched.
[0083] In a feasible implementation, one storage area corresponds to one second data transmission channel; the image processing method can also be implemented in the following manner: reading the target data stored in the storage area corresponding to the second data transmission channel through different second data transmission channels.
[0084] Specifically, the second data transmission channel is a channel for reading data from the storage space of the memory, one storage area corresponds to one second data transmission channel, and since different storage areas store target data corresponding to different images to be stitched, and different storage areas include the starting address and the ending address of each storage space in the storage area; therefore, the storage area where the storage space is located can be determined according to the acquired starting address and the ending address of the storage space, so as to read the target data stored in the storage space through the second data transmission channel corresponding to the storage area.
[0085] In another feasible implementation scheme, when reading the target data of the image to be stitched stored in the memory, the target data read from the memory can be first temporarily stored in a preset temporary memory, and then the target data can be read from the preset temporary memory; wherein, one storage area can correspond to at least one preset temporary memory. For the working process of the preset temporary memory and the relationship between the preset temporary memory and the storage area, refer to the above description of the temporary memory, which will not be repeated here.
[0086] In a feasible implementation manner, for each of the images to be stitched, the image processing method may also be implemented by the following steps:
[0087] Step S301: Read the bitmap matrix stored in the memory.
[0088] Step S302: Read the pixel points to be spliced stored in the memory according to the arrangement order, and splice the pixel points to be spliced corresponding to each target element according to the position information of each target element in the bitmap matrix.
[0089] Specifically, for each image to be stitched, the bitmap matrix corresponding to the image to be stitched can be used to determine the pixels to be stitched stored in the memory in the image to be stitched, so the bitmap matrix corresponding to the image to be stitched is read first, and then each pixel to be stitched is read in the memory according to the arrangement order used when storing the pixels to be stitched.
[0090] In a specific implementation, the number of pixels to be spliced stored in the storage space is determined according to the size of the storage space for storing the pixels to be spliced and the size of each pixel to be spliced; then, according to the number of target elements included in each row of the bitmap matrix, the same number of pixels to be spliced as the number of target elements in the corresponding row is read from the memory; for example: Figure 3 As shown, the first row in the bitmap matrix 302 has two target elements, and two pixels to be spliced are first read from the memory 303; the second row in the bitmap matrix 302 has one target element, and then one pixel to be spliced is read from the memory 303; the third row in the bitmap matrix 302 has one target element, and finally one pixel to be spliced is read from the memory 303.
[0091] After reading the pixel to be spliced, according to the position information of the target element corresponding to the pixel to be spliced in the corresponding bitmap matrix, the pixel to be spliced is set at the corresponding position on the spliced image (i.e., splicing the pixel to be spliced), for example: Figure 3In the example, after the pixel point A to be stitched is read out from the memory 303, the target element corresponding to the pixel point A to be stitched is located at the leftmost position of the first row in the bitmap matrix 302, so the pixel point A to be stitched needs to be set at the leftmost position of the first row of the pixels constituting the stitched image.
[0092] In another feasible real-time solution, the storage and reading of the target data corresponding to each image to be stitched are both performed in a polling arbitration manner.
[0093] Embodiment 2
[0094] Figure 5 A schematic diagram of the structure of an image processing device provided in the second embodiment of the present application is shown. Figure 5 As shown, the image processing device comprises:
[0095] The creation module 501 is used for, after acquiring at least one image to be stitched, creating a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched, for each of the images to be stitched; wherein each element constituting the bitmap matrix corresponds one-to-one to a pixel at a corresponding position in the image to be stitched, and a representation method of a target element in each element is different from a representation method of other elements except the target element, and the target element is an element corresponding to the pixel to be stitched;
[0096] The first storage module 502 is used to store the bitmap matrix into a memory, and store the to-be-joined pixel points corresponding to each target element into the memory according to the arrangement order of each target element in the bitmap matrix.
[0097] In a feasible implementation manner, before the creation module 501 is used to create a bitmap matrix corresponding to the image to be stitched according to at least one pixel point to be stitched among all the pixels included in the image to be stitched, it is further used to:
[0098] For each of the images to be stitched, according to the display area of the image to be stitched in the target image, the pixel points included in the display area of the image to be stitched are determined as the pixel points to be stitched; wherein the target image is an image obtained by stitching the images to be stitched according to a preset stitching method.
[0099] In a feasible implementation manner, the memory is a multi-channel memory, and the multi-channel memory includes at least one storage area, and one storage area corresponds to one first data transmission channel; the image processing device also includes:
[0100] The second storage module is used to store target data corresponding to different images to be spliced into the storage area through different first data transmission channels; wherein the target data includes a bitmap matrix and pixels to be spliced.
[0101] In a feasible implementation manner, after the creation module 501 is used to create a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched, for each of the storage areas, the image processing device further includes:
[0102] A third storage module, configured to store the target data into the temporary storage when the size of the remaining storage space of the temporary storage is greater than or equal to the size of the first preset storage space;
[0103] The fourth storage module is used to store the target data stored in the temporary storage into the storage area when the remaining storage space size of the temporary storage is less than or equal to the size of the second preset storage space.
[0104] In a feasible implementation scheme, one storage area corresponds to one second data transmission channel; the image processing device further includes:
[0105] The first reading module is used to read the target data stored in the storage area corresponding to the second data transmission channel through different second data transmission channels.
[0106] In a feasible implementation manner, for each of the images to be stitched, the image processing device further includes:
[0107] A second reading module, used for reading the bitmap matrix stored in the memory;
[0108] The execution module is used to read the pixel points to be spliced stored in the memory according to the arrangement order, and splice the pixel points to be spliced corresponding to each target element according to the position information of each target element in the bitmap matrix.
[0109] The device provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present application, its implementation principle and the technical effect produced are the same as those in the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0110] Embodiment 3
[0111] The embodiment of the present application further provides a computer device 600, Figure 6 A schematic diagram of the structure of a computer device provided in the third embodiment of the present application is shown. Figure 6 As shown, the device includes a memory 601, a processor 602, and a computer program stored in the memory 601 and executable on the processor 602, wherein the memory 601 and the processor 602 are communicatively connected via a bus, and the image processing method is implemented when the processor 602 executes the computer program.
[0112] Specifically, the above-mentioned memory 601 and processor 602 can be general-purpose memories and processors, which are not specifically limited here. When the processor 602 runs the computer program stored in the memory 601, it can execute the above-mentioned image processing method, which solves the problem in the prior art that storing images requires a large storage bandwidth and occupies a large storage space.
[0113] Embodiment 4
[0114] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned image processing method are executed.
[0115] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the above-mentioned image processing method can be executed, solving the problem in the prior art that storing images requires a large storage bandwidth and occupies a large storage space.
[0116] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0119] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0120] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0121] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all 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. An image processing method, It is characterized in that include: For each image to be stitched, according to the display area of the image to be stitched in the target image, the pixel points included in the display area of the image to be stitched are determined as the pixel points to be stitched; wherein the target image is an image obtained by stitching the images to be stitched according to a preset stitching method; After acquiring at least one image to be stitched, for each of the images to be stitched, according to at least one pixel to be stitched among all the pixels included in the image to be stitched, a bitmap matrix corresponding to the image to be stitched is created; wherein each element constituting the bitmap matrix corresponds one-to-one to a pixel at a corresponding position in the image to be stitched, and a representation method of a target element in each element is different from a representation method of other elements except the target element, and the target element is an element corresponding to the pixel to be stitched; The bitmap matrix is stored in a memory, and the pixel points to be spliced corresponding to each target element are stored in the memory according to the arrangement order of each target element in the bitmap matrix.
2. The image processing method according to claim 1, It is characterized in that The memory is a multi-channel memory, and the multi-channel memory includes at least one storage area, and one storage area corresponds to one first data transmission channel; The image processing method further comprises: The target data corresponding to different images to be spliced are stored in a storage area through different first data transmission channels; wherein the target data includes a bitmap matrix and pixels to be spliced.
3. The image processing method according to claim 2, It is characterized in that After creating a bitmap matrix corresponding to the image to be stitched according to at least one pixel to be stitched among all the pixels included in the image to be stitched, for each of the storage areas, the image processing method further includes: When the size of the remaining storage space of the temporary storage is greater than or equal to the size of the first preset storage space, storing the target data in the temporary storage; When the remaining storage space size of the temporary storage is less than or equal to the size of the second preset storage space, the target data stored in the temporary storage is stored in the storage area.
4. The image processing method according to claim 2, It is characterized in that One storage area corresponds to one second data transmission channel; The image processing method further comprises: The target data stored in the storage area corresponding to the second data transmission channel is read through a different second data transmission channel.
5. The image processing method according to claim 1, It is characterized in that For each of the images to be stitched, the image processing method further includes: Reading a bitmap matrix stored in the memory; The pixel points to be spliced stored in the memory are read according to the arrangement order, and the pixel points to be spliced corresponding to each target element are spliced according to the position information of each target element in the bitmap matrix.
6. An image processing device, It is characterized in that include: A creation module, for each image to be stitched, according to the display area of the image to be stitched in the target image, determining the pixel points included in the display area of the image to be stitched as the pixel points to be stitched; wherein the target image is an image obtained by stitching the images to be stitched according to a preset stitching method; after acquiring at least one image to be stitched, for each image to be stitched, according to at least one pixel point to be stitched among all the pixels included in the image to be stitched, creating a bitmap matrix corresponding to the image to be stitched; wherein each element constituting the bitmap matrix corresponds one-to-one to the pixel points at the corresponding position in the image to be stitched, and the representation method of the target element in each element is different from the representation method of other elements except the target element, and the target element is the element corresponding to the pixel point to be stitched; The first storage module is used to store the bitmap matrix into a memory, and store the to-be-joined pixel points corresponding to each target element into the memory according to the arrangement order of each target element in the bitmap matrix.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the image processing method described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 5 are executed.
