Mapping table storage method and device, image processing method and device, medium and equipment
By creating a storage mapping table covering the parent two-dimensional space and storing the data of multiple mapping tables to be stored in a preset order, the problem of wasted storage space in image processing is solved and a more efficient storage method is achieved.
Patent Information
- Application Number
- CN202310412495.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2024-10-15
AI Technical Summary
When the existing technology uses multiple mapping tables in image processing, it leads to the problem of wasting storage space.
By creating a storage mapping table covering the parent two-dimensional space, and storing the mapping data of multiple mapping tables to be stored in the table according to the preset storage order, the processor can read the mapping data according to the corresponding rules and confirm that the data corresponds to The mapping table to be stored.
It effectively saves storage space, reduces the waste of storage space, and realizes a storage method that uses less storage space without increasing the amount of data.
Smart Images

Figure CN118780971A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a mapping table storage method, image processing method, device, medium and equipment. Background Art
[0002] Mapping tables are very common in image processing and are widely used in various image processing algorithms. Mapping tables are usually used to map one space to another space. When multiple mapping tables are required in an image processing algorithm, the current storage method generally stores multiple mapping tables to be stored separately, which usually wastes more storage space. Therefore, the current storage method of the mapping tables to be stored will waste storage space. Summary of the invention
[0003] The embodiments of the present application provide a mapping table storage, image processing method and related device, which can reduce the storage space used when storing N mapping tables to be stored.
[0004] To solve the above technical problems, the present application provides the following technical solutions:
[0005] According to an embodiment of the present application, a method for storing a mapping table is provided, the method comprising: creating a storage mapping table; storing N mapping tables to be stored in the storage mapping table according to a preset storage order, where N is greater than or equal to 2.
[0006] According to one embodiment of the present application, there is provided an image processing method, the method comprising:
[0007] Acquisition step: acquiring the first pixel coordinate of the image to be processed;
[0008] Mapping step: according to the first pixel coordinates of the image to be processed, obtaining the corresponding second pixel coordinates from the above storage mapping table.
[0009] According to an embodiment of the present application, a storage device for a mapping table is provided, the storage device comprising:
[0010] Create a module for creating a storage mapping table;
[0011] The storage module is used to store the mapping data of N mapping tables to be stored in the storage mapping table according to a preset storage order, where N is greater than or equal to 2.
[0012] According to one embodiment of the present application, an image processing device is provided, the device comprising:
[0013] An acquisition module, used for acquiring the first pixel coordinates of the image to be processed;
[0014] The mapping module is used to obtain the corresponding second pixel coordinates from the above-mentioned storage mapping table according to the first pixel coordinates of the image to be processed.
[0015] According to one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer is caused to execute the above method.
[0016] According to one embodiment of the present application, a photographing device is provided, the photographing device comprising:
[0017] A plurality of cameras, each of the cameras corresponding to a mapping table to be stored;
[0018] A memory storing a computer program and the above-mentioned storage mapping table;
[0019] A processor is respectively connected to the memory and the plurality of cameras, and the processor is used to execute the computer program to implement the above-mentioned image processing method.
[0020] The present application proposes a storage method for a mapping table, including creating a storage mapping table, and storing N to-be-stored mapping tables in the storage mapping table according to a preset storage order, where N is greater than or equal to 2. The mapping data of the to-be-stored mapping table is stored according to the preset storage order. Even if the data of multiple to-be-stored mapping tables are stored in one storage mapping table, the processor can read the mapping data according to the corresponding rules to confirm the to-be-stored mapping table corresponding to the mapping data. Compared with separate storage, this storage method can store the same amount of data while using less storage space, thereby effectively saving storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A schematic diagram of a system to which an embodiment of the present application can be applied is shown.
[0023] Figure 2 A flowchart of a method for storing a mapping table according to an embodiment of the present application is shown.
[0024] Figure 3 A schematic diagram of a mapping representation according to an example of the present application is shown.
[0025] Figure 4A flowchart of an image processing method according to an embodiment of the present application is shown.
[0026] Figure 5 A block diagram of a mapping table storage device according to an embodiment of the present application is shown.
[0027] Figure 6 A block diagram of an image processing device according to an embodiment of the present application is shown.
[0028] Figure 7 A block diagram of a photographing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] 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 only 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 those skilled in the art without creative work are within the scope of protection of this application.
[0030] Figure 1 FIG. 1 is a schematic diagram showing a system 100 to which an embodiment of the present application can be applied. Figure 1 As shown, the system 100 may include a server 101 and / or a terminal 102 .
[0031] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0032] Terminal 102 can be any device, including but not limited to cameras (such as sports cameras, panoramic cameras), mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, VR / AR devices, smart watches, computers, etc.
[0033] It should be noted that since the capacity of the storage mapping table is larger than the mapping table to be stored, storing them separately will result in a waste of storage space. However, in order to distinguish different mapping tables, when multiple mapping tables need to be stored, we will still create multiple storage mapping tables and store each mapping table in the corresponding storage mapping table. When obtaining the mapping table data later, it can be directly extracted from the corresponding storage mapping table.
[0034] For the above problems, refer to Figure 2The present invention proposes a storage method for a mapping table, the method comprising: creating a storage mapping table; and storing mapping data of N mapping tables to be stored in the storage mapping table according to a preset storage order, where N is greater than or equal to 2.
[0035] The size of the storage mapping table is set to accommodate N mapping tables to be stored. The preset storage order can be set according to actual needs and is not limited here. Taking multiple fisheye lenses as an example, each fisheye lens corresponds to a mapping table to be stored, and the position order of the fisheye lenses can be used as the preset storage order.
[0036] In this embodiment, the mapping data of the mapping table to be stored is stored according to a preset storage order. Even if the data of multiple mapping tables to be stored is stored in one storage mapping table, the processor can read the mapping data according to the corresponding rules to confirm the mapping table to be stored corresponding to the mapping data. Compared with separate storage, this storage method can store the same amount of data while using less storage space, thereby effectively saving storage space. In practical applications, the storage method of the mapping table can be run on other devices, and then the storage mapping table can be imported into the server 101 or the terminal 102, or the above-mentioned storage method of the mapping table can be directly executed on the server 101 or the terminal 102.
[0037] In some embodiments, N mapping tables to be stored are associated with each other. For example, the N mapping tables to be stored map N sub-two-dimensional spaces to N m-dimensional spaces respectively, and the union of the N sub-two-dimensional spaces is greater than or equal to the parent two-dimensional space, so that a parent two-dimensional space (or other dimensions) is jointly mapped to multiple m-dimensional spaces. In actual applications, N storage mapping tables will be created to cover the parent two-dimensional space. Each storage mapping table only stores the mapping data of one mapping table to be stored. Since the size of the parent two-dimensional space is much larger than the sub-two-dimensional space, there is a large amount of redundant space in the storage mapping table, which will store null values, wasting storage space.
[0038] In response to the above problems, Figure 2 The flowchart of the method for storing a mapping table of this embodiment is schematically shown. The execution subject of the method for storing a mapping table can be any device, such as Figure 1 The server 101 or the terminal 102 shown. The storage method of the mapping table includes steps S210 to S220.
[0039] Step S210, creating a storage mapping table;
[0040] The storage mapping table may cover the parent two-dimensional space. For example, the storage mapping table may fully map the parent two-dimensional space to N m-dimensional spaces. Of course, in other embodiments, it may also be a normal mapping.
[0041] Step S220, according to a preset storage order, the mapping data of N to-be-stored mapping tables are stored in the storage mapping table, where N is greater than or equal to 2. At this time, the storage mapping table can map the parent two-dimensional space to N m-dimensional spaces. N is equal to 2, 3, 4, 5, 6 or other values, which is specifically set according to the actual need to store the to-be-stored mapping table.
[0042] The present application creates a storage mapping table that at least covers the parent two-dimensional space, and then stores N to-be-stored mapping tables in the storage mapping table in a preset order. In this method, even if the data of multiple to-be-stored mapping tables are stored in one storage mapping table, the processor can read the mapping data according to the corresponding rules and confirm the to-be-stored mapping table corresponding to the mapping data. Compared with separate storage, this storage method can reduce the space for storing null values, thereby saving storage space.
[0043] In one embodiment, the terminal 102 is explained as a panoramic camera including N fisheye lenses, and N is taken as 6 as an example.
[0044] In the panoramic camera, each fisheye lens acquires an original image, and the six original images are stitched together to form a panoramic image. In this example, the panoramic image corresponds to the parent two-dimensional space, and the six original images correspond to six m-dimensional spaces. In practical applications, the pixel parameters (brightness / color, etc.) of the corresponding coordinates of the six original images are rendered into the pixels of the corresponding coordinates of the panoramic image. This process includes reprojection mapping, which can refer to the process of acquiring pixels from one position in the original image and positioning them at another position in the new image in combination with the reprojection mapping table.
[0045] In this embodiment, 6 reprojection mapping tables are required to map 6 sub-two-dimensional spaces to 6 m-dimensional spaces, and the number of channels of the 6 reprojection mapping tables is m. In the related art, in order to store the above 6 reprojection mapping tables, 6 rectangular storage mapping tables with m channels that just cover the parent two-dimensional space are created to store the data of the 6 reprojection mapping tables respectively, which will result in a large waste of space; or, 6 square storage mapping tables with m channels that just cover the respective sub-two-dimensional spaces are created, because there are a large number of overlapping areas between the circumscribed square areas of the 6 sub-two-dimensional spaces, and even close to the circumscribed square area of the parent two-dimensional space, which will also result in a large waste of space.
[0046] In view of the above problems, the storage method of the mapping table of this embodiment includes: creating a storage mapping table, which can just cover the parent two-dimensional space; assigning a serial number to each fisheye lens according to the positional relationship of the fisheye lens, and storing N reprojection mapping tables in the storage mapping table according to the serial number. The processor of the panoramic camera can locate the original image according to the serial number, and locate the coordinates of the corresponding pixels of the original image according to the mapping data.
[0047] Reference Figure 3 In one embodiment, the storage method of the mapping table further includes: creating an index mapping table, wherein the index data of the index mapping table is used to index the corresponding relationship between the mapping data and the mapping table to be stored. In practical applications, N mapping tables to be stored can be sorted, assigned corresponding serial numbers, and then the serial numbers are encoded as index data and stored in the index mapping table.
[0048] In some embodiments, the index mapping table may be as large as the storage mapping table. Each index data on the index mapping table may correspond one-to-one to the mapping data of the storage mapping table. Furthermore, the position of the index data in the index mapping table and the position of the mapping data in the storage mapping table may also correspond one-to-one. In other embodiments, the index mapping table may also be smaller than the storage mapping table, and the sizes of the two may be proportional, as long as the sequence number of the corresponding mapping table to be stored is obtained from the index mapping table. In some embodiments, the index mapping table is square and / or the storage mapping table is square.
[0049] Still taking the above-mentioned panoramic camera as an example, when its processor needs to obtain the pixel coordinates of the corresponding original image based on the pixel coordinates of the panoramic image, it can obtain index data from the index mapping table based on the pixel coordinates of the panoramic image, and obtain the pixel coordinates of the original image from the storage mapping table based on the index data and the pixel coordinates of the panoramic image. In practical applications, the data type of the index data can be uchar, ushort, and other optional types. The index data of each position in the index mapping table is obtained by a predetermined encoding method using the serial number of the mapping table to be stored at the corresponding position in the storage mapping table. Figure 3 In one embodiment, the predetermined encoding method is as follows: when the stored index data is 0b00000001, it means that in the storage mapping table, the data at the corresponding position comes from the mapping table No. 1 to be stored; when the stored index data is 0b00000010, it means that in the storage mapping table, the data at the corresponding position comes from the mapping table No. 2 to be stored; when the stored index data is 0b00000100, it means that in the storage mapping table, the data at the corresponding position comes from the mapping table No. 3 to be stored, and so on. The above encoding method can make the index data read quickly and with a small amount of data. In other embodiments, other encoding methods, such as binary encoding, can also be used.
[0050] In one embodiment, there is an overlapping area in the sub-two-dimensional space corresponding to the xth mapping table to be stored and the yth mapping table to be stored, wherein x and y are two adjacent sequence numbers. In this case, if the overlapping area is divided into two areas for storage, it will cause space waste.
[0051] In this embodiment, the parent two-dimensional space may be the union of the child two-dimensional spaces, so the storage mapping table uses one location to store the overlapping area. This will result in the data at each location in the overlapping area pointing to two mapping tables to be stored with different serial numbers.
[0052] In response to the above problem, in this embodiment, the storage mapping table includes a first channel group and a second channel group, the number of channels in the first channel group is greater than or equal to the number of channels in the x-th mapping table to be stored, and the number of channels in the second channel group is greater than or equal to the number of channels in the y-th mapping table to be stored. For example, the number of channels in the first channel group and the second channel group are both greater than or equal to the number of channels in either the x-th mapping table to be stored or the y-th mapping table to be stored, so as to better configure the storage mapping table.
[0053] Then, the storage method of the mapping table further includes: according to a preset storage rule, storing the mapping data of the xth mapping table to be stored in the first channel group, and storing the mapping data of the yth mapping table to be stored in the second channel group. The preset storage rule is: a mathematical relationship exists between x and y, and the specific mathematical relationship is not limited here, as long as x and y can be distinguished, for example, x is an odd number and y is an even number, and for example, x is less than y.
[0054] With such a configuration, in actual applications, the processor determines whether the mapping data corresponds to the xth mapping table to be stored or the yth mapping table to be stored y according to the preset storage rules and the channel group where the mapping data is stored. Take x as an odd number and y as an even number as an example to illustrate: when the mapping data of the mapping table to be stored is stored in the storage mapping table, the mapping table to be stored with an odd sequence number is stored in the first channel group by default, and the mapping table to be stored with an even sequence number is stored in the second channel group. In this way, when encountering an overlapping area, the processor can determine the corresponding sequence number of the mapping table to be stored according to whether the mapping data is stored in the first channel group or the second channel group. In the case where x is less than y, the sequence number with a larger numerical value is stored in the first channel group by default, and the sequence number with a smaller numerical value is stored in the second channel group.
[0055] In some embodiments, the number of the mapping tables to be stored is greater than or equal to 3, and any area in the parent two-dimensional space is covered by at most two of the child two-dimensional spaces. The step of storing the mapping data of the N mapping tables to be stored in the storage mapping table according to the preset storage order also includes: obtaining the preset storage order according to the overlap of the child two-dimensional spaces corresponding to the mapping tables to be stored.
[0056] In this embodiment, the preset storage order may be that in the preset storage order, there is no overlapping area in the sub-two-dimensional spaces corresponding to the mapping tables to be stored with non-adjacent sequence numbers. The overlapping area only appears between adjacent mapping tables to be stored, so that the distinction of the overlapping area can use the mathematical relationship between x and y mentioned above.
[0057] In some embodiments, in the preset storage order, there is an overlapping area between the sub-two-dimensional spaces corresponding to any two adjacent mapping tables to be stored. In this case, the storage method of the mapping table can save the most space.
[0058] Reference Figure 3 , combined with the above-mentioned panoramic camera as an example for interpretation, in this embodiment, since the fields of view of adjacent fisheye lenses of the panoramic camera overlap, the physical position of the fisheye lens is used as the sorting basis, so that the sub-two-dimensional space corresponding to any two adjacent sequence numbers of the to-be-stored mapping tables can have overlapping areas. For the overlapping area, the encoding of the index data is extended, for example, 0b00000011, indicating that the data at the corresponding position in the storage mapping table comes from reprojection mapping table No. 1 and reprojection mapping table No. 2, 0b00001100, indicating that the data at the corresponding position in the storage mapping table comes from reprojection mapping table No. 3 and reprojection mapping table No. 4, and so on. Of course, in other embodiments, other encoding rules can also be used.
[0059] Combine the following Figure 3 The application scenarios of the panoramic camera are explained with the above embodiments. The serial numbers of the 6 reprojection mapping tables corresponding to the 6 sub-two-dimensional spaces can be set to 1, 2, 3, 4, 5 and 6 respectively, wherein there is an overlapping area (1+2) between 1 and 2, an overlapping area (2+3) between 2 and 3, and so on, for a total of 5 overlapping areas. Further, it is assumed that m=2 (that is, the reprojection mapping table has 2 channels), and the storage mapping table includes 4 channels: ch0, ch1, ch2, ch3. Taking the predetermined storage rule of "x is an odd number and y is an even number" as an example, the ((i+1)%2)th group of m-dimensional channels can be used as the storage channel corresponding to the i-th reprojection mapping table in the storage mapping table. Specifically, if i=1, then ((i+1)%2)=0, and the 0th group of 2-dimensional channel groups is ch01 (ch0 and ch1); if i=2, then ((i+1)%2)=1, and the 1st group of 2-dimensional channels is ch23 (ch2 and ch3); if i=3, then ((i+1)%2)=0, and the 0th group of 2-dimensional channels is ch01 (ch0 and ch1), and so on, to obtain the storage channel corresponding to each reprojection mapping table in the storage mapping table.
[0060] The data of reprojection mapping table No. 1 is stored in the first channel group (ch0 and ch1), the data of reprojection mapping table No. 2 is stored in the second channel group (ch2 and ch3), the data of reprojection mapping table No. 3 is stored in the first channel group (ch0 and ch1), the data of reprojection mapping table No. 4 is stored in the second channel group (ch2 and ch3), the data of reprojection mapping table No. 5 is stored in the first channel group (ch0 and ch1), and the data of reprojection mapping table No. 6 is stored in the second channel group (ch2 and ch3).
[0061] Furthermore, the index data stored in the index mapping table corresponding to the area in the storage mapping table that only stores reprojection mapping table No. 1 is 0b00000001, the index data stored in the index mapping table corresponding to the area in the storage mapping table that only stores reprojection mapping table No. 2 is 0b00000010, and the index data stored in the index mapping table corresponding to the area in the storage mapping table that stores data of both reprojection mapping tables No. 1 and No. 2 is 0b00000011, and so on, to obtain the uchar type index data stored in each position in the index mapping table.
[0062] Among them, when the index data stored at position O in the index mapping table is 0b00000001, it means that the data corresponding to position O in the storage mapping table comes from reprojection mapping table No. 1; when the index data stored at the position is 0b00000010, it means that the data corresponding to position O in the storage mapping table comes from reprojection mapping table No. 2; when the index data stored at position O is 0b00000011, it means that the data corresponding to position O in the storage mapping table comes from reprojection mapping tables No. 1 and No. 2, and needs to be combined with a predetermined storage rule. And so on, the reprojection mapping table of each index data source is obtained.
[0063] The processor of the panoramic camera obtains index data from the index mapping table according to the pixel coordinates (X1, Y1) on the panoramic image, for example, the index data is 0b00000011 (overlapping); then obtains the pixel coordinates (X2, Y2) and (X3, Y3) of the original image from the storage mapping table according to the pixel coordinates (X1, Y1) on the panoramic image, and obtains the pixel parameters from the original image corresponding to the No. 1 reprojection mapping table according to (X2, Y2) and the pixel parameters from the original image corresponding to the No. 2 reprojection mapping table according to (X3, Y4) in combination with the sequence numbers determined by the channels of (X2, Y2). The pixels of the panoramic image (X1, Y1) are rendered using the parameters.
[0064] In one embodiment, Figure 4 The flowchart of an image processing method according to an embodiment of the present application is schematically shown. The execution subject of the image processing method can be any device, such as Figure 1The server 101 or the terminal 102 is shown. In one embodiment of the present application, the execution subject is specifically a shooting device.
[0065] like Figure 4 As shown, the image processing method may include steps S310 to S320.
[0066] Step S310, obtaining the first pixel coordinates of the image to be processed;
[0067] Step S320: According to the first pixel coordinate of the image to be processed, obtain the corresponding second pixel coordinate from the storage mapping table described in any embodiment of the present application.
[0068] In step S320, if there is no index mapping table, other indexing methods may be used. If there is an index mapping table, step 320 may include: obtaining corresponding index data from the index mapping table according to the first pixel coordinate of the image to be processed; and obtaining corresponding second pixel coordinates from the storage mapping table according to the index data and the first pixel coordinate of the image to be processed. The details are not repeated here.
[0069] In step S320, when the index data points to the overlapping area of the xth mapping table to be stored and the yth mapping table to be stored, the second pixel coordinates include first overlapping coordinates and second overlapping coordinates; the mapping step includes: according to a preset reading rule, reading the first overlapping coordinates from the first channel group, and reading the second overlapping coordinates from the second channel group, the preset reading rule corresponds to the preset storage rule, for example, according to x being an odd number and y being an even number as the preset storage rule, the preset reading rule may be: the data read from the first channel group is the mapping data of the xth mapping table to be stored, and the data read from the second channel group is the mapping data of the yth mapping table to be stored, and other mathematical relationships are similar and will not be repeated here.
[0070] In one embodiment, the image processing method is applied to a shooting device, which includes at least two cameras, each of which is used to obtain an original image. The method also includes: obtaining pixel parameters of corresponding pixels from the corresponding original image based on the obtained second pixel coordinates; and processing pixels of first pixel coordinates in the image to be processed based on the pixel parameters, for example, in the image to be processed, setting parameters of pixels corresponding to the first pixel coordinates to pixel parameters of the second pixel coordinates of the original image.
[0071] In order to better implement the mapping table storage method provided in the embodiment of the present application, the embodiment of the present application also provides a mapping table storage device based on the above mapping table storage method. The meanings of the terms are the same as those in the above mapping table storage method, and the specific implementation details can refer to the description in the method embodiment. Figure 5 A block diagram of a storage device for a mapping table according to an embodiment of the present application is shown.
[0072] like Figure 5 As shown, the storage device 400 of the mapping table may include: a creation module 410 may be used to create a storage mapping table; a storage module 420 may be used to store N mapping tables to be stored in the storage mapping table according to a preset storage order, where N is greater than or equal to 2.
[0073] In some embodiments of the present application, the storage device of the mapping table further includes an index module for: creating an index mapping table, wherein the index data of the index mapping table is used to index the corresponding relationship between the mapping data and the mapping table to be stored.
[0074] In some embodiments of the present application, the size of the index mapping table is proportional to that of the storage mapping table; the index data at each position in the index mapping table is obtained by a predetermined coding method using the serial number of the mapping table to be stored at the corresponding position in the storage mapping table, or the index data at each position in the index mapping table is the serial number of the mapping table to be stored at the corresponding position in the storage mapping table. The size of the index mapping table is the same as that of the storage mapping table; or the size of the index mapping table is proportional to that of the storage mapping table, and the storage mapping table is larger than the index mapping table.
[0075] In some embodiments of the present application, each of the mapping tables to be stored is used to map a child two-dimensional space to an m-dimensional space, where m is greater than or equal to 2. When the mapping data of N mapping tables to be stored are stored in the storage mapping table in accordance with a preset storage order, the storage mapping table is used to map a parent two-dimensional space to each of the m-dimensional spaces; each of the child two-dimensional spaces is a subset of the parent two-dimensional space, and / or the parent two-dimensional space is the union of all the child two-dimensional spaces.
[0076] In some embodiments of the present application, there is an overlapping area in the sub-two-dimensional space corresponding to the xth mapping table to be stored and the yth mapping table to be stored, where x and y are two adjacent serial numbers;
[0077] The storage mapping table includes a first channel group and a second channel group, the number of channels in the first channel group is greater than or equal to the number of channels in the x-th mapping table to be stored, and the number of channels in the second channel group is greater than or equal to the number of channels in the y-th mapping table to be stored; the storage method of the mapping table also includes: according to a preset storage rule, storing the mapping data of the x-th mapping table to be stored in the first channel group, and storing the mapping data of the y-th mapping table to be stored in the second channel group.
[0078] In some embodiments of the present application, the preset storage rule is specifically: x is an odd number and y is an even number, and / or x is smaller than y.
[0079] In some embodiments of the present application, the number of mapping tables to be stored is greater than or equal to 3, and any area in the parent two-dimensional space is covered by at most two of the child two-dimensional spaces; before the step of storing the mapping data of N mapping tables to be stored in the storage mapping table according to a preset storage order, it also includes: obtaining the preset storage order according to the overlap of the child two-dimensional spaces corresponding to the mapping tables to be stored.
[0080] In some embodiments of the present application, in the preset storage order, there is no overlapping area in the sub-two-dimensional spaces corresponding to the mapping tables to be stored with non-adjacent serial numbers; and / or, in the preset storage order, there is an overlapping area in the sub-two-dimensional spaces corresponding to any two adjacent serial numbers of the mapping tables to be stored.
[0081] In some embodiments of the present application, the position of the index data in the index mapping table corresponds to the position of the mapping data corresponding to the index data in the storage mapping table; and / or, the index mapping table is a square mapping table; and / or, the storage mapping table is a square mapping table.
[0082] In some embodiments of the present application, the data type of the index data is uchar type.
[0083] In order to better implement the image processing method provided in the embodiment of the present application, the embodiment of the present application also provides an image processing device based on the above image processing method. The meanings of the terms are the same as those in the above image processing method, and the specific implementation details can refer to the description in the method embodiment. Figure 6 A block diagram of an image processing device according to an embodiment of the present application is shown.
[0084] like Figure 6 As shown, the image processing device 500 may include: an acquisition module 510 can be used to acquire the first pixel coordinates of the image to be processed; a mapping module 520 can be used to acquire the corresponding second pixel coordinates from a storage mapping table stored according to the above-mentioned mapping table storage method based on the first pixel coordinates of the image to be processed.
[0085] In some embodiments of the present application, the mapping module is used to: obtain corresponding index data from the index mapping table according to the first pixel coordinate of the image to be processed; and obtain corresponding second pixel coordinates from the storage mapping table according to the index data and the first pixel coordinate of the image to be processed.
[0086] In some embodiments of the present application, the mapping module, the storage mapping table is the storage mapping table described in any one of claims 5-8; when the index data points to the overlapping area of the x-th mapping table to be stored and the y-th mapping table to be stored, the second pixel coordinates include first overlapping coordinates and second overlapping coordinates; the mapping step includes: according to a preset reading rule, reading the first overlapping coordinates from the first channel group and reading the second overlapping coordinates from the second channel group, and the preset reading rule corresponds to the preset storage rule.
[0087] In some embodiments of the present application, the image processing device is applied to a shooting device, and the shooting device includes at least two cameras, each of which is used to obtain an original image. The method also includes: obtaining pixel parameters of corresponding pixels from the corresponding original image based on the obtained second pixel coordinates; and processing pixels of first pixel coordinates in the image to be processed based on the pixel parameters.
[0088] An embodiment of the present application also provides a shooting device, which includes: multiple cameras, each camera corresponds to a mapping table to be stored; a memory, storing a computer program and the above-mentioned storage mapping table; a processor, respectively connected to the memory and the multiple cameras, and the processor is used to execute the computer program to perform the above-mentioned image processing method.
[0089] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0090] In addition, the present application also provides a photographing device, such as Figure 7 As shown, it shows a structural schematic diagram of a shooting device involved in an embodiment of the present application, specifically:
[0091] The photographing device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that Figure 7 The structure of the photographing device shown in the figure does not constitute a limitation on the photographing device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0092] The processor 601 is the control center of the camera device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 602 and calling data stored in the memory 602, it executes various functions of the computer device and processes data, thereby detecting the camera device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages and applications, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0093] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0094] The photographing device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0095] The photographing device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0096] Although not shown, the shooting device may also include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the shooting device will load the executable files corresponding to the processes of one or more computer programs into the memory 602 according to the following instructions, and the processor 601 will run the computer programs stored in the memory 602, thereby realizing the various functions of the aforementioned embodiments of the present application.
[0097] For example, the processor 601 may execute: creating a storage mapping table; storing N mapping tables to be stored in the storage mapping table according to a preset storage order, where N is greater than or equal to 2.
[0098] For example, the processor 601 can execute: obtaining the first pixel coordinates of the image to be processed; according to the first pixel coordinates of the image to be processed, obtaining the corresponding second pixel coordinates from the storage mapping table described in any embodiment of the present application, wherein the second pixel coordinates are used for image processing.
[0099] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0100] To this end, an embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any method provided in the embodiment of the present application.
[0101] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0102] Since the computer program stored in the computer-readable storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by the method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0103] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations in the above embodiments of the present application.
[0104] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0105] It should be understood that the present application is not limited to the embodiments that have been described above and shown in the accompanying drawings, but various modifications and changes may be made without departing from the scope thereof.
Claims
1. A method for storing a mapping table, characterized in that: The method comprises: Create a storage mapping table; According to a preset storage order, mapping data of N mapping tables to be stored are stored in the storage mapping table, where N is greater than or equal to 2.
2. The method for storing a mapping table according to claim 1, wherein: The method further comprises: An index mapping table is created, wherein index data of the index mapping table is used to index the corresponding relationship between the mapping data and the mapping table to be stored.
3. The method for storing a mapping table according to claim 2, wherein: The index mapping table and the storage mapping table have the same size; Alternatively, the sizes of the index mapping table and the storage mapping table are proportional, and the storage mapping table is larger than the index mapping table.
4. The method for storing a mapping table according to claim 2, wherein: Each of the mapping tables to be stored is used to map a sub-two-dimensional space to an m-dimensional space, where m is greater than or equal to 2. When the mapping data of N mapping tables to be stored are stored in the storage mapping table in a preset storage order, the storage mapping table is used to map a parent two-dimensional space to each of the m-dimensional spaces; Each of the two-dimensional child spaces is a subset of the parent two-dimensional space, and / or the parent two-dimensional space is a union of all the two-dimensional child spaces.
5. The method for storing a mapping table according to claim 4, characterized in that: There is an overlapping area in the sub-two-dimensional space corresponding to the xth mapping table to be stored and the yth mapping table to be stored, where x and y are two adjacent serial numbers; The storage mapping table includes a first channel group and a second channel group, the number of channels in the first channel group is greater than or equal to the number of channels in the xth mapping table to be stored, and the number of channels in the second channel group is greater than or equal to the number of channels in the yth mapping table to be stored; The mapping table storage method further includes: storing the mapping data of the xth mapping table to be stored in the first channel group and storing the mapping data of the yth mapping table to be stored in the second channel group according to a preset storage rule.
6. The method for storing a mapping table according to claim 5, wherein: The x is an odd number and the y is an even number, and / or the x is smaller than the y.
7. The method for storing a mapping table according to claim 5, wherein: The number of the mapping tables to be stored is greater than or equal to 3, and any area in the parent two-dimensional space is covered by at most two child two-dimensional spaces; Before the steps of storing the mapping data of the N mapping tables to be stored in the storage mapping tables according to the preset storage order, the steps further include: The preset storage order is obtained according to the overlapping conditions of the sub-two-dimensional spaces corresponding to the mapping tables to be stored.
8. The method for storing a mapping table according to claim 7, wherein: In the preset storage order, there is no overlapping area in the sub-two-dimensional spaces corresponding to the to-be-stored mapping tables with non-adjacent sequence numbers; And / or, in the preset storage order, there is an overlapping area in the sub-two-dimensional spaces corresponding to any two adjacent sequence-numbered mapping tables to be stored.
9. The method for storing a mapping table according to claim 3, wherein: The position of the index data in the index mapping table corresponds to the position of the mapping data corresponding to the index data in the storage mapping table; And / or, the index mapping table is a square mapping table; And / or, the storage mapping table is a square mapping table.
10. The method for storing a mapping table according to claim 3, wherein: The data type of the index data is uchar.
11. An image processing method, characterized in that: The image processing method comprises: Acquisition step: acquiring the first pixel coordinate of the image to be processed; Mapping step: according to the first pixel coordinate of the image to be processed, obtaining the corresponding second pixel coordinate from the storage mapping table according to any one of claims 1-10.
12. The image processing method according to claim 11, characterized in that: The mapping step comprises: According to the first pixel coordinate of the image to be processed, obtaining corresponding index data from the index mapping table; According to the index data and the first pixel coordinates of the image to be processed, the corresponding second pixel coordinates are obtained from the storage mapping table.
13. The image processing method according to claim 11, characterized in that: The storage mapping table is the storage mapping table according to any one of claims 5 to 8; when the index data points to an overlapping area of the xth mapping table to be stored and the yth mapping table to be stored, the second pixel coordinates include a first overlapping coordinate and a second overlapping coordinate; The mapping step comprises: According to a preset reading rule, the first overlapping coordinates are read from the first channel group, and the second overlapping coordinates are read from the second channel group, and the preset reading rule corresponds to the preset storage rule.
14. The image processing method according to claim 11, characterized in that: The method is applied to a shooting device, the shooting device includes at least two cameras, each of the cameras is used to obtain an original image, and the method further includes: According to the acquired second pixel coordinates, a pixel parameter of a corresponding pixel is acquired from the corresponding original image; The pixel at the first pixel coordinate in the image to be processed is processed according to the pixel parameter.
15. A storage device for a mapping table, characterized in that: include: Create a module for creating a storage mapping table; The storage module is used to store the mapping data of N mapping tables to be stored in the storage mapping table according to a preset storage order, where N is greater than or equal to 2.
16. An image processing device, the device comprising: An acquisition module, used for acquiring the first pixel coordinates of the image to be processed; A mapping module, used to obtain the corresponding second pixel coordinate from the storage mapping table according to any one of claims 1-10 according to the first pixel coordinate of the image to be processed.
17. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 10 or 11 to 14.
18. A photographing device, characterized in that: The shooting device comprises: A plurality of cameras, each of the cameras corresponding to a mapping table to be stored; A memory storing a computer program and a storage mapping table according to any one of claims 1 to 10; A processor is connected to the memory and the plurality of cameras respectively, and the processor is used to execute the computer program to implement the method described in any one of claims 11 to 14.
