Image overlap rate detection method, device, equipment and computer storage medium
By segmenting and comparing image boundary sub-images, the overlapping boundary position is determined, which solves the problem of difficulty in balancing detection accuracy and speed in existing technologies, and realizes high-precision and fast image overlap rate detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2021-11-05
- Publication Date
- 2026-06-16
AI Technical Summary
Existing image overlap detection methods cannot simultaneously guarantee detection accuracy and detection speed, especially on mobile devices where real-time detection is difficult to achieve, and they are prone to errors in product shelf scenarios.
By segmenting the target image and the reference image, contrast sub-images and reference sub-images are obtained. By comparing the boundary sub-images with the reference sub-images, the overlapping boundary positions are determined and the image overlap rate is calculated, reducing the amount of computation and improving detection accuracy and speed.
It improves the accuracy and speed of image overlap detection, especially in scenarios containing a large amount of repetitive image information, and reduces the possibility of false recognition.
Smart Images

Figure CN116091525B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, specifically to an image overlap rate detection method, apparatus, device, and computer storage medium. Background Technology
[0002] In the new retail sector, when inspecting and photographing merchandise shelves, it is sometimes necessary to take multiple images and stitch them together to obtain information about all the products on the entire long shelf. Therefore, ensuring the quality of the stitched images is crucial. Specifically, it is essential to ensure that each image overlaps with the previous one. This requires detecting the overlap area between the two images and providing real-time alerts about the overlap area during the photo taking process.
[0003] However, traditional image overlap region detection methods suffer from the following problems: poor detection performance, as many products in a shelf scene have similar features such as color and shape, making traditional image information matching methods prone to errors; and time-consuming algorithms, making it difficult for general detection methods to perform real-time detection on mobile devices such as smartphones. Therefore, there is an urgent need for a detection method that can simultaneously guarantee both the accuracy and speed of image overlap detection. Summary of the Invention
[0004] This application provides an image overlap rate detection method, apparatus, device, and computer storage medium, aiming to solve the problem that existing overlap rate detection methods cannot simultaneously guarantee the detection accuracy and detection speed of image overlap rate.
[0005] In a first aspect, this application provides an image overlap rate detection method, the method comprising:
[0006] Acquire the target image and the reference image;
[0007] The target image and the reference image are segmented separately to obtain a comparison sub-image and a reference sub-image;
[0008] Based on the boundary sub-images in the comparison sub-images and each of the reference sub-images, the overlapping boundary position of the target image in the reference image is determined;
[0009] The image overlap rate between the target image and the reference image is determined based on the overlap boundary position.
[0010] In one possible implementation, determining the overlap boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images includes:
[0011] The boundary sub-images in the comparison sub-images are compared with each of the reference sub-images to determine the positional order information between the target image and the reference images;
[0012] Based on the position sorting information, extract the target boundary sub-image from the boundary sub-image;
[0013] Based on the target boundary sub-image and each of the reference sub-images, the overlapping boundary position of the target image in the reference image is determined.
[0014] In one possible implementation, comparing the boundary sub-images in the comparison sub-images with each of the reference sub-images to determine the positional order information between the target image and the reference images includes:
[0015] Obtain the boundary sub-image in the comparison sub-image and the reference boundary sub-image in the reference sub-image;
[0016] Each of the boundary sub-images is compared with each of the reference boundary sub-images to obtain the boundary similarity.
[0017] Obtain the boundary position information of each of the boundary sub-images in the target image;
[0018] Based on the boundary location information and the boundary similarity, the positional order information between the target image and the reference image is determined.
[0019] In one possible implementation, comparing the boundary sub-images in the comparison sub-images with each of the reference sub-images to determine the positional order information between the target image and the reference images includes:
[0020] Obtain a first boundary image and a second boundary image from the boundary sub-image, wherein the first boundary image and the second boundary image are obtained according to a preset first segmentation ratio;
[0021] By comparing the first boundary image and the second boundary image, the positional ordering information between the target image and the reference image is obtained;
[0022] Extracting the target boundary sub-image from the boundary sub-image based on the position sorting information includes:
[0023] Obtain the third boundary image and the fourth boundary image from the boundary sub-image, wherein the third boundary image and the fourth boundary image are obtained according to a preset second segmentation ratio, and the second segmentation ratio is greater than the first segmentation ratio;
[0024] Based on the position sorting information, target boundary sub-images are extracted from the third boundary image and the fourth boundary image.
[0025] In one possible implementation, determining the overlap boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images includes:
[0026] The boundary sub-image in the comparison sub-image is compared with each of the reference sub-images to obtain the image similarity between the target boundary sub-image and each of the reference images;
[0027] From each of the reference sub-images, extract the target boundary sub-image with the highest image similarity;
[0028] Obtain the positional sorting information between the target image and the reference image;
[0029] Based on the position sorting information and the target boundary sub-image, the overlapping boundary position of the target image in the reference image is determined.
[0030] In one possible implementation, comparing the boundary sub-image in the comparison sub-image with each of the reference sub-images to obtain the image similarity between the boundary sub-image and each of the reference sub-images includes:
[0031] Obtain the boundary sub-image in the comparison sub-image;
[0032] Obtain the target histogram of pixel values in the boundary sub-image, and the reference histogram of pixel values in each of the reference sub-images;
[0033] The histogram similarity between the target histogram and each of the reference histograms is detected, and the histogram similarity is used as the image similarity between the boundary sub-image and each of the reference sub-images.
[0034] In one possible implementation, determining the overlapping boundary position of the target image in the reference image based on the position sorting information and the target boundary sub-image includes:
[0035] Based on the position sorting information, determine the overlapping start position in the reference image;
[0036] Obtain the target position corresponding to the target boundary sub-image in the reference image, and determine the overlap end position in the reference image based on the target position;
[0037] The overlap start position and the overlap end position are set as overlap limit positions.
[0038] Secondly, this application provides an image overlap rate detection device, the image overlap rate detection device comprising:
[0039] The acquisition unit is used to acquire the target image and the reference image;
[0040] A segmentation unit is used to segment the target image and the reference image respectively to obtain a comparison sub-image and a reference sub-image;
[0041] The comparison unit is used to determine the overlapping boundary position of the target image in the reference image based on the boundary sub-image in the comparison sub-image and each of the reference sub-images;
[0042] The determining unit is configured to determine the image overlap rate between the target image and the reference image based on the overlap boundary position.
[0043] In one possible implementation, the comparison unit is also used for:
[0044] The boundary sub-images in the comparison sub-images are compared with each of the reference sub-images to determine the positional order information between the target image and the reference images;
[0045] Based on the position sorting information, extract the target boundary sub-image from the boundary sub-image;
[0046] Based on the target boundary sub-image and each of the reference sub-images, the overlapping boundary position of the target image in the reference image is determined.
[0047] In one possible implementation, the comparison unit is also used for:
[0048] Obtain the boundary sub-image in the comparison sub-image and the reference boundary sub-image in the reference sub-image;
[0049] Each of the boundary sub-images is compared with each of the reference boundary sub-images to obtain the boundary similarity.
[0050] Obtain the boundary position information of each of the boundary sub-images in the target image;
[0051] Based on the boundary location information and the boundary similarity, the positional order information between the target image and the reference image is determined.
[0052] In one possible implementation, the comparison unit is also used for:
[0053] Obtain a first boundary image and a second boundary image from the boundary sub-image, wherein the first boundary image and the second boundary image are obtained according to a preset first segmentation ratio;
[0054] By comparing the first boundary image and the second boundary image, the positional ordering information between the target image and the reference image is obtained;
[0055] Obtain the third boundary image and the fourth boundary image from the boundary sub-image, wherein the third boundary image and the fourth boundary image are obtained according to a preset second segmentation ratio, and the second segmentation ratio is greater than the first segmentation ratio;
[0056] Based on the position sorting information, target boundary sub-images are extracted from the third boundary image and the fourth boundary image.
[0057] In one possible implementation, the comparison unit is also used for:
[0058] The boundary sub-image in the comparison sub-image is compared with each of the reference sub-images to obtain the image similarity between the boundary sub-image and each of the reference sub-images;
[0059] From each of the reference sub-images, extract the target boundary sub-image with the highest image similarity;
[0060] Obtain the positional sorting information between the target image and the reference image;
[0061] Based on the position sorting information and the target boundary sub-image, the overlapping boundary position of the target image in the reference image is determined.
[0062] In one possible implementation, the comparison unit is also used for:
[0063] Obtain the boundary sub-image in the comparison sub-image;
[0064] Obtain the target histogram of pixel values in the boundary sub-image, and the reference histogram of pixel values in each of the reference sub-images;
[0065] The histogram similarity between the target histogram and each of the reference histograms is detected, and the histogram similarity is used as the image similarity between the boundary sub-image and each of the reference sub-images.
[0066] In one possible implementation, the comparison unit is also used for:
[0067] Based on the position sorting information, determine the overlapping start position in the reference image;
[0068] Obtain the target position corresponding to the target boundary sub-image in the reference image, and determine the overlap end position in the reference image based on the target position;
[0069] The overlap start position and the overlap end position are set as overlap limit positions.
[0070] Thirdly, this application also provides an image overlap rate detection device, which includes a processor and a memory. The memory stores a computer program, and when the processor calls the computer program in the memory, it executes the steps of any of the image overlap rate detection methods provided in this application.
[0071] Fourthly, this application also provides a computer storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the image overlap rate detection method.
[0072] The image overlap rate detection method provided in this application includes: acquiring a target image and a reference image; segmenting the target image and the reference image respectively to obtain a comparison sub-image and a reference sub-image; determining the overlap boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images; and determining the image overlap rate between the target image and the reference image based on the overlap boundary position. It is evident that calculating the overlap boundary position only requires comparing the boundary sub-images with each of the reference sub-images in the reference image. Compared to directly comparing the target image and the reference image, the number of pixels involved in the calculation is less. Furthermore, since the calculation does not involve all pixels in the target image, the possibility of false recognition is reduced. Therefore, for images containing a large amount of repetitive image information, such as warehouses, the image overlap rate detection accuracy is higher. Thus, the image overlap rate detection method provided in this application can simultaneously guarantee the detection accuracy and speed of image overlap rate. Attached Figure Description
[0073] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0074] Figure 1 This is a schematic diagram illustrating an application scenario of the image overlap detection method provided in this application embodiment;
[0075] Figure 2 This is a schematic flowchart of an image overlap rate detection method provided in the embodiments of this application;
[0076] Figure 3 This is a schematic diagram of a comparison sub-image and a reference sub-image provided in the embodiments of this application.
[0077] Figure 4 This is a schematic diagram of a process for obtaining the overlapping boundary position provided in an embodiment of this application;
[0078] Figure 5 This is a schematic diagram of an overlapping area provided in an embodiment of this application;
[0079] Figure 6 This is another schematic diagram of the process for obtaining the overlapping boundary position provided in the embodiments of this application;
[0080] Figure 7 This is another flowchart illustrating the method for obtaining the overlapping boundary position provided in the embodiments of this application;
[0081] Figure 8 This is a schematic diagram of an embodiment of the image overlap detection device provided in this application.
[0082] Figure 9 This is a schematic diagram of an embodiment of the image overlap rate detection device provided in this application. Detailed Implementation
[0083] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0084] In the description of the embodiments of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0085] To enable any person skilled in the art to implement and use this application, the following description is provided. In this description, details are set forth for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other instances, well-known processes will not be described in detail to avoid obscuring the description of the embodiments of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in the embodiments of this application.
[0086] This application provides an image overlap rate detection method, apparatus, device, and computer storage medium. The image overlap rate detection apparatus can be integrated into an image overlap rate detection device, which can be a server or a terminal, etc.
[0087] The execution subject of the image overlap rate detection method in this application embodiment can be the image overlap rate detection device provided in this application embodiment, or different types of image overlap rate detection devices such as server equipment, physical host, or user equipment (UE) that integrate the image overlap rate detection device. The image overlap rate detection device can be implemented in hardware or software. The UE can be a terminal device such as a smartphone, tablet computer, laptop computer, handheld computer, desktop computer, or personal digital assistant (PDA).
[0088] The image overlap detection device can operate independently or as a cluster of devices.
[0089] For ease of understanding, it should be noted firstly that image overlap in this application embodiment refers to two images containing the same image content, typically existing at the image boundaries. For example, when a user holds a mobile phone and moves it horizontally while continuously taking pictures, the areas near the image boundaries in two consecutively captured images may contain the same content; this content is the overlapping area of the two images. The image overlap rate refers to the percentage of the image area occupied by the overlapping area. The concepts of overlapping area, overlap, and overlap rate will be referred to in the following text, and will not be elaborated upon further.
[0090] See Figure 1 , Figure 1 This is a schematic diagram of a scene of the image overlap rate detection system provided in an embodiment of this application. The image overlap rate detection system may include an image overlap rate detection device 100, which integrates an image overlap rate detection apparatus.
[0091] In addition, such as Figure 1 As shown, the image overlap detection system may also include a memory 200 for storing data, such as text data.
[0092] It should be noted that, Figure 1The schematic diagram of the image overlap rate detection system shown is merely an example. The image overlap rate detection system and scenario described in this application are for the purpose of more clearly illustrating the technical solutions of this application, and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of image overlap rate detection systems and the emergence of new business scenarios, the technical solutions provided in this invention are also applicable to similar technical problems.
[0093] The image overlap rate detection method provided in the embodiments of this application will now be introduced. In the embodiments of this application, the image overlap rate detection device is used as the execution subject. For the sake of simplicity and ease of description, the execution subject will be omitted in the subsequent method embodiments.
[0094] Reference Figure 2 , Figure 2 This is a flowchart illustrating an image overlap rate detection method provided in an embodiment of this application. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here. Specifically, the image overlap rate detection method may include the following steps 201 to 204, wherein:
[0095] 201. Obtain the target image and the reference image.
[0096] The target image and the reference image refer to two images of the same size used to detect the image overlap rate.
[0097] The image overlap rate detection method in this application can detect both historical images in a database or cache and real-time acquired images with historical images. When applied to detecting historical images, the target image and the reference image can be any two images in the database or cache. When applied to detecting real-time acquired images with historical images, the reference image refers to any image in the database or cache, such as the most recently captured image, while the target image refers to the real-time acquired image. For example, when applying the image overlap rate detection method in this application to a warehouse scenario, the target image can be an image currently captured by warehouse management personnel, while the reference image can be the previous image in the image sequence of the target image in the database or cache. It should be noted that the target image and the reference image refer to images that have undergone preprocessing and can be directly used for image overlap rate detection. For ease of explanation, the following will refer to the target image as the real-time acquired image and the reference image as the previous image of the target image, but this should not be construed as a limitation of the embodiments of this application.
[0098] This application does not limit the image type of the target image and the reference image. The target image and the reference image can be RGB images, HSV images, or grayscale images, etc. For ease of understanding, the following description will use RGB images as the target image and the reference image, but this should not be construed as a limitation on the embodiments of this application.
[0099] This application does not impose specific limitations on the methods for acquiring the target image and the reference image. The target image and the reference image can be images obtained through image acquisition devices such as mobile phones and cameras. To ensure the smooth progress of the subsequent detection process, the target image can be preprocessed. For example, the following methods can be used:
[0100] (1.1) Obtain the current image and the reference image.
[0101] The current image refers to the original image of the target image before processing. Depending on the shooting conditions, the current image may have issues such as different dimensions from the reference image or unclear image content. For example, when warehouse managers use different equipment or shooting modes, the resulting current image and the reference image may have different dimensions. Or, when warehouse managers take pictures in poor lighting conditions, the resulting current image may have unclear content.
[0102] (1.2) Adjust the image size of the current image to obtain a preprocessed image with the same image size as the reference image.
[0103] The purpose of resizing the current image is to obtain a preprocessed image that matches the reference image. Specifically, the current image can be adjusted accordingly based on the dimensions of the reference image. Assuming the reference image is a standard electronic image with a width of 360 pixels and a height of 480 pixels, the target adjustment size of the current image can be obtained using equations (1) and (2), and the current image can be adjusted to obtain the preprocessed image:
[0104] W new =360 Equation (1)
[0105]
[0106] Among them, W new H is the image width of the preprocessed image. new For the image height of the preprocessed image, H old W is the image height of the current image. old The width of the current image.
[0107] Assuming the reference image is a standard electronic image with a width of 480 pixels and a height of 360 pixels, the target adjustment size of the current image can be obtained through equations (3)-(4), and the current image can be adjusted to obtain the preprocessed image:
[0108] H new =360 Equation (3)
[0109]
[0110] Among them, H new To preprocess the image height, W new W is the image width of the preprocessed image. old H is the image width of the current image. old The image height of the current image.
[0111] (1.3) Perform a sharpness test on the preprocessed image to determine whether the preprocessed image is sharp.
[0112] Sharpness detection refers to detecting whether the image information in the preprocessed image is clear. In addition to the possible reasons for image blurriness mentioned in step (1.1), adjusting the image size of the current image may result in an unclear preprocessed image due to image stretching. If the image is unclear, subsequent detection of image overlap rate may produce incorrect results. Therefore, it is necessary to determine whether the preprocessed image is clear.
[0113] Specifically, edge detection can be used to determine whether a preprocessed image is sharp. Sharpness detection can be performed using the following steps:
[0114] (1.4.1) Obtain the grayscale image of the preprocessed image.
[0115] A grayscale image is an image where each pixel has only one sampled color, meaning each pixel's value is either 0 or 1. Specifically, a grayscale image of a preprocessed image can be obtained using floating-point algorithms, shifting methods, or by taking only the pixel values of the G (Green) channel.
[0116] (1.4.2) Calculate the Laplacian operator for each pixel in the grayscale image to obtain the Laplacian operator value for each pixel.
[0117] The Laplacian operator is a second-order differential operator, and the result can represent the difference in pixel value between each pixel and its surrounding pixels.
[0118] (1.4.3) Calculate the variance of the Laplacian operator values in the grayscale image.
[0119] (1.4.4) If the variance is greater than the preset variance threshold, the preprocessed image is determined to be clear.
[0120] The calculated variance can characterize the changes in image features in a grayscale image. If the variance is greater than a preset variance threshold, it indicates that the changes in image features are significant, and therefore the preprocessed image can be determined to be clear.
[0121] (1.4) If the preprocessed image is clear, then set the preprocessed image as the target image.
[0122] If the preprocessed image is clear, the image overlap rate detection device can set the preprocessed image with adjusted image size as the target image and proceed with the next image overlap rate detection step.
[0123] In summary, through steps (1.1) to (1.4), the image overlap rate detection device can obtain a target image that can be directly used for image overlap rate detection, thus avoiding errors during image overlap rate detection.
[0124] 202. Segment the target image and the reference image respectively to obtain a comparison sub-image and a reference sub-image.
[0125] The comparison sub-image is a sub-image obtained by segmenting the target image, and the reference sub-image is a sub-image obtained by segmenting the reference image. During segmentation, the segmentation direction is determined by the camera movement direction when capturing the target image and the reference image. For example, the normal direction of the camera movement direction can be used as the segmentation direction. For instance, when a warehouse manager moves their phone horizontally to capture the target image and the reference image of a shelf, the camera movement direction is the direction corresponding to the width of the image in both the target image and the reference image. Therefore, the direction corresponding to the height of the image in both the target image and the reference image can be used as the segmentation direction to segment both the target image and the reference image. For ease of understanding, the segmentation direction is assumed to be the direction corresponding to the height of the image in both the target image and the reference image in the following text, and will not be specifically described further. However, the segmentation direction should not be construed as a limitation on the embodiments of this application.
[0126] Specifically, when segmenting the target image and the reference image separately, the image overlap rate detection device can perform proportional segmentation with the same ratio to facilitate subsequent image overlap rate detection steps. For example, the target image and the reference image can each be divided into 5 equal parts to obtain comparison sub-images and reference sub-images, where each comparison sub-image and each reference sub-image has the same size. When the images cannot be divided equally, for example, if the width of the target image and the reference image is 360 pixels, and it is necessary to divide the target image and the reference image into 7 equal parts, then a reference... Figure 3 The division in the middle, Figure 3Image A is the target image, image B is the reference image, A1-A7 are comparison sub-images obtained by segmenting the target image, and B1-B7 are reference sub-images obtained by segmenting the reference image. Specifically, among A1-A7, the size of the first comparison sub-images A1-A6 can be determined as follows: divide 360 pixels by 7 and round down to get 51 pixels. Then, use 51 pixels as the image width of A1-A6, and the image width of A7 is the result of subtracting the sum of the image widths of A1-A6 from 360 pixels. B1-B7 can be processed similarly to A1-A7. Alternatively, 51 pixels can also be used as the image width of A2-A7 and the image width of B2-B7. This application embodiment does not restrict the pixel allocation when segmenting at equal proportions. In order to avoid situations where equal segmentation is not possible and affect subsequent steps, it is necessary to select an appropriate segmentation ratio.
[0127] In some embodiments, the image overlap detection device can also perform non-proportional segmentation of the target image, for example, by referencing... Figure 3 After segmentation, the dimensions of the comparison sub-images A1-A7 can be: A1 and A7 have the same image width; A2-A6 have the same image width; or A2-A6 have an image width greater than that of A1 or A7. At this point, the reference images can be segmented according to the image widths of A1 and A7 to obtain multiple reference sub-images with the same image width as A1 and A7.
[0128] Image overlap detection equipment can segment the target image and the reference image multiple times to obtain multiple sets of comparison sub-images and multiple sets of reference sub-images. It should be noted that if there are multiple sets of comparison sub-images and multiple sets of reference sub-images, each set of comparison sub-images corresponds to one set of reference sub-images. When comparing comparison sub-images with reference sub-images in the following text, it refers to comparing each set of comparison sub-images with its corresponding set of reference sub-images. For example, the comparison sub-images may include a first sub-image group and a second sub-image group obtained by dividing the target image and the reference image into two equal parts, respectively. They may also simultaneously include a third sub-image group and a fourth sub-image group obtained by dividing the target image and the reference image into five equal parts, respectively. If the process of comparing comparison sub-images with reference images appears in the following text, it can be a comparison of the first sub-image group with the second sub-image group, and / or a comparison of the third sub-image group with the fourth sub-image group.
[0129] 203. Compare the boundary sub-image in the comparison sub-image with each of the reference sub-images to obtain the overlapping boundary position of the target image in the reference image.
[0130] A boundary sub-image refers to a sub-image that contains the complete boundary of the target image. During segmentation, the image overlap detection device can assign a label to each comparison sub-image according to its corresponding region in the target image. For example, for N segmented comparison sub-images, labels 1-N are assigned from left to right according to their corresponding regions in the target image. In this case, the boundary sub-image refers to the boundary sub-image with the smallest and largest corresponding label numbers. (Refer to...) Figure 3 A1 and A7 are the boundary sub-images.
[0131] The overlap boundary position refers to the location of the boundary of the overlapping region within the reference image when the target image and the reference image overlap. For example, the overlap boundary position can be the position within the boundary of the overlapping region that corresponds to the boundary parallel to the segmentation direction, i.e., the image height of the reference image. (Reference) Figure 3 If A7 overlaps with B3, then A6 overlaps with B2, and A5 overlaps with B1. This means the overlapping area in the image includes the corresponding areas of B1-B3. Therefore, the overlap boundary includes the position of the right sub-image boundary of B3 and the position of the left sub-image boundary of B1. Alternatively, if A1 overlaps with B5, then A2 overlaps with B6, and A3 overlaps with B7. This means the overlapping area in the image includes the corresponding areas of B5-B7. Therefore, the overlap boundary includes the position of the left image boundary of B5 and the position of the right sub-image boundary of B7.
[0132] By comparing the boundary sub-image and the reference sub-image, the image overlap rate detection device can obtain the reference sub-image that is most similar to the boundary sub-image, thereby determining the overlap boundary location. For example, the n sub-images with the highest similarity to the boundary sub-image in the reference sub-image can be extracted, and then the overlap boundary location can be determined based on the boundaries of these sub-images. (Reference) Figure 3 If the three sub-images with the highest similarity to the boundary sub-image in the reference sub-image are B1, B2, and B3, then the overlap boundary position refers to the left sub-image boundary of B1 and the right sub-image boundary of B3. Alternatively, the sub-image with the highest similarity to the boundary sub-image in the reference sub-image can be extracted, and then the overlap boundary position can be determined based on the relative positions of the target image and the reference image during stitching, as well as the reference sub-image with the highest similarity, as explained in detail below.
[0133] It should be noted that if the boundary sub-image and the reference sub-image are not the same size, such as in step 202 where the target image with a width of 360 pixels and the reference image 7 are divided equally, the larger of the boundary sub-image and the reference sub-image can be cut to obtain the same size, or the larger one can be resized to obtain the same size.
[0134] 204. Determine the image overlap rate between the target image and the reference image based on the overlap boundary position.
[0135] After obtaining the overlap boundary position, the image overlap rate detection device can calculate the area of the overlapping region in the reference image based on the overlap boundary position, and then calculate the image overlap rate based on the preset reference image area and the area of the overlapping region.
[0136] Continue with Figure 3 Let's take an example. Specifically, Figure 3 In this diagram, A represents the target image, and B represents the reference image. Assuming the overlap boundary includes the positions of the right sub-image boundary of B3 and the left sub-image boundary of B1 in the reference image, the area to the left of line L in B can be considered the area of the overlapping region, where L is the line corresponding to the right sub-image boundary of B3 in the reference image. Finally, the image overlap rate detection device divides the area of the overlapping region by the area of the reference image to obtain the image overlap rate.
[0137] In summary, the image overlap rate detection method provided in this application includes: acquiring a target image and a reference image; segmenting the target image and the reference image respectively to obtain a comparison sub-image and a reference sub-image; comparing the boundary sub-image in the comparison sub-image with each of the reference sub-images to determine the overlap boundary position of the target image in the reference image; and determining the image overlap rate between the target image and the reference image based on the overlap boundary position. It is evident that calculating the overlap boundary position only requires comparing the boundary sub-image with each of the reference sub-images in the reference image. Compared to directly comparing the target image and the reference image, the number of pixels involved in the calculation is less. Furthermore, since the calculation does not involve all pixels in the target image, the possibility of false recognition is reduced. Therefore, for images containing a large amount of repetitive image information, such as warehouses, the image overlap rate detection accuracy is higher. Thus, the image overlap rate detection method provided in this application can simultaneously guarantee the detection accuracy and speed of the image overlap rate.
[0138] In some embodiments, the relative position between the target image and the reference image can be determined first, and then the target boundary sub-image in the boundary sub-image can be extracted based on the relative position to reduce the computational load when comparing with each reference sub-image. Reference Figure 4 At this point, comparing the boundary sub-image in the comparison sub-image with each of the reference sub-images to obtain the overlapping boundary position of the target image in the reference image includes:
[0139] 301. Compare the boundary sub-images in the comparison sub-images with each of the reference sub-images to determine the positional order information between the target image and the reference images.
[0140] Positional ordering information refers to the relative positions of the target image and the reference image when stitching together the overlapping areas of the target image and the reference image. Figure 5 To explain, Figure 5 It contains the target image E and the reference image F. The dashed area between E and F is the stitched overlapping area, therefore the positional sorting information is... Figure 5 The position of E relative to F can be understood as E being to the left of F.
[0141] In some embodiments, positional sorting information can be obtained by comparing boundary sub-images. In this case, comparing the boundary sub-images in the comparison sub-images with each of the reference sub-images includes:
[0142] (2.1) Obtain the boundary sub-image in the comparison sub-image and the reference boundary sub-image in the reference sub-image.
[0143] The reference boundary subimage and the boundary subimage have the same meaning. Figure 3 , Figure 3 B1 and B7 in the reference image are the reference boundary sub-images of image B. The reference boundary sub-images contain the complete image boundary of the reference image.
[0144] (2.2) Compare each of the boundary sub-images with each of the reference boundary sub-images to obtain the boundary similarity.
[0145] Boundary similarity refers to the similarity of image information near the image boundaries between a target image and a reference image. (Reference) Figure 3 ,if Figure 3 The middle boundary sub-images refer to A1 and A7, while the reference boundary sub-images refer to B1 and B7. Therefore, the boundary similarity can include: the similarity between A1 and B1, the similarity between A1 and B7, the similarity between A7 and B1, and the similarity between A7 and B7.
[0146] Furthermore, boundary similarity can also include only the similarity of image information near the relative image boundaries between the target image and the reference image. (Continue to refer to...) Figure 3 Let i1, i2, i3, and i4 be the four image boundaries of A, and j1, j2, j3, and j4 be the four image boundaries of B. Then i1 and j3 form one set of relative image boundaries between the target image and the reference image, and i3 and j1 form another set of relative image boundaries between the target image and the reference image. Therefore, boundary similarity can also include... Figure 3For example, the similarity between A1 and B7, and the similarity between B7 and A1.
[0147] (2.3) Obtain the boundary position information of each of the boundary sub-images in the target image.
[0148] Boundary location information refers to the position of the image boundary contained in each boundary sub-image within the target image. For example, boundary location information can be the position of the image boundary contained in each boundary sub-image within the target image, corresponding to the image coordinates. For instance, the average position of the pixel coordinates of the image boundary in each boundary sub-image within the target image can be obtained, and the boundary location information can be determined based on the average position. Figure 3 For example, in Figure 3 If the boundary sub-images are A1 and A7, then the boundary position information of each boundary sub-image in the target image can be understood as A1 containing the left image boundary of the target image, and A7 containing the right image boundary of the target image.
[0149] (2.4) Determine the positional ordering information between the target image and the reference image based on the boundary position information and the boundary similarity.
[0150] When boundary similarity refers to the image similarity near the boundaries of all images between the target image and the reference image, that is, when... Figure 3 For example, when boundary similarity includes the similarity between A1 and B1, A1 and B7, A7 and B1, and A7 and B7, the boundary sub-image and reference boundary sub-image corresponding to the highest boundary similarity among the four calculated similarities can be selected. Let's assume they are A1 and B7. Then, the positional ordering information is determined based on the boundary position information of A1 in the target image. Since the boundary position information of A1 is that A1 contains the left image boundary of the target image, the left image boundary of the target image is contained in the overlapping area. Therefore, the positional ordering information can be determined to mean that when the overlapping area of the target image and the reference image is stitched together, the target image is located on the right side of the reference image. As another example, if the boundary sub-image and reference boundary sub-image corresponding to the highest boundary similarity are A7 and B1, since the boundary position information of A7 is that A7 contains the right image boundary of the target image, the right image boundary of the target image is contained in the overlapping area. Therefore, the positional ordering information can be determined to mean that when the overlapping area of the target image and the reference image is stitched together, the target image is located on the left side of the reference image.
[0151] In some embodiments, boundary similarity may also include only the similarity of image information near the relative image boundary between the target image and the reference image. In this case, the boundary sub-image corresponding to the highest boundary similarity among the calculated similarities and the reference boundary sub-image can also be selected, and then the position sorting information can be determined based on the boundary position information of the boundary sub-image.
[0152] by Figure 3 For example, let's explain in three cases:
[0153] (i) If the boundary sub-images are A1 and A7, and the reference boundary sub-images are B1 and B7, and the first boundary similarity between A1 and B7 is greater than the second boundary similarity between A7 and B1, then the positional ordering information can be understood as the target image being located to the right of the reference image when stitching the overlapping areas of the target image and the reference image.
[0154] (ii) If the boundary sub-images are A1 and A7, and the reference boundary sub-images are B1 and B7, and the first boundary similarity between A1 and B7 is less than the second boundary similarity between A7 and B1, then the positional ordering information can be understood as the target image being located to the left of the reference image when stitching the overlapping areas of the target image and the reference image.
[0155] (iii) If the boundary sub-images are A1 and A7, and the reference boundary sub-images are B1 and B7, and the first boundary similarity between A1 and B7 is equal to the second boundary similarity between A7 and B1, it means that the image information contained in the boundary sub-images is too small to accurately determine the positional order information. In this case, the segmentation ratio when segmenting the target image and the reference image can be changed, and then recalculated.
[0156] In summary, a higher boundary similarity indicates a greater similarity between the target image and the reference image in terms of the image information contained near the image boundary. Furthermore, based on the relationship between boundary similarities, for example… Figure 3 The similarity between A1 and B7, and the relationship between the similarity between B7 and A1, can determine the positional order information. Therefore, the method in this embodiment only needs to detect the similarity between a small number of sub-images to determine the positional order information, without having to compare the boundary sub-image with all reference sub-images, thus reducing the computational load.
[0157] 302. Extract the target boundary sub-image from the boundary sub-image according to the position sorting information.
[0158] The target boundary sub-image refers to the boundary sub-image containing the overlapping region, which can be understood as the boundary sub-image corresponding to the image boundary contained in the overlapping region in step (2.4).
[0159] Specifically, if the positional sorting information includes the information that when the target image and the reference image overlap, the target image is located to the left of the reference image, then the boundary sub-image containing the right boundary of the target image can be used as the target boundary sub-image. Conversely, if the positional sorting information includes the information that when the target image and the reference image overlap, the target image is located to the right of the reference image, then the boundary sub-image containing the left boundary of the target image can be used as the target boundary sub-image.
[0160] 303. Based on the target boundary sub-image and each of the reference sub-images, determine the overlapping boundary position of the target image in the reference image.
[0161] The explanation of the overlap boundary location can be found in the above description, and will not be repeated here. The image overlap rate detection device can refer to the method in step 203 to extract the n sub-images with the highest similarity to the boundary sub-image from the reference sub-image, and then determine the overlap boundary location based on the boundaries of these sub-images. Alternatively, it can extract the sub-image with the highest similarity to the boundary sub-image from the reference sub-image, and then determine the overlap boundary location based on the relative positions of the target image and the reference image during stitching, as well as the sub-image with the highest similarity.
[0162] In summary, by using the methods in steps 301-303, the image overlap rate detection device can compare only the target boundary sub-image with each reference sub-image, without having to compare all sub-images in the boundary sub-image with each reference sub-image simultaneously, thus reducing the computational load.
[0163] In some embodiments, the image overlap rate detection device can employ different segmentation ratios when acquiring positional sorting information and when acquiring overlap boundary positions. This is because acquiring overlap boundary positions requires using the smallest possible boundary sub-images to obtain accurate overlap boundary locations. However, acquiring positional sorting information requires using large boundary sub-images to ensure that the calculated boundary sub-images contain sufficient image information and reduce the computational load during segmentation. Therefore, to simultaneously meet both requirements, the image overlap rate detection device can segment the target image and the reference image using different segmentation ratios at different stages. In this case, both the comparison sub-image and the reference sub-image contain two sets of sub-images, as illustrated in step 202. (Reference) Figure 6 At this point, determining the overlap boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images includes:
[0164] 401. Obtain the first boundary image and the second boundary image from the boundary sub-image, wherein the first boundary image and the second boundary image are obtained according to a preset first segmentation ratio.
[0165] The first boundary image and the second boundary image are sub-images that each contain a complete image boundary of the target image after one segmentation of the target image. (Reference) Figure 3 The first boundary image and the second boundary image refer to A1 and A7. The first boundary image can be either A1 or A7. Correspondingly, when the first boundary image is A1, the second boundary image refers to A7, and when the first boundary image is A7, the second boundary image refers to A1.
[0166] The first segmentation ratio is the segmentation ratio of the target image when determining positional ordering information. It should be noted that the first segmentation ratio should not be too large; it can be set to 2 or 3. This is because if the first segmentation ratio is too large, the image information contained in the boundary sub-image and the reference boundary sub-image will be too small, thus potentially leading to larger errors when determining the location of overlapping regions based on relative boundary similarity. For example, the reference... Figure 3 If, when determining the positional ranking information, the target image and the reference image are each divided into 7 parts, resulting in comparison sub-images A1-A7 and reference sub-images B1-B7, with the overlap boundary corresponding to A1 and B5, then comparing the similarity between A1 and B7, and between A7 and B1, might reveal that the similarity between A7 and B1 is greater than the similarity between A1 and B7. Therefore, the obtained positional ranking information would be the opposite of the actual result. However, if the target image and the reference image are each divided into 2 or 3 parts, the likelihood of this reversal would be greatly reduced.
[0167] 402. Compare the first boundary image and the second boundary image to obtain the positional sorting information between the target image and the reference image.
[0168] The process of determining the position sorting information can refer to step 301, or the process of steps (2.1)-(2.4), comparing the first boundary image and the second boundary image with the reference sub-image in the reference image, or comparing the first boundary image and the second boundary image with the reference sub-image containing the relative image boundary, which will not be elaborated further.
[0169] 403. Obtain the third boundary image and the fourth boundary image in the boundary sub-image, wherein the third boundary image and the fourth boundary image are obtained according to a preset second segmentation ratio, and the second segmentation ratio is greater than the first segmentation ratio.
[0170] The definitions of the third and fourth boundary images are similar to those of the first and second boundary images. The difference is that the first and second boundary images are obtained by segmenting the target image according to the first segmentation ratio, while the third and fourth boundary images are obtained by segmenting the target image according to the second segmentation ratio.
[0171] The second segmentation ratio is the segmentation ratio of the target image when determining the overlap boundary position. The second segmentation ratio should not be too small. If the second segmentation ratio is too small, such as 3 or 4, the estimation method used to determine the overlap boundary position by taking the coordinates of the corresponding midpoint of the sub-image in the target image as the overlap boundary position cannot accurately determine the overlap boundary in the sub-image. Therefore, the final estimated overlap boundary position will differ significantly from the actual position.
[0172] 404. Based on the position sorting information, extract the target boundary sub-image from the third boundary image and the fourth boundary image.
[0173] The specific process for extracting the target boundary sub-image can be found in step 302, and will not be elaborated further.
[0174] 405. Compare the target boundary sub-image with each of the reference sub-images to obtain the overlapping boundary position of the target image in the reference image.
[0175] In some embodiments, the boundary sub-image can be compared with each reference sub-image to calculate image similarity, and then the overlapping boundary position can be determined based on the image similarity. (Reference) Figure 7 At this point, comparing the boundary sub-image in the comparison sub-image with each of the reference sub-images to obtain the overlapping boundary position of the target image in the reference image includes:
[0176] 501. Compare the boundary sub-image in the comparison sub-image with each of the reference sub-images to obtain the image similarity between the boundary sub-image and each of the reference sub-images.
[0177] refer to Figure 3 The image overlap rate detection device can calculate the similarity between A1 and B1-B7, and between A7 and B1-B7, to obtain the image similarity between the boundary sub-image and each reference sub-image. Alternatively, as in step 302, after extracting the target boundary sub-image, the target boundary sub-image can be compared with each reference sub-image to obtain the image similarity. Specifically, the image overlap rate detection device can compare the similarity of all pixels in the sub-image, or perform similarity calculation based on feature points in the sub-image.
[0178] To reduce the computational cost of similarity calculation, histogram similarity can be used to determine the similarity of each image. The step of comparing the boundary sub-images in the comparison sub-images with each of the reference sub-images to obtain the image similarity between the boundary sub-images and each of the reference sub-images includes:
[0179] (2.1.1) Obtain the boundary sub-image in the comparison sub-image.
[0180] (2.1.2) Obtain the target histogram of pixel values in the boundary sub-image and the reference histogram of pixel values in each reference sub-image.
[0181] A target histogram is a cumulative histogram of pixel values in a boundary subimage, used to characterize the distribution of pixel values in the boundary subimage. A certain number of bins are used to specify the range representing the pixel values; each bin represents the number of pixels falling within that bin's range.
[0182] The reference histogram is the cumulative histogram of pixel values in each reference sub-image. For a detailed explanation, please refer to the explanation of the target histogram, which will not be repeated here.
[0183] (2.1.3) Detect the histogram similarity between the target histogram and each of the reference histograms, and use the obtained histogram similarity as the image similarity between the boundary sub-image and each of the reference sub-images.
[0184] Histogram similarity refers to the similarity of pixel value distribution between a target histogram and each reference histogram. Specifically, histogram similarity can be obtained by calculating the histogram distance between the target histogram and each reference histogram. For example, it can be obtained by calculating the Euclidean distance between the target histogram and each reference histogram. First, the feature vectors of each histogram are extracted, and after normalizing the feature vectors, the calculated Euclidean distance can be used as the histogram similarity. Alternatively, histogram similarity can also be obtained by calculating the cosine distance between the target histogram and each reference histogram; the specific process is similar to calculating the Euclidean distance and will not be elaborated further.
[0185] 502. Extract the target boundary sub-image with the highest image similarity from each of the reference sub-images.
[0186] The target boundary sub-image refers to a sub-image within each reference sub-image that contains the same image information as the boundary sub-image. Reference Figure 3 If the similarity between A1 and B1-B7 is a1-a7 respectively, and the similarity between A7 and B1-B7 is b1-b7 respectively, where a3 is the largest among a1-a7 and b1-b7, then the reference sub-image B3 corresponding to a3 is the target boundary sub-image.
[0187] 503. Obtain the positional sorting information between the target image and the reference image.
[0188] 504. Based on the position sorting information and the target boundary sub-image, determine the overlapping boundary position of the target image in the reference image.
[0189] Specifically, the start and end positions of the overlap can be obtained based on the position sorting information and the target boundary sub-image, respectively, to determine the overlap boundary position. At this time, determining the overlap boundary position of the target image in the reference image based on the position sorting information and the target boundary sub-image includes:
[0190] (5.1) Determine the overlapping start position in the reference image based on the position sorting information.
[0191] The overlap start position can refer to the location of the complete boundary of the image contained within the overlapping area of the reference image. For example, refer to... Figure 3 If the overlapping regions in the reference image are B1, B2, and B3, then the starting position of the overlap can be the position of image boundary j1. If the overlapping regions in the reference image are B5, B6, and B7, then the starting position of the overlap can be the position of image boundary j3.
[0192] (5.2) Obtain the target position corresponding to the target boundary sub-image in the reference image, and determine the overlap end position in the reference image based on the target position.
[0193] The overlap end position refers to the boundary position in the overlap region relative to the overlap start position. (Continue to refer to...) Figure 3 If the overlapping regions in the reference image are B1, B2, and B3, the starting position of the overlap can be the position of image boundary j1, and the ending position of the overlap can be the position of the right sub-image boundary of B3 in the reference image. If the overlapping regions in the reference image are B5, B6, and B7, the starting position of the overlap can be the position of image boundary j3, and the ending position of the overlap can be the position of the left sub-image boundary of B5 in the reference image.
[0194] (5.3) Set the overlap start position and the overlap end position as overlap limit positions.
[0195] The following describes a process for detecting image overlap:
[0196] 1. After obtaining the current image captured by the image acquisition device, read the previously captured reference image from the cached data.
[0197] 2. Adjust the image size of the current image to obtain a preprocessed image with the same image size as the reference image.
[0198] 3. Convert the preprocessed image into a grayscale image, calculate the Laplacian operator value of each pixel in the grayscale image, and calculate the variance of the Laplacian operator values in the grayscale image based on each Laplacian operator value.
[0199] 4. If the calculated variance is greater than the preset variance threshold, the preprocessed image is set as the target image, and the target image and the reference image are divided into two equal parts to obtain a first boundary image and a second boundary image containing the left and right image boundaries of the target image, respectively, and a third boundary image and a fourth boundary image containing the left and right image boundaries of the reference image, respectively.
[0200] 5. Compare the first boundary image and the fourth boundary image to obtain the first boundary similarity; compare the second boundary image and the third boundary image to obtain the second boundary similarity.
[0201] 6. Divide the target image and the reference image into 5 equal parts to obtain comparison sub-images C1-C5 and reference sub-images D1-D5, where C1 and C5 contain the left and right image boundaries of the target image, respectively, and D1 and D5 contain the left and right image boundaries of the reference image, respectively.
[0202] 7. If the similarity of the first boundary is greater than that of the second boundary, then C1 is compared with D1-D5 respectively to obtain the similarity of each image.
[0203] 8. From D1-D5, extract the target boundary sub-image with the highest image similarity, for example, D4. Obtain the image boundary position of D4 in the reference image. In the image coordinate system constructed with the lower left corner of the reference image as the zero point, the image width as the positive X-axis direction, and the image height as the positive Y-axis direction, if the coordinates of the upper right corner of the reference image are (5,5), and the coordinate range of D4 is (3,0)-(4,4), then the midpoint coordinates of D4, i.e., (3.5,2), can be used as the image boundary position. Alternatively, only the X-axis coordinates of the midpoint of the target boundary sub-image, i.e., 3.5, can be used as the image boundary position.
[0204] 9. Since the similarity of the first boundary is greater than that of the second boundary, and D4 is the target boundary sub-image, it indicates that the region corresponding to D4 in the reference image and the region to the right of D4 are overlapping regions. The overlapping boundary positions are the left sub-image boundary of D4 and the right sub-image boundary of D5, respectively, located in the reference image. Therefore, in this coordinate system, the area of the overlapping region is (5-3.5)*4, which is 6.
[0205] 10. Calculate the area of the reference image in this coordinate system, and get 25.
[0206] 11. Divide the area of the overlapping region by the area of the reference image to obtain the image overlap rate. In this example, the image overlap rate is 24%.
[0207] After obtaining the image overlap rate, the image overlap rate detection device can issue specific prompts based on the image overlap rate. For example, if the image overlap rate is lower than a preset first overlap rate threshold, or higher than a preset second overlap rate threshold, stitching the target image with the reference image, or stitching the current image with the reference image, will reduce the image quality of the stitched image. Therefore, the image overlap rate detection device can issue a warning message to remind the user that the image overlap rate is too high or too low.
[0208] To better implement the image overlap rate detection method in the embodiments of this application, based on the image overlap rate detection method, the embodiments of this application also provide an image overlap rate detection device, such as... Figure 8 The diagram shown is a schematic representation of an embodiment of the image overlap detection device 500 in this application. The image overlap detection device 500 includes:
[0209] Acquisition unit 501 is used to acquire the target image and the reference image;
[0210] The segmentation unit 502 is used to segment the target image and the reference image respectively to obtain a comparison sub-image and a reference sub-image;
[0211] The comparison unit 503 is used to determine the overlapping boundary position of the target image in the reference image based on the boundary sub-image in the comparison sub-image and each of the reference sub-images;
[0212] The determining unit 504 is used to determine the image overlap rate between the target image and the reference image based on the overlap boundary position.
[0213] In one possible implementation, the comparison unit 503 is further used for:
[0214] The boundary sub-images in the comparison sub-images are compared with each of the reference sub-images to determine the positional order information between the target image and the reference images;
[0215] Based on the position sorting information, extract the target boundary sub-image from the boundary sub-image;
[0216] Based on the target boundary sub-image and each of the reference sub-images, the overlapping boundary position of the target image in the reference image is determined.
[0217] In one possible implementation, the comparison unit 503 is further used for:
[0218] Obtain the boundary sub-image in the comparison sub-image and the reference boundary sub-image in the reference sub-image;
[0219] Each of the boundary sub-images is compared with each of the reference boundary sub-images to obtain the boundary similarity.
[0220] Obtain the boundary position information of each of the boundary sub-images in the target image;
[0221] Based on the boundary location information and the boundary similarity, the positional order information between the target image and the reference image is determined.
[0222] In one possible implementation, the comparison unit 503 is further used for:
[0223] Obtain a first boundary image and a second boundary image from the boundary sub-image, wherein the first boundary image and the second boundary image are obtained according to a preset first segmentation ratio;
[0224] By comparing the first boundary image and the second boundary image, the positional ordering information between the target image and the reference image is obtained;
[0225] Obtain the third boundary image and the fourth boundary image from the boundary sub-image, wherein the third boundary image and the fourth boundary image are obtained according to a preset second segmentation ratio, and the second segmentation ratio is greater than the first segmentation ratio;
[0226] Based on the position sorting information, target boundary sub-images are extracted from the third boundary image and the fourth boundary image.
[0227] In one possible implementation, the comparison unit 503 is further used for:
[0228] The boundary sub-image in the comparison sub-image is compared with each of the reference sub-images to obtain the image similarity between the boundary sub-image and each of the reference sub-images;
[0229] From each of the reference sub-images, extract the target boundary sub-image with the highest image similarity;
[0230] Obtain the positional sorting information between the target image and the reference image;
[0231] Based on the position sorting information and the target boundary sub-image, the overlapping boundary position of the target image in the reference image is determined.
[0232] In one possible implementation, the comparison unit 503 is further used for:
[0233] Obtain the boundary sub-image in the comparison sub-image;
[0234] Obtain the target histogram of pixel values in the boundary sub-image, and the reference histogram of pixel values in each of the reference sub-images;
[0235] The histogram similarity between the target histogram and each of the reference histograms is detected, and the histogram similarity is used as the image similarity between the boundary sub-image and each of the reference sub-images.
[0236] In one possible implementation, the comparison unit 503 is further used for:
[0237] Based on the position sorting information, determine the overlapping start position in the reference image;
[0238] Obtain the target position corresponding to the target boundary sub-image in the reference image, and determine the overlap end position in the reference image based on the target position;
[0239] The overlap start position and the overlap end position are set as overlap limit positions.
[0240] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0241] Since this image overlap detection device can perform the functions described in this application, Figures 1 to 6 Corresponding to the steps in the image overlap rate detection method in any embodiment, the present application can be implemented as described above. Figures 1 to 6 For details on the beneficial effects that the image overlap rate detection method can achieve in any embodiment, please refer to the preceding description, which will not be repeated here.
[0242] Furthermore, to better implement the image overlap rate detection method in the embodiments of this application, based on the image overlap rate detection method, the embodiments of this application also provide an image overlap rate detection device, see below. Figure 8 , Figure 8 This illustration shows a schematic diagram of an image overlap rate detection device according to an embodiment of this application. Specifically, the image overlap rate detection device provided in this embodiment includes a processor 601. The processor 601 is used to execute a computer program stored in a memory 602 to implement, for example... Figures 1 to 6 Corresponding to each step of the image overlap rate detection method in any embodiment; or, when the processor 601 executes the computer program stored in the memory 602, it implements as follows: Figure 8The functions of each unit in the corresponding embodiment.
[0243] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 602 and executed by processor 601 to complete the embodiments of this application. One or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in a computer device.
[0244] The image overlap rate detection device may include, but is not limited to, processor 601 and memory 602. Those skilled in the art will understand that the illustration is merely an example of an image overlap rate detection device and does not constitute a limitation on the device. It may include more or fewer components than illustrated, or combine certain components, or different components, such as electronic devices. It may also include input / output devices, network access devices, buses, etc., with processor 601, memory 602, input / output devices, and network access devices connected via a bus.
[0245] The processor 601 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the image overlap detection device, connecting all parts of the device via various interfaces and routes.
[0246] The memory 602 can be used to store computer programs and / or modules. The processor 601 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 602 and by calling data stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the image overlap detection device (such as audio data, video data, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0247] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the image overlap rate detection device, image overlap rate detection equipment, and its corresponding units described above can be found in the following reference: Figures 1 to 6 The description of the image overlap rate detection method corresponding to any embodiment will not be repeated here.
[0248] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer storage medium and loaded and executed by a processor.
[0249] Therefore, embodiments of this application provide a computer storage medium storing multiple instructions that can be loaded by a processor to execute the present application. Figures 1 to 6 For the steps in the image overlap rate detection method corresponding to any embodiment, the specific operation can be referred to as follows: Figures 1 to 6 The description of the image overlap rate detection method corresponding to any embodiment will not be repeated here.
[0250] The computer storage medium may include: read-only memory (ROM), random access memory (RAM), hard disk or optical disk, etc.
[0251] Because of the instructions stored in the computer's storage medium, this application can be executed. Figures 1 to 6 Corresponding to the steps in the image overlap rate detection method in any embodiment, the present application can be implemented as described above. Figures 1 to 6For details on the beneficial effects that the image overlap rate detection method can achieve in any embodiment, please refer to the preceding description, which will not be repeated here.
[0252] The foregoing has provided a detailed description of an image overlap rate detection method, apparatus, device, and computer storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting image overlap rate, characterized in that, The method includes: Acquire the target image and the reference image; The target image and the reference image are segmented separately to obtain a comparison sub-image and a reference sub-image; Determining the overlapping boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images includes: obtaining a first boundary image and a second boundary image in the boundary sub-images, wherein the first boundary image and the second boundary image are obtained according to a preset first segmentation ratio; By comparing the first boundary image and the second boundary image, the positional ordering information between the target image and the reference image is obtained; Obtain the third boundary image and the fourth boundary image from the boundary sub-image, wherein the third boundary image and the fourth boundary image are obtained according to a preset second segmentation ratio, and the second segmentation ratio is greater than the first segmentation ratio; Based on the position sorting information, target boundary sub-images are extracted from the third boundary image and the fourth boundary image; Based on the target boundary sub-image and each of the reference sub-images, determine the overlapping boundary position of the target image in the reference image; The image overlap rate between the target image and the reference image is determined based on the overlap boundary position.
2. The image overlap rate detection method according to claim 1, characterized in that, The step of obtaining the positional sorting information between the target image and the reference image includes: Obtain the boundary sub-image in the comparison sub-image and the reference boundary sub-image in the reference sub-image; Each of the boundary sub-images is compared with each of the reference boundary sub-images to obtain the boundary similarity. Obtain the boundary position information of each of the boundary sub-images in the target image; Based on the boundary location information and the boundary similarity, the positional order information between the target image and the reference image is determined.
3. The image overlap rate detection method according to claim 1, characterized in that, Determining the overlap boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images includes: The boundary sub-image in the comparison sub-image is compared with each of the reference sub-images. After obtaining the image similarity between the boundary sub-image and each of the reference sub-images, the target boundary sub-image with the highest image similarity is extracted from each of the reference sub-images. Obtain the positional sorting information between the target image and the reference image; Based on the position sorting information and the target boundary sub-image, the overlapping boundary position of the target image in the reference image is determined.
4. The image overlap rate detection method according to claim 3, characterized in that, The step of comparing the boundary sub-images in the comparison sub-images with each of the reference sub-images, and obtaining the image similarity between the boundary sub-images and each of the reference sub-images, includes: Obtain the boundary sub-image in the comparison sub-image; Obtain the target histogram of pixel values in the boundary sub-image, and the reference histogram of pixel values in each of the reference sub-images; The histogram similarity between the target histogram and each of the reference histograms is detected, and the histogram similarity is used as the image similarity between the boundary sub-image and each of the reference sub-images.
5. The image overlap rate detection method according to claim 3, characterized in that, Determining the overlapping boundary position of the target image in the reference image based on the position sorting information and the target boundary sub-image includes: Based on the position sorting information, determine the overlapping start position in the reference image; Obtain the target position corresponding to the target boundary sub-image in the reference image, and determine the overlap end position in the reference image based on the target position; The overlap start position and the overlap end position are set as overlap limit positions.
6. An image overlap rate detection device, characterized in that, include: The acquisition unit is used to acquire the target image and the reference image; A segmentation unit is used to segment the target image and the reference image respectively to obtain a comparison sub-image and a reference sub-image; A comparison unit is configured to determine the overlap boundary position of the target image in the reference image based on the boundary sub-images in the comparison sub-images and each of the reference sub-images, including: acquiring a first boundary image and a second boundary image in the boundary sub-images, wherein the first boundary image and the second boundary image are obtained according to a preset first segmentation ratio; comparing the first boundary image and the second boundary image to obtain positional sorting information between the target image and the reference image; acquiring a third boundary image and a fourth boundary image in the boundary sub-images, wherein the third boundary image and the fourth boundary image are obtained according to a preset second segmentation ratio, the second segmentation ratio being greater than the first segmentation ratio; extracting a target boundary sub-image from the third boundary image and the fourth boundary image according to the positional sorting information; and determining the overlap boundary position of the target image in the reference image based on the target boundary sub-image and each of the reference sub-images. The determining unit is configured to determine the image overlap rate between the target image and the reference image based on the overlap boundary position.
7. An image overlap rate detection device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the image overlap rate detection method as described in any one of claims 1 to 5 when it invokes the computer program in the memory.
8. A computer storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps in the image overlap rate detection method according to any one of claims 1 to 5.