Image splicing method and device, equipment and medium
By obtaining target image style information and determining the display area, extracting and writing local display images into memory, the problem of high memory bandwidth requirements of traditional image stitching methods is solved, and efficient image stitching and quality improvement is achieved.
Patent Information
- Application Number
- CN202411891263.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The traditional image stitching method has high requirements for memory bandwidth, and cannot adapt to complex and variable stitching environments, has a low utilization rate of memory bandwidth, and has a low efficiency of image stitching.
By obtaining the target image style information, determining the display area and display position information of each image to be stitched in the target image, extracting the local display image, and writing it to memory based on the storage location to stitch it, realizing seamless stitching of multiple images to be stitched.
The demand for memory bandwidth is reduced, the bandwidth utilization of memory is improved, the efficiency of image stitching is significantly improved, and the quality and visual effect of the target image after stitching is improved.
Smart Images

Figure CN119762341A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an image stitching method, device, equipment and medium. Background Art
[0002] Image stitching is an increasingly popular research area that has become a hot topic in photogrammetry, computer vision, image processing, and computer graphics. Image stitching aims to align a series of spatially overlapping images to form an image with a larger field of view than a single image.
[0003] At present, the traditional image stitching method usually writes multiple images into the memory completely first, and then reads the data of multiple images after a complete frame of data is cached in each image, and then writes it into the corresponding memory address to finally obtain the stitched image. However, the traditional image stitching method has high requirements on the memory bandwidth and cannot adapt to the complex and changeable stitching environment. The utilization rate of the memory bandwidth is low, and the efficiency of image stitching is low. Summary of the invention
[0004] The present invention provides an image stitching method, device, equipment and medium to achieve efficient image stitching, with low requirements on memory bandwidth, can adapt to complex and changeable stitching environments, improve memory bandwidth utilization, and thus greatly improve the efficiency of image stitching.
[0005] In a first aspect, an embodiment of the present invention provides an image stitching method, comprising:
[0006] Acquire target image style information, where the target image style information is style information of the target image obtained by stitching together a plurality of images to be stitched together;
[0007] Based on the target image style information, determining a display area of each image to be stitched in the target image and display position information of the display area in the target image;
[0008] Based on the display area, extracting the corresponding display area of the image to be stitched output by each image source to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one;
[0009] Based on the display position information of the display area in the target image, the storage position corresponding to each of the partial display images is determined, and based on the storage position, each of the partial display images is written into the memory for splicing to obtain the spliced target image.
[0010] In a second aspect, an embodiment of the present invention further provides an image stitching device, comprising:
[0011] A style information acquisition module, used to acquire target image style information, wherein the target image style information is style information of the target image obtained by splicing a plurality of images to be spliced;
[0012] A position information determination module, used to determine, based on the target image style information, a display area of each image to be stitched in the target image and display position information of the display area in the target image;
[0013] A local image acquisition module, used for extracting the corresponding display area of the image to be stitched output by each image source based on the display area, to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one;
[0014] The image stitching module is used to determine the storage position corresponding to each of the partial display images based on the display position information of the display area in the target image, and based on the storage position, write each of the partial display images into the memory for stitching to obtain the stitched target image.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, characterized in that the electronic device comprises: at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image stitching method provided by any embodiment of the present invention.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the image stitching method provided by any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention, by acquiring the target image style information, the target image style information is the style information of the target image obtained after stitching multiple images to be stitched, the expected style of the stitched image is clarified, and a clear target and benchmark are provided for the subsequent. Based on the target image style information, the display area of each image to be stitched in the target image and the display position information of the display area in the target image are determined, which can provide accurate position information for the subsequent extraction of the local display image and writing into the memory. Based on the display area, the corresponding display area of the image to be stitched output by each image source is extracted to obtain the local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one, reducing unnecessary image data and improving stitching efficiency. Based on the display position information of the display area in the target image, the storage position corresponding to each local display image is determined, and based on the storage position, each local display image is written into the memory for stitching to obtain the stitched target image, so as to achieve seamless stitching of multiple images to be stitched, and improve the quality and visual effect of the stitched target image. Through the target image style information, the local display image is extracted outside the memory, which greatly reduces the unnecessary image data inside the memory, improves the stitching efficiency and image quality, can adapt to complex and changeable stitching environments, and reduces the bandwidth requirements for the memory.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of an image stitching method provided according to the first embodiment of the present invention;
[0023] Figure 2 is an example diagram of style information of a target image involved in Embodiment 1 of the present invention;
[0024] Figure 3 is a flow chart of an image stitching method provided according to Embodiment 2 of the present invention;
[0025] Figure 4is a schematic diagram of regional division of a storage space involved in Embodiment 2 of the present invention;
[0026] Figure 5 is a structural schematic diagram of an image stitching device provided according to Embodiment 3 of the present invention;
[0027] Figure 6 It is a structural schematic diagram of an electronic device for implementing the image stitching method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "target", "current", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 A flowchart of an image stitching method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of stitching multiple images. Figure 1 As shown, the method can be performed by an image stitching device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method specifically comprises the following steps:
[0032] S110 , obtaining target image style information, where the target image style information is style information of the target image obtained by stitching together a plurality of images to be stitched together.
[0033] The target image style information may refer to the style of the image expected to be obtained after stitching. For example, the target image style information may be the aspect ratio of the image, the stitching method, etc. The image to be stitched may refer to the image required when the target image is obtained after the stitching process. The target image may refer to the image expected to be obtained after stitching.
[0034] Specifically, the expected style of the target image after stitching can be defined and obtained in advance. The style information of the target image can be obtained by user input, preset parameters or automatic generation by an algorithm. The style information may include the aspect ratio of the image, the stitching method (such as horizontal stitching, vertical stitching or irregular stitching), etc. By clarifying the style information of the target image after stitching, a clear goal and benchmark can be provided for the subsequent process, which helps to ensure that the target image after stitching meets the user's needs.
[0035] S120 , based on the target image style information, determining a display area of each image to be stitched in the target image and display position information of the display area in the target image.
[0036] The display area may refer to a specific range occupied and displayed by the image to be stitched in the target image. The display position information may refer to feature information such as coordinates, size and shape of the display area in the target image.
[0037] Specifically, according to the target image style information, the display area of each image to be stitched in the target image is analyzed, and the display area of each image to be stitched in the target image is calculated. The display area can be a rectangle or an irregular shape, depending on the stitching method and the style of the target image. The display position information of the display area in the target image is determined, such as the upper left corner coordinates, width, height, etc., thereby providing accurate position information for subsequent extraction of local display images and writing into memory.
[0038] Exemplarily, the target image style information includes image position information corresponding to each image to be stitched; "determining the display area of each image to be stitched in the target image based on the target image style information" in S120 includes: determining the stitching boundary corresponding to each image to be stitched based on the image position information corresponding to each image to be stitched; horizontally segmenting the target image based on the stitching boundary to obtain all image display areas of the target image in each segment; determining the display area of each image to be stitched in the target image based on all image display areas of the target image in each segment.
[0039] The image position information may refer to the relative position or absolute position information of each image to be stitched in the target image. The stitching boundary may refer to the boundary between the display areas of two adjacent images to be stitched in the target image.
[0040] Specifically, according to the image position information of each image to be stitched in the target image style information, the stitching boundary of each image to be stitched in the target image is calculated. The image position information may include the coordinates of the image to be stitched in the target image (such as the coordinates of the upper left corner or the lower right corner), the size (such as the width and height), etc. The stitching boundary defines the precise position and range of the image to be stitched in the target image. According to the stitching boundary, the target image is divided into a plurality of segments in the horizontal direction. Each segment contains one or more display areas of the images to be stitched. In each segment, the display area of each image to be stitched in the target image is further determined from all the image display areas of the target image in each segment. By accurately calculating the stitching boundary of each image to be stitched in the target image, the accuracy of determining the display area of the image to be stitched in the target image is improved, and the accuracy and efficiency of image stitching are improved.
[0041] Exemplarily, the style information of the target image can be as follows Figure 2 As shown, suppose there are 4 images to be stitched, and according to Figure 2 , then the Y-axis intersection coordinates of each image (horizontal stitching boundary) can be used as reference values for segmentation. In each segment, each image has an image display area, and the number of blocks in the display area corresponds to the same image to be stitched. Therefore, the entire target image can be divided into 5 segments, and the segment number of each image to be stitched can be sorted according to the number of its own segments. For example, image 1 can be divided into 4 segments. The first segment is in segment 1, with only one block displayed, which can be a group; the second segment is in segment 3, with only one block displayed, which can be a group; the third segment is in segment 4, which is divided into two blocks for display, which can be two groups; the fourth segment is in segment 5, with only one block displayed, which can be a group.
[0042] Exemplarily, based on all image display areas of the target image in each segment, determining the display area of each image to be stitched in the target image includes: determining the image to be stitched corresponding to each image display area of the target image in each segment; and determining the target segment where each image to be stitched is located and the display area in the target segment based on the image to be stitched corresponding to each image display area in each segment.
[0043] Specifically, according to each image display area of the target image in each segment, the image to be spliced corresponding to each image display area is determined. For each image to be spliced, according to the segment where its corresponding image display area is located, the target segment corresponding to each image to be spliced is determined, and the image display area corresponding to the image to be spliced in the target segment is the display area of the image to be spliced in the target segment. By accurately calculating the display area of each image to be spliced in the target image, it can be ensured that the spliced image is more visually coherent and seamless.
[0044] S130 , based on the display area, extracting the corresponding display area of the image to be stitched output by each image source to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one.
[0045] The local display image may refer to an image located in a local area of the images to be stitched.
[0046] Specifically, for each image source, an image processing algorithm (such as cropping, scaling, etc.) is used to extract a local display image according to the output image to be stitched and the determined display area, ensuring that the extracted local display image completely matches the display area, thereby reducing unnecessary image data and improving stitching efficiency.
[0047] S140, based on the display position information of the display area in the target image, determine the storage position corresponding to each partial display image, and based on the storage position, write each partial display image into the memory for splicing to obtain the spliced target image.
[0048] The storage location may refer to a specific location or path where the image data is stored in the memory. For example, the storage location may include a memory address and mask information. The memory may refer to a hardware device for storing data, instructions, and information. For example, the memory may be a Double Data Rate Synchronous Dynamic Random Access Memory (DDR).
[0049] Specifically, according to the display position information of the display area in the target image and the position of the canvas corresponding to the target image in the memory, the storage position corresponding to each local display image is calculated, and based on the storage position, each local display image is written into the memory using an appropriate image file format and encoding method. In the memory, according to the previously determined display area and position information, the local display images are spliced together to obtain a spliced target image, thereby achieving seamless splicing of multiple images to be spliced, and improving the quality and visual effect of the spliced target image.
[0050] Exemplary, combined Figure 2 , write each local display image into the memory for splicing. The specific process can be as follows: before the data enters, the parameters are prepared, and the input data is judged as follows according to the segment number, group number, starting address relative to the image itself, starting address relative to the canvas, and group width; the group number and group width are used to end the writing of a group of rows and switch to the next group. After the group width of the last group of each row of data is written, the segment height counter +1, until the counter meets the segment height of the current segment, and then the parameters of the next segment are switched. After all the segment numbers are written, the image is written.
[0051] The technical solution of the embodiment of the present invention obtains the target image style information, which is the style information of the target image obtained after stitching multiple images to be stitched, clarifies the expected style of the stitched image, and provides a clear target and benchmark for the subsequent. Based on the target image style information, the display area of each image to be stitched in the target image and the display position information of the display area in the target image are determined, which can provide accurate position information for the subsequent extraction of the local display image and writing into the memory. Based on the display area, the corresponding display area of the image to be stitched output by each image source is extracted to obtain the local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one, reducing unnecessary image data and improving the stitching efficiency. Based on the display position information of the display area in the target image, the storage position corresponding to each local display image is determined, and based on the storage position, each local display image is written into the memory for stitching to obtain the stitched target image, so as to achieve seamless stitching of multiple images to be stitched, and improve the quality and visual effect of the stitched target image. Through the target image style information, the local display image is extracted outside the memory, which greatly reduces the unnecessary image data inside the memory, improves the stitching efficiency and image quality, can adapt to complex and changeable stitching environments, and reduces the bandwidth requirements for the memory.
[0052] Embodiment 2
[0053] Figure 3 This is a flow chart of an image stitching method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment optimizes the step of "determining the storage location corresponding to each local display image based on the display location information of the display area in the target image". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0054] See also Figure 3 Another image stitching method provided in this embodiment specifically includes the following steps:
[0055] S210 , obtaining target image style information, where the target image style information is style information of the target image obtained by stitching together a plurality of images to be stitched together.
[0056] S220 , based on the target image style information, determine the display area of each image to be stitched in the target image and the display position information of the display area in the target image.
[0057] S230, based on the display area, extract the corresponding display area of the image to be stitched output by each image source to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one.
[0058] S240: For each display area, determine a first image offset address of the display area in the target image based on display position information of the display area in the target image.
[0059] The first image offset address may refer to the number of memory cells required to reach the upper left corner (or a designated reference point) of the display area starting from the start address of the target image.
[0060] Specifically, the position information of the display area in the target image is parsed, which usually includes the coordinates of the upper left corner (or center point coordinates), width and height of the display area. According to the starting address (or reference address) of the target image and the position information of the display area, the first image offset address of the display area in the target image is calculated. This offset address can be a relative address, which indicates the number of memory cells required to reach the upper left corner (or specified reference point) of the display area from the starting address of the target image. The calculation of the offset address provides a mathematical basis for determining the storage location and ensures the accuracy of the storage location.
[0061] S250, based on the first image offset address and the local display image corresponding to the display area, determine the storage location corresponding to the local display image, and based on the storage location, write each local display image into the memory for splicing to obtain a spliced target image.
[0062] Specifically, based on the first image offset address and the size (width and height) of the partial display image, the storage position of the partial display image in the memory is calculated. This storage position is usually an absolute address, indicating the starting position of storing the partial display image data in the memory. Then, according to the storage position, each partial display image is written into the memory for splicing to obtain the spliced target image. By accurately calculating the storage position, unnecessary image data movement and copying are avoided, and the splicing efficiency is improved.
[0063] Exemplarily, "determining a storage location corresponding to the local display image based on the first image offset address and the local display image corresponding to the display area" in S250 may include: determining a first image offset between a boundary of the display area and a boundary of the target image; determining a second image offset address and a second image offset between a boundary of the local display image and a boundary of the image to be stitched based on the local display image and the first image offset address; determining a storage location corresponding to each local display image based on the first image offset, the second image offset and the second image offset address.
[0064] Among them, the first image offset may refer to the offset of the display area (usually a rectangular area) relative to the starting position of the target image (i.e., the entire image). The second image offset may refer to the offset of the local display image (i.e., the image corresponding to the display area cropped from the target image) relative to the image to be spliced (or a reference point of the storage medium). The second image offset address may refer to the starting position of the local display image in the storage medium (or the offset address relative to a reference point). This address may be a memory address, which is used to identify the specific position of the local display image in the memory.
[0065] Specifically, first, it is necessary to clarify the position of the display area (i.e., the part of the image that the user wants to see) in the target image (i.e., the original image or the image to be processed). This is usually achieved by specifying the coordinates of the upper left corner and the lower right corner of the display area (or the width and height and the starting point coordinates). Then, the offset between the boundary of the display area and the boundary of the target image, i.e., the first image offset, is calculated. This offset can be a positive number or a negative number, indicating the horizontal and vertical offset of the display area relative to the starting position of the target image. According to the local display image and the known first image offset address, it is necessary to calculate the offset between the boundary of the local display image and the boundary of the image to be spliced, i.e., the second image offset. At the same time, it is also necessary to determine the starting address of the local display image in the storage, i.e., the second image offset address. Combining the information of the first image offset, the second image offset, and the second image offset address, the storage position of each local display image in the memory can be calculated, thereby improving the accuracy of image splicing.
[0066] Exemplarily, based on the first image offset, the second image offset and the second image offset address, determining the storage position corresponding to each local display image includes: determining the movement distance corresponding to the local display image based on the first image offset and the second image offset; based on the movement distance, shifting the second image offset address to obtain the storage position corresponding to the local display image.
[0067] The moving distance may refer to the difference between the first image offset and the second image offset.
[0068] Specifically, the difference between the first image offset and the second image offset is calculated, and the difference is determined as the movement distance corresponding to the local display image, so that it is possible to accurately know how far the local display image needs to move to reach the desired position. The calculated movement distance is used to perform a shift operation on the second image offset address. This shift operation usually involves converting the movement distance into the number of pixels of the image, and then adding the result to the second image offset address, so that the new position of the local display image in the storage medium, that is, its corresponding storage address, can be obtained.
[0069] Exemplarily, based on the moving distance, the second image offset address is shifted to obtain a storage position corresponding to the local display image, including: if the first image offset is greater than the second image offset, then based on the moving distance, the second image offset address is shifted to a higher bit to obtain the storage position corresponding to the local display image; if the first image offset is less than the second image offset, then based on the moving distance, the second image offset address is shifted to a lower bit to obtain the storage position corresponding to the local display image.
[0070] Specifically, if the first image offset is greater than the second image offset, this means that the position of the local display image in the original image is "far" than the desired splicing or storage position (the "far" here is relative to a certain reference point). Therefore, it is necessary to shift the second image offset address to the high bit (in the conventional memory address representation, this usually means increasing the address value) to "pull the local display image closer" to the desired position. The specific shifting operation can be: according to the moving distance (which may be a negative or positive complement, indicating the amount of address that needs to be reduced or "reversely" increased), the second image offset address is adjusted accordingly. If the first image offset is less than the second image offset, this means that the position of the local display image in the original image is "closer" than the desired splicing or storage position. Therefore, we need to shift the second image offset address to the low bit (in the conventional memory address representation, this usually means reducing the address value) to "push the local display image away" to the desired position. The specific shift operation can be: according to the shift distance (positive value, indicating the amount of address that needs to be increased, but here we are moving to the lower bit, so we actually reduce the value of the second image offset address). By accurately comparing the first image offset and the second image offset, and determining the shift direction and distance based on the result, we can ensure that the local display image is accurately stored in the desired location.
[0071] Exemplarily, the following judgment can be made: the starting address of the local display image relative to its own image can be address 1, and the starting address relative to the canvas (target image) is address 2. The lower 6 bits of the two addresses are compared. When address 1 is greater than address 2, it means that the data corresponding to the local display image needs to be moved to the lower bit. When address 1 is less than address 2, it means that the data needs to be moved to the higher bit. The number of bytes moved is the larger value minus the smaller value.
[0072] The technical solution of the embodiment of the present invention determines the first image offset address of the display area in the target image for each display area based on the display position information of the display area in the target image, thereby determining the specific position of the display area in the target image, providing a reference for the subsequent storage of the local display image. Based on the first image offset address and the local display image corresponding to the display area, the storage position corresponding to the local display image is determined, and the orderly storage of the local display image in the memory is realized, which is convenient for subsequent access and processing. By accurately calculating the storage position, unnecessary image data movement and copying are avoided, and the splicing efficiency is improved. Reasonable storage position and storage format selection help reduce storage space occupancy and improve storage efficiency.
[0073] It should be noted that, taking the DDR data bit width of 512 as an example, the data is split and stored, 512 / 8=64, then each DDR data has 64 single-component pixels. The three parameters of the starting address relative to the own image, the starting address relative to the canvas, and the group width determine the mask of the first data and the last data of each row of data in each group. Since the two starting address parameters may not be multiples of 64, a data shift splicing operation is required to correctly write it into the DDR with the mask. The starting address relative to the own image is used to obtain data from the data source, and the user determines the address written to the DDR, the data shift, and the mask relative to the starting address of the canvas. When the starting address relative to the own image is not a multiple of 64, part of the low-order data will be invalid data. When the starting address relative to the canvas is not a multiple of 64, a shift is performed to move the data according to the starting address. The invalid part of the data in the DDR is actually the data fill of another screen.
[0074] For example, the image sources corresponding to different objects to be spliced may be asynchronous, so when writing to DDR, the storage space of DDR is divided into three areas, each of which is sufficient for the data storage space of the maximum screen loaded by the network port. The area to write to DDR is decided by the write arbitration module. When a screen is written, the area to which the next frame of the screen is written is switched to the next area.
[0075] like Figure 4As shown, the image sources are not synchronized, so the completion of one area is determined by the slower image source, and the third area is used as a buffer for the faster image source. After image source three completes writing to area 1, all image sources in area 1 are written, and DDR starts reading. The time to read the DDR network port output is 16.6ms of image source three writing to area 2. At this time, the faster image source one, after completing the writing of area 2 first, writes to area 3 without affecting area one being read. When area one is output, image source one has not completed writing to area 3; after image source three completes writing to area 2, it starts reading area 2, and area 1 is now empty. After the faster image source one completes writing to area 3, it can write to area 1 again.
[0076] Embodiment 3
[0077] Figure 5 This is a schematic diagram of the structure of an image stitching device provided by Embodiment 3 of the present invention. Figure 5 As shown, the device includes: a style information acquisition module 310 , a position information determination module 320 , a local image acquisition module 330 and an image stitching module 340 .
[0078] The style information acquisition module 310 is used to acquire the style information of the target image, wherein the style information of the target image is the style information of the target image obtained by splicing a plurality of images to be spliced;
[0079] A position information determination module 320, configured to determine, based on the target image style information, a display area of each image to be stitched in the target image and display position information of the display area in the target image;
[0080] A local image acquisition module 330 is used to extract the corresponding display area of the image to be stitched output by each image source based on the display area, and obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one;
[0081] The image stitching module 340 is used to determine the storage position corresponding to each of the local display images based on the display position information of the display area in the target image, and based on the storage position, write each of the local display images into the memory for stitching to obtain the stitched target image.
[0082] The technical solution of this embodiment, by acquiring the target image style information, the target image style information is the style information of the target image obtained after stitching multiple images to be stitched, and the expected style of the stitched image is clarified, providing a clear target and benchmark for the subsequent. Based on the target image style information, the display area of each image to be stitched in the target image and the display position information of the display area in the target image are determined, which can provide accurate position information for the subsequent extraction of the local display image and writing into the memory. Based on the display area, the corresponding display area of the image to be stitched output by each image source is extracted to obtain the local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one, reducing unnecessary image data and improving stitching efficiency. Based on the display position information of the display area in the target image, the storage position corresponding to each local display image is determined, and based on the storage position, each local display image is written into the memory for stitching to obtain the stitched target image, realizing the seamless stitching of multiple images to be stitched, and improving the quality and visual effect of the stitched target image. Through the target image style information, the local display image is extracted outside the memory, which greatly reduces the unnecessary image data inside the memory, improves the stitching efficiency and image quality, can adapt to complex and changeable stitching environments, and reduces the bandwidth requirements for the memory.
[0083] Optionally, the target image style information includes image position information corresponding to each image to be stitched; the position information determination module 320 includes:
[0084] A boundary determination unit, used to determine a splicing boundary corresponding to each image to be spliced based on image position information corresponding to each image to be spliced;
[0085] A first display area determination unit, configured to horizontally segment the target image based on the splicing boundary, and obtain all image display areas of the target image in each segment;
[0086] The second display area determination unit is used to determine the display area of each to-be-joined image in the target image based on the display areas of all images in each segment of the target image.
[0087] Optionally, the second display area determination unit is specifically used to: determine the image to be spliced corresponding to each image display area in each segment of the target image; based on the image to be spliced corresponding to each image display area in each segment, determine the target segment where each image to be spliced is located and the display area in the target segment.
[0088] Optionally, the image stitching module 340 includes:
[0089] an offset address determining unit, configured to determine, for each of the display areas, a first image offset address of the display area in the target image based on display position information of the display area in the target image;
[0090] The storage position determining unit is used to determine the storage position corresponding to the local display image based on the first image offset address and the local display image corresponding to the display area.
[0091] Optionally, the storage location determining unit includes:
[0092] a first offset determination subunit, configured to determine a first image offset between a boundary of the display area and a boundary of a target image;
[0093] a second offset determination subunit, configured to determine, based on the local display image and the first image offset address, a second image offset address between a boundary of the local display image and a boundary of the image to be stitched and a second image offset;
[0094] The storage position determination subunit is used to determine the storage position corresponding to each of the partial display images based on the first image offset, the second image offset and the second image offset address.
[0095] Optionally, the storage position determination subunit is specifically used to: determine the movement distance corresponding to the local display image based on the first image offset and the second image offset; and shift the second image offset address based on the movement distance to obtain the storage position corresponding to the local display image.
[0096] Optionally, the storage position determination subunit is specifically used to: if the first image offset is greater than the second image offset, then based on the moving distance, shift the second image offset address to a higher position to obtain the storage position corresponding to the local display image; if the first image offset is less than the second image offset, then based on the moving distance, shift the second image offset address to a lower position to obtain the storage position corresponding to the local display image.
[0097] The image stitching device provided in the embodiment of the present invention can execute the image stitching method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0098] Figure 6A schematic diagram of the structure of an electronic device 12 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as desktop computers, workstations, servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0099] like Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0100] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0101] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0102] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0103] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0104] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0105] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing an image stitching method provided by the embodiment of the present invention, the method comprising:
[0106] Acquire target image style information, where the target image style information is style information of the target image obtained by stitching together a plurality of images to be stitched together;
[0107] Based on the target image style information, determining a display area of each image to be stitched in the target image and display position information of the display area in the target image;
[0108] Based on the display area, extracting the corresponding display area of the image to be stitched output by each image source to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one;
[0109] Based on the display position information of the display area in the target image, the storage position corresponding to each of the partial display images is determined, and based on the storage position, each of the partial display images is written into the memory for splicing to obtain the spliced target image.
[0110] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the image stitching method provided by any embodiment of the present invention.
[0111] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the image stitching method provided in any embodiment of the present invention are implemented. The method includes:
[0112] Acquire target image style information, where the target image style information is style information of the target image obtained by stitching together a plurality of images to be stitched together;
[0113] Based on the target image style information, determining a display area of each image to be stitched in the target image and display position information of the display area in the target image;
[0114] Based on the display area, extracting the corresponding display area of the image to be stitched output by each image source to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one;
[0115] Based on the display position information of the display area in the target image, the storage position corresponding to each of the partial display images is determined, and based on the storage position, each of the partial display images is written into the memory for splicing to obtain the spliced target image.
[0116] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0117] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0118] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0119] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0120] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0121] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An image stitching method, characterized in that: include: Acquire target image style information, where the target image style information is style information of the target image obtained by stitching together a plurality of images to be stitched together; Based on the target image style information, determining a display area of each image to be stitched in the target image and display position information of the display area in the target image; Based on the display area, extracting the corresponding display area of the image to be stitched output by each image source to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one; Based on the display position information of the display area in the target image, the storage position corresponding to each of the partial display images is determined, and based on the storage position, each of the partial display images is written into the memory for splicing to obtain the spliced target image.
2. The method according to claim 1, characterized in that The target image style information includes image position information corresponding to each image to be stitched; The step of determining a display area of each image to be stitched in the target image based on the target image style information includes: Based on the image position information corresponding to each image to be stitched, determining the stitching boundary corresponding to each image to be stitched; Based on the splicing boundary, the target image is horizontally segmented to obtain all image display areas of the target image in each segment; Based on all image display areas of the target image in each segment, a display area of each image to be stitched in the target image is determined.
3. The method according to claim 2, characterized in that The determining, based on all image display areas of the target image in each segment, a display area of each image to be stitched in the target image comprises: Determine the image to be stitched corresponding to each image display area in each segment of the target image; Based on the image to be spliced corresponding to each image display area in each segment, a target segment where each image to be spliced is located and a display area in the target segment are determined.
4. The method according to claim 1, characterized in that: The determining, based on the display position information of the display area in the target image, a storage position corresponding to each of the partial display images comprises: For each of the display areas, based on display position information of the display area in the target image, determining a first image offset address of the display area in the target image; Based on the first image offset address and the local display image corresponding to the display area, a storage location corresponding to the local display image is determined.
5. The method according to claim 4, characterized in that The determining, based on the first image offset address and the local display image corresponding to the display area, a storage location corresponding to the local display image includes: Determining a first image offset between a boundary of the display area and a boundary of a target image; Determine, based on the partial display image and the first image offset address, a second image offset address and a second image offset amount between a boundary of the partial display image and a boundary of the image to be stitched; Based on the first image offset, the second image offset and the second image offset address, a storage location corresponding to each of the partial display images is determined.
6. The method according to claim 5, characterized in that The determining, based on the first image offset, the second image offset and the second image offset address, a storage location corresponding to each of the partial display images comprises: Determining a movement distance corresponding to the local display image based on the first image offset and the second image offset; Based on the moving distance, the second image offset address is shifted to obtain a storage location corresponding to the partial display image.
7. The method according to claim 6, characterized in that The step of shifting the second image offset address based on the moving distance to obtain a storage location corresponding to the local display image includes: If the first image offset is greater than the second image offset, the second image offset address is shifted toward a higher bit based on the moving distance to obtain a storage location corresponding to the local display image; If the first image offset is smaller than the second image offset, the second image offset address is shifted toward a lower bit based on the moving distance to obtain a storage location corresponding to the local display image.
8. An image stitching device, characterized in that: include: A style information acquisition module, used to acquire target image style information, wherein the target image style information is style information of the target image obtained by splicing a plurality of images to be spliced; A position information determination module, used to determine, based on the target image style information, a display area of each image to be stitched in the target image and display position information of the display area in the target image; A local image acquisition module, used for extracting the corresponding display area of the image to be stitched output by each image source based on the display area, to obtain a local display image in each image to be stitched, wherein the image source corresponds to the image to be stitched one by one; The image stitching module is used to determine the storage position corresponding to each of the partial display images based on the display position information of the display area in the target image, and based on the storage position, write each of the partial display images into the memory for stitching to obtain the stitched target image.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image stitching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image stitching method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Image splicing method and device, equipment and storage medium
CN109712076A
Image splicing method and device and readable storage medium
CN110246081A
Image splicing method and device, equipment and storage medium
CN116823601A
Cationic lipid and method for preparing the same
KR1020250063463A