Monitoring positioning method and device
By sliding the window on the monitoring image to obtain a collection of feature points and matching its coordinates to determine the monitoring position, the problem of low monitoring positioning accuracy is solved and the accuracy of monitoring positioning is improved.
Patent Information
- Application Number
- CN202411434184.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, when there are no markers or the marker characteristics are not obvious in the monitoring image, the problem of low monitoring positioning accuracy will be caused.
By acquiring the monitoring image in the target area, the sliding window is controlled to slide on the monitoring image according to the preset step size to obtain multiple feature points sets; determine the target feature points common to multiple feature points sets; determine the grayscale value of the target feature points, and use the grayscale value of the target feature points and the result of the product of the Gaussian core as the coordinates of the target feature points; match the coordinates of the target feature points and the coordinates of the feature points in the environmental map corresponding to the target area to determine the monitoring position corresponding to the monitoring image.
The accuracy of monitoring positioning is improved, and the problem of low positioning accuracy when the monitoring image has no markers or the marker characteristics are not obvious.
Smart Images

Figure CN119540344A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of monitoring technology, and in particular to a monitoring positioning method and device. Background Art
[0002] When automatically analyzing surveillance images, it is often necessary to determine the location of the surveillance image in the surveillance area, which is surveillance positioning. The commonly used method is to achieve surveillance positioning by matching the surveillance image with the markers in the map pre-established for the surveillance area. This method relies on markers with obvious features. If there are no markers or the marker features are not obvious, surveillance positioning is prone to errors. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a monitoring positioning method, device, electronic device and computer-readable storage medium to solve the problem in the prior art that when the monitoring image has no markers or the marker features are not obvious, the monitoring positioning accuracy is low.
[0004] According to a first aspect of an embodiment of the present application, a monitoring and positioning method is provided, including: obtaining a monitoring image within a target area, controlling a sliding window to slide on the monitoring image according to a preset step size to obtain multiple feature point sets; determining a target feature point common to the multiple feature point sets; determining a grayscale value of the target feature point, and taking the result of the product of the grayscale value of the target feature point and a Gaussian kernel as the coordinates of the target feature point; matching the coordinates of the target feature point with the coordinates of the feature point in an environment map corresponding to the target area to determine a monitoring position corresponding to the monitoring image.
[0005] According to a second aspect of an embodiment of the present application, a monitoring and positioning device is provided, including: an acquisition module, configured to acquire a monitoring image within a target area, and control a sliding window to slide on the monitoring image according to a preset step size to obtain multiple feature point sets; a first determination module, configured to determine a target feature point common to multiple feature point sets; a second determination module, configured to determine a grayscale value of the target feature point, and use the result of the product of the grayscale value of the target feature point and a Gaussian kernel as the coordinate of the target feature point; and a matching module, configured to match the coordinates of the target feature point with the coordinates of the feature point in an environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: obtaining a monitoring image within the target area, controlling the sliding window to slide on the monitoring image according to a preset step length to obtain multiple feature point sets; determining the target feature points common to the multiple feature point sets; determining the grayscale value of the target feature point, and taking the result of the grayscale value of the target feature point and the Gaussian kernel product as the coordinates of the target feature point; matching the coordinates of the target feature point with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image. The above technical means can solve the problem in the prior art that when the monitoring image has no markers or the marker features are not obvious, the monitoring positioning accuracy is low, thereby improving the monitoring positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 It is a flowchart of a monitoring and positioning method provided in an embodiment of the present application;
[0011] Figure 2 is a flow chart of a method for determining depth of field coordinates provided in an embodiment of the present application;
[0012] Figure 3 It is a structural schematic diagram of a monitoring and positioning device provided in an embodiment of the present application;
[0013] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0015] A monitoring and positioning method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0016] Figure 1 It is a flow chart of a monitoring and positioning method provided in an embodiment of the present application. Figure 1 The monitoring and positioning method can be executed by a computer or a server, or software on the computer or the server. Figure 1 As shown, the monitoring and positioning method includes:
[0017] S101, obtaining a monitoring image within a target area, and controlling a sliding window to slide on the monitoring image according to a preset step length to obtain a plurality of feature point sets;
[0018] S102, determining a target feature point common to multiple feature point sets;
[0019] S103, determining the gray value of the target feature point, and taking the product of the gray value of the target feature point and the Gaussian kernel as the coordinates of the target feature point;
[0020] S104, matching the coordinates of the target feature point with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image.
[0021] In order to facilitate the sliding window to slide on the monitoring image to obtain appropriate feature points, the size of the preset step size can be set to be related to the size of the sliding window. For example, the sliding window is n*n in size, n is the number of pixels, and the preset step size is n / 2. Each feature point set includes multiple feature points. A feature point is a target in the monitoring image, and a feature point is composed of multiple pixels. By calculating the intersection of multiple feature point sets, the feature points shared by multiple feature point sets are determined and recorded as target feature points. There can be one or more target feature points. Determine the grayscale value of the target feature point, and use the result of the product of the grayscale value of the target feature point and the Gaussian kernel as the coordinates of the target feature point.
[0022] It should be noted that the Gaussian kernel used in this application is a Gaussian kernel specially improved in this application, and the improvement method is shown below; because there are only gray values in the length and width directions of the image, the coordinates of the target feature points in the embodiment of this application are two-dimensional. The environment map corresponding to the target area is obtained by mapping the target area in advance. The environment map contains the coordinates of all objects in the target area (objects in the actual environment, that is, feature points in the environment map). It should be noted that the coordinates of the feature points in the environment map can be two-dimensional or three-dimensional, which does not affect the coordinates of the target feature points and the coordinates of the feature points in the environment map corresponding to the target area. Matching. If the coordinates of the feature points in the environment map are two-dimensional, then directly match the coordinates of the target feature points and the coordinates of the feature points in the environment map corresponding to the target area. If the coordinates of the feature points in the environment map are three-dimensional, such as the coordinates of the target feature points are (x, y), and the coordinates of the feature points in the environment map are (x, y, z), then match the x and y in the coordinates of the target feature points and the coordinates of the feature points in the environment map corresponding to the target area.
[0023] According to the technical solution provided in the embodiment of the present application, a monitoring image within the target area is obtained, and a sliding window is controlled to slide on the monitoring image according to a preset step length to obtain multiple feature point sets; the target feature points common to the multiple feature point sets are determined; the grayscale value of the target feature point is determined, and the result of the grayscale value of the target feature point and the Gaussian kernel product is used as the coordinates of the target feature point; the coordinates of the target feature point are matched with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image. The above technical means can solve the problem in the prior art that when the monitoring image has no markers or the marker features are not obvious, the monitoring positioning accuracy is low, thereby improving the monitoring positioning accuracy.
[0024] Furthermore, the grayscale value of the target feature point is determined, including: converting the monitoring image into a grayscale image; establishing a coordinate system on the grayscale image with the first pixel in the upper left corner of the grayscale image as the coordinate origin, with the right as the positive horizontal axis and the downward as the positive vertical axis; determining the target pixels on the four vertices of the target feature point, and calculating the sum of the grayscale values of all pixels in the rectangular area formed by each target pixel to the coordinate origin; and determining the grayscale value of the target feature point based on the sum of the grayscale values corresponding to the four target pixels.
[0025] Surveillance images are usually in color and need to be converted into grayscale images. Take the first pixel in the upper left direction of the grayscale image as the coordinate origin, and establish a rectangular coordinate system with the right direction of the coordinate origin as the positive horizontal axis and the downward direction of the coordinate origin as the positive vertical axis. Determine the target pixels on the four vertices of the target feature point (a feature point in the surveillance image is the area of the rectangular frame, so the target feature point is a rectangle). Each target pixel and the coordinate origin as the diagonal vertex can form a rectangular area, calculate the sum of the grayscale values of all pixels in the rectangular area, and then determine the sum of the grayscale values corresponding to each target pixel. Starting from the upper left direction of the target feature point, in a clockwise direction, the sum of the grayscale values corresponding to the four target pixels is recorded as A, B, C, and D respectively. The grayscale value of the target feature point is E, then E = AB-C+D.
[0026] Furthermore, before taking the result of multiplying the gray value of the target feature point and the Gaussian kernel as the coordinate of the target feature point, the method further includes: determining the selection standard deviation σ of the Gaussian kernel according to the following formula:
[0027]
[0028] n<=L
[0029] n=9+8×3 m-1
[0030] m=[1,∞].
[0031] The selection standard deviation is the width of the Gaussian kernel, which is related to the blurring effect of the Gaussian kernel. The improvement of the Gaussian kernel in the embodiment of the present application is reflected in the selection of the selection standard deviation.
[0032] Multiplying the grayscale value of the target feature point by the improved Gaussian kernel means filtering the grayscale value of the target feature point with the improved Gaussian kernel.
[0033] Furthermore, before matching the coordinates of the target feature points with the coordinates of the feature points in the environment map to determine the monitoring position corresponding to the monitoring image, the method also includes: executing the following loop algorithm to construct the environment map: controlling the mapping robot to explore the target area and capture a mapping image; matching the feature points in the mapping image and the previous mapping image of the mapping image through a feature matching algorithm to obtain a matching result corresponding to the mapping image; obtaining the posture information of the mapping robot when capturing the mapping image and the previous mapping image of the mapping image; calculating the coordinates of the feature points in the matching result corresponding to the mapping image through a triangulation algorithm according to the matching result and posture information corresponding to the mapping image; optimizing the environment map according to the coordinates of the feature points in the matching result corresponding to the mapping image; continuing to control the mapping robot to explore the target area and capture the next mapping image of the mapping image until the mapping robot has completed exploring the target area and exits the loop algorithm.
[0034] By controlling the mapping robot to explore the target area and take mapping images, a set of mapping images in a certain order can be obtained. A mapping image is required as a reference to construct or optimize the environment map, so at least two mapping images are required each time. Take the first mapping image and the second mapping image as an example: the feature points in the second mapping image and the first mapping image are matched by a feature matching algorithm to obtain the matching result corresponding to the second mapping image. The matching result includes the coordinates of the same feature point in the second mapping image and the first mapping image on the second mapping image and the first mapping image. For example, the coordinates of a feature point on the second mapping image are calculated based on the gray value of the feature point in the second mapping image, and the result of the product of the gray value and the Gaussian kernel is used as the coordinates of the feature point. Feature matching algorithms include Brute-Force Matcher, FLANN Matcher, etc. The pose information of the mapping robot when taking the second mapping image and the first mapping image is regarded as the pose information corresponding to the second mapping image. According to the matching results and pose information, the coordinates of the feature points in the actual environment are calculated by triangulation algorithm, which is an existing method and will not be repeated here. The coordinates of the feature point are added to the environment map. The initial environment map is empty. The mapping robot explores the target area until the mapping robot has explored the target area, and then the final environment map is obtained.
[0035] Figure 2 is a flow chart of a method for determining depth of field coordinates provided in an embodiment of the present application, such as Figure 2 As shown:
[0036] S201, when two cameras each acquire a surveillance image of the same location, one surveillance image is used as a target image and the other surveillance image is used as a candidate image:
[0037] S202, determining target feature points common to the target image and the candidate images;
[0038] S203, determining the grayscale value of the target feature point on the target image, and using the product of the grayscale value and the Gaussian kernel as the horizontal coordinate and the vertical coordinate of the target feature point in the target image;
[0039] S204, determining the gray value of the target feature point on the candidate image, and using the product of the gray value and the Gaussian kernel as the horizontal coordinate and the vertical coordinate of the target feature point in the candidate image;
[0040] S205, calculating the difference between the horizontal coordinates of the target feature points in the target image and the candidate image;
[0041] S206, calculating the depth coordinates of the target feature point according to the difference;
[0042] The coordinates of the target feature point include the depth coordinate and the horizontal coordinate and the vertical coordinate of the target feature point in the target image.
[0043] The embodiment of the present application is to determine the depth coordinates of the target feature point. The coordinates of the target feature point are three-dimensional, so the coordinates of the target feature point can be directly matched with the coordinates of the feature point in the environment map corresponding to the target area. Two cameras arranged at different positions each obtain a surveillance image of the same position, and one surveillance image is used as the target image and the other surveillance image is used as the candidate image. The horizontal coordinates of the target feature points in the target image and the candidate image are determined, the difference between the two horizontal coordinates is calculated, and the depth coordinates of the target feature points are calculated based on the difference.
[0044] Furthermore, the depth coordinates of the target feature point are calculated based on the difference, including: obtaining the distance between the two cameras and the focal lengths of the two cameras; and calculating the depth coordinates based on the distance, the focal length and the difference.
[0045] Specifically, the distance is multiplied by the focal length and divided by the difference value, which is used as the depth coordinate.
[0046] Furthermore, the coordinates of the target feature point and the coordinates of the feature point in the environment map corresponding to the target area are matched to determine the monitoring position corresponding to the monitoring image, including: matching the feature point corresponding to the target feature point in the environment map based on the coordinates of the target feature point and the coordinates of the feature point in the environment map corresponding to the target area; and using the position of the feature point corresponding to the target feature point in the environment map as the monitoring position corresponding to the monitoring image.
[0047] The coordinates of the feature point in the environment map that are the same as the coordinates of the target feature point are used as the feature point corresponding to the target feature point in the environment map. The monitoring position corresponding to the monitoring image can be obtained by referring to the position of the feature point corresponding to the target feature point in the environment map.
[0048] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0049] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0050] Figure 3 Schematic diagram of a monitoring and positioning device provided in an embodiment of the present application. Figure 3 As shown, the monitoring and positioning device includes:
[0051] The acquisition module 301 is configured as an acquisition module, configured to acquire a monitoring image in a target area, and control a sliding window to slide on the monitoring image according to a preset step length to acquire a plurality of feature point sets;
[0052] A first determining module 302 is configured to determine a target feature point common to a plurality of feature point sets;
[0053] The second determination module 303 is configured to determine the gray value of the target feature point, and use the result of the product of the gray value of the target feature point and the Gaussian kernel as the coordinate of the target feature point;
[0054] The matching module 304 is configured to match the coordinates of the target feature point with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image.
[0055] According to the technical solution provided in the embodiment of the present application, a monitoring image within the target area is obtained, and a sliding window is controlled to slide on the monitoring image according to a preset step length to obtain multiple feature point sets; the target feature points common to the multiple feature point sets are determined; the grayscale value of the target feature point is determined, and the result of the grayscale value of the target feature point and the Gaussian kernel product is used as the coordinates of the target feature point; the coordinates of the target feature point are matched with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image. The above technical means can solve the problem in the prior art that when the monitoring image has no markers or the marker features are not obvious, the monitoring positioning accuracy is low, thereby improving the monitoring positioning accuracy.
[0056] In some embodiments, the second determination module 303 is also configured to convert the monitoring image into a grayscale image; on the grayscale image, a coordinate system is established with the first pixel in the upper left corner of the grayscale image as the coordinate origin, with the right as the positive horizontal axis and the downward as the positive vertical axis; the target pixels on the four vertices of the target feature point are determined, and the sum of the grayscale values of all pixels in the rectangular area formed by each target pixel to the coordinate origin is calculated; the grayscale value of the target feature point is determined based on the sum of the grayscale values corresponding to the four target pixels.
[0057] Surveillance images are usually in color and need to be converted into grayscale images. Take the first pixel in the upper left direction of the grayscale image as the coordinate origin, and establish a rectangular coordinate system with the right direction of the coordinate origin as the positive horizontal axis and the downward direction of the coordinate origin as the positive vertical axis. Determine the target pixels on the four vertices of the target feature point (a feature point in the surveillance image is the area of the rectangular frame, so the target feature point is a rectangle). Each target pixel and the coordinate origin as the diagonal vertex can form a rectangular area, calculate the sum of the grayscale values of all pixels in the rectangular area, and then determine the sum of the grayscale values corresponding to each target pixel. Starting from the upper left direction of the target feature point, in a clockwise direction, the sum of the grayscale values corresponding to the four target pixels is recorded as A, B, C, and D respectively. The grayscale value of the target feature point is E, then E = AB-C+D.
[0058] In some embodiments, the second determination module 303 is further configured to determine the selection standard deviation σ of the Gaussian kernel according to the following formula:
[0059]
[0060] n<=L
[0061] n=9+8×3 m-1
[0062] m=[1,∞].
[0063] The selection standard deviation is the width of the Gaussian kernel, which is related to the blurring effect of the Gaussian kernel. The improvement of the Gaussian kernel in the embodiment of the present application is reflected in the selection of the selection standard deviation.
[0064] Multiplying the grayscale value of the target feature point by the improved Gaussian kernel means filtering the grayscale value of the target feature point with the improved Gaussian kernel.
[0065] In some embodiments, the matching module 304 is further configured to execute the following loop algorithm to construct an environmental map: control the mapping robot to explore the target area and capture a mapping image; match the feature points in the mapping image and the previous mapping image of the mapping image through a feature matching algorithm to obtain a matching result corresponding to the mapping image; obtain the posture information of the mapping robot when capturing the mapping image and the previous mapping image of the mapping image; calculate the coordinates of the feature points in the matching result corresponding to the mapping image through a triangulation algorithm according to the matching result and posture information corresponding to the mapping image; optimize the environmental map according to the coordinates of the feature points in the matching result corresponding to the mapping image; continue to control the mapping robot to explore the target area and capture the next mapping image of the mapping image until the mapping robot has completed exploring the target area and exits the loop algorithm.
[0066] By controlling the mapping robot to explore the target area and take mapping images, a set of mapping images in a certain order can be obtained. A mapping image is required as a reference to construct or optimize the environment map, so at least two mapping images are required each time. Take the first mapping image and the second mapping image as an example: the feature points in the second mapping image and the first mapping image are matched by a feature matching algorithm to obtain the matching result corresponding to the second mapping image. The matching result includes the coordinates of the same feature point in the second mapping image and the first mapping image on the second mapping image and the first mapping image. For example, the coordinates of a feature point on the second mapping image are calculated based on the gray value of the feature point in the second mapping image, and the result of the product of the gray value and the Gaussian kernel is used as the coordinates of the feature point. Feature matching algorithms include Brute-Force Matcher, FLANN Matcher, etc. The pose information of the mapping robot when taking the second mapping image and the first mapping image is regarded as the pose information corresponding to the second mapping image. According to the matching results and pose information, the coordinates of the feature points in the actual environment are calculated by triangulation algorithm, which is an existing method and will not be repeated here. The coordinates of the feature point are added to the environment map. The initial environment map is empty. The mapping robot explores the target area until the mapping robot has explored the target area, and then the final environment map is obtained.
[0067] In some embodiments, the second determination module 303 is also configured to, when two cameras each acquire a surveillance image of the same location, use one surveillance image as the target image and the other surveillance image as the candidate image: determine the target feature points common to the target image and the candidate image; determine the grayscale value of the target feature point on the target image, and use the result of multiplying the grayscale value by a Gaussian kernel as the horizontal and vertical coordinates of the target feature point in the target image; determine the grayscale value of the target feature point on the candidate image, and use the result of multiplying the grayscale value by a Gaussian kernel as the horizontal and vertical coordinates of the target feature point in the candidate image; calculate the difference between the horizontal coordinates of the target feature point in the target image and the candidate image; calculate the depth of field coordinates of the target feature point based on the difference; wherein the coordinates of the target feature point include the depth of field coordinates and the horizontal and vertical coordinates of the target feature point in the target image.
[0068] The embodiment of the present application is to determine the depth coordinates of the target feature point. The coordinates of the target feature point are three-dimensional, so the coordinates of the target feature point can be directly matched with the coordinates of the feature point in the environment map corresponding to the target area. Two cameras arranged at different positions each obtain a surveillance image of the same position, and one surveillance image is used as the target image and the other surveillance image is used as the candidate image. The horizontal coordinates of the target feature points in the target image and the candidate image are determined, the difference between the two horizontal coordinates is calculated, and the depth coordinates of the target feature points are calculated based on the difference.
[0069] In some embodiments, the second determination module 303 is further configured to obtain the distance between the two cameras and the focal lengths of the two cameras; and calculate the depth coordinates according to the distance, the focal length and the difference.
[0070] Specifically, the distance is multiplied by the focal length and divided by the difference value, which is used as the depth coordinate.
[0071] In some embodiments, the matching module 304 is also configured to match the feature points corresponding to the target feature points in the environmental map based on the coordinates of the target feature points and the coordinates of the feature points in the environmental map corresponding to the target area; and use the position of the feature point corresponding to the target feature point in the environmental map as the monitoring position corresponding to the monitoring image.
[0072] The coordinates of the feature point in the environment map that are the same as the coordinates of the target feature point are used as the feature point corresponding to the target feature point in the environment map. The monitoring position corresponding to the monitoring image can be obtained by referring to the position of the feature point corresponding to the target feature point in the environment map.
[0073] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0074] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0075] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.
[0076] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0077] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.
[0078] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0079] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0080] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A monitoring and positioning method, characterized in that: include: Acquire a monitoring image within the target area, and control a sliding window to slide on the monitoring image according to a preset step length to obtain a plurality of feature point sets; Determine target feature points common to multiple feature point sets; Determine the grayscale value of the target feature point, and use the result of multiplying the grayscale value of the target feature point and the Gaussian kernel as the coordinates of the target feature point; The coordinates of the target feature points are matched with the coordinates of the feature points in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image.
2. The method according to claim 1, characterized in that Determining the grayscale value of the target feature point includes: Converting the monitoring image into a grayscale image; On the grayscale image, a coordinate system is established with the first pixel in the upper left corner of the grayscale image as the coordinate origin, with the right direction as the positive horizontal axis and the downward direction as the positive vertical axis; Determine the target pixels on the four vertices of the target feature point, and calculate the sum of the grayscale values of all pixels in the rectangular area formed by each target pixel to the coordinate origin; The grayscale value of the target feature point is determined based on the sum of the grayscale values corresponding to the four target pixels.
3. The method according to claim 1, characterized in that Before taking the result of the multiplication of the gray value of the target feature point and the Gaussian kernel as the coordinate of the target feature point, the method further includes: The selection standard deviation σ of the Gaussian kernel is determined according to the following formula: n<=L n=9+8×3 m-1 m=[1,∞]。 4. The method according to claim 1, characterized in that: Before matching the coordinates of the target feature point with the coordinates of the feature point in the environment map to determine the monitoring position corresponding to the monitoring image, the method further includes: The following loop algorithm is executed to construct the environment map: Controlling the mapping robot to explore the target area and capture mapping images; Matching the feature points of the mapping image with the feature points of the previous mapping image using a feature matching algorithm to obtain a matching result corresponding to the mapping image; Obtaining the position and posture information of the mapping robot when taking the mapping image and the previous mapping image of the mapping image; According to the matching result and the position information corresponding to the mapping image, the coordinates of the feature points in the matching result corresponding to the mapping image are calculated by a triangulation algorithm; Optimizing the environment map according to the coordinates of the feature points in the matching result corresponding to the mapping image; The mapping robot continues to be controlled to explore the target area and capture the next mapping image of the mapping image until the mapping robot has completed exploring the target area and exits the loop algorithm.
5. The method according to claim 1, characterized in that Before matching the coordinates of the target feature point with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image, the method further includes: When two cameras acquire a surveillance image of the same location, one surveillance image is used as the target image and the other surveillance image is used as the candidate image: Determine target feature points common to the target image and the candidate image; Determine the grayscale value of the target feature point on the target image, and use the product of the grayscale value and the Gaussian kernel as the horizontal coordinate and the vertical coordinate of the target feature point in the target image; Determine the grayscale value of the target feature point on the candidate image, and use the product of the grayscale value and the Gaussian kernel as the horizontal coordinate and the vertical coordinate of the target feature point in the candidate image; Calculating the difference between the horizontal coordinates of the target feature points in the target image and the candidate image; Calculating the depth coordinates of the target feature point according to the difference; The coordinates of the target feature point include the depth of field coordinate and the horizontal coordinate and the vertical coordinate of the target feature point in the target image.
6. The method according to claim 5, characterized in that Calculating the depth coordinates of the target feature point according to the difference includes: Get the distance between the two cameras and the focal lengths of the two cameras; The depth coordinates are calculated based on the distance, the focal length and the difference.
7. The method according to claim 1, characterized in that Matching the coordinates of the target feature point with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image, including: Matching a feature point corresponding to the target feature point in the environment map based on the coordinates of the target feature point and the coordinates of the feature point in the environment map corresponding to the target area; The position of the feature point corresponding to the target feature point in the environment map is used as the monitoring position corresponding to the monitoring image.
8. A monitoring and positioning device, characterized in that: include: An acquisition module is configured to acquire a monitoring image within a target area, and control a sliding window to slide on the monitoring image according to a preset step length to acquire a plurality of feature point sets; A first determining module is configured to determine a target feature point common to a plurality of feature point sets; A second determination module is configured to determine the grayscale value of the target feature point, and use the product of the grayscale value of the target feature point and the Gaussian kernel as the coordinates of the target feature point; The matching module is configured to match the coordinates of the target feature point with the coordinates of the feature point in the environment map corresponding to the target area to determine the monitoring position corresponding to the monitoring image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.