Method and device for determining position, storage medium and electronic device

By acquiring and analyzing the images of the image acquisition device at multiple preset positions, determining the sharpness and corner points, and automatically adjusting the pose, the problem of low automation and low accuracy in pose adjustment of the image acquisition device is solved, and efficient automation is achieved. Posture adjustment.

CN112561992BActive Publication Date: 2024-09-13ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011389840.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-01
Publication Date
2024-09-13
Estimated Expiration
2040-12-01

AI Technical Summary

Technical Problem

The degree of automation and accuracy of position adjustment of image acquisition equipment is low, resulting in large manual installation errors and a waste of manpower.

Method used

By acquiring images of the target image acquisition device at multiple preset positions, the image with the largest sharpness value and the target corner point are determined, and the posture is adjusted according to the distance between the corner points to achieve automatic posture adjustment.

Benefits of technology

The degree of automation and accuracy of pose adjustment of image acquisition equipment is improved, manual intervention is reduced, and installation efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112561992B
    Figure CN112561992B
Patent Text Reader

Abstract

The present invention provides a method and device for determining a position, a storage medium, and an electronic device, including: obtaining a group of images obtained by a target image acquisition device shooting a target image at a group of preset positions; determining the image with the largest clarity value included in the group of images as the target image, and determining the position where the target image is obtained by shooting in the group of preset positions as the first position; adjusting the first position according to the distance between each target corner point included in the target image and the adjacent corner point to obtain the second position. Through the present invention, the problem of low automation and accuracy of the posture adjustment of the image acquisition device is solved, thereby achieving the effect of realizing the automatic adjustment of the posture adjustment of the image acquisition device and improving the accuracy of the posture adjustment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a method and device for determining a position, a storage medium and an electronic device. Background Art

[0002] In recent years, with the development and progress of science and technology, more and more industrial production lines use vision as a means of detection to improve production capacity. As an important part of visual detection, the installation posture of image acquisition equipment has a great influence on the results of visual detection and recognition. Usually, it is installed by manual visual method. Manual installation not only has large errors, but also wastes manpower.

[0003] There is currently no effective solution to the problem of low automation and accuracy in the posture adjustment of image acquisition equipment in related technologies. Summary of the invention

[0004] The embodiments of the present invention provide a method and device for determining a position, a storage medium and an electronic device, so as to at least solve the problem of low automation and accuracy in the posture adjustment of image acquisition equipment in the related art.

[0005] According to one embodiment of the present invention, a method for determining a position is provided, comprising: acquiring a group of images obtained by a target image acquisition device after photographing a target image at a group of preset positions respectively, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line; determining an image with the largest clarity value included in the group of images as the target image, and determining the position where the target image is photographed in the group of preset positions as a first position; adjusting the first position according to the distance between each target corner point included in the target image and an adjacent corner point to obtain a second position, wherein the second position is a position for installing the target image acquisition device.

[0006] Optionally, before adjusting the first position according to the distance between each target corner point included in the target image and an adjacent corner point, the method further includes: performing corner point detection on the target image to obtain a group of corner points of the target image; calculating the distance between each corner point in the group of corner points and an adjacent corner point; and determining a target corner point set including the target corner point in the group of corner points based on the distance between each corner point in the group of corner points and an adjacent corner point.

[0007] Optionally, determining a target corner point set including the target corner point in the group of corner points based on the distance between each corner point in the group of corner points and an adjacent corner point includes: performing the following operations on each corner point included in the group of corner points, wherein when performing the following operations, the first corner point is any corner point included in the group of corner points: determining a first variance value of the distance between the first corner point and the adjacent corner point; and determining that the first corner point is a target corner point included in the target corner point set when the first variance value is greater than or equal to a first preset threshold.

[0008] Optionally, after performing corner point detection on the target image to obtain a group of corner points of the target image, the method further includes: assigning a weight value to each corner point included in the group of corner points according to the position of each corner point in the target image, wherein the closer the corner point is to the center point of the target image, the larger the weight value.

[0009] Optionally, the first position is adjusted according to the distance between each target corner point and the adjacent corner point included in the target image to obtain the second position, including: determining an adjustment direction according to the distance between the target corner point and the adjacent corner point in the target corner point set, and the weight value of the target corner point; taking the first position as the initial position, and adjusting the preset value according to the adjustment direction to obtain the second position.

[0010] Optionally, the adjacent corner points are corner points adjacent to the target corner point in four directions of up, down, left and right, and the adjustment direction is determined based on the distance between the target corner point and the adjacent corner points in the target corner point set and the weight value of the target corner point, including: performing the following operations on each target corner point included in the target corner point set, wherein the target corner point is the second corner point when performing the following operations: determining the distance between the second corner point and adjacent corner points in four directions of up, down, left and right; determining the maximum value of the distance as a preset adjustment value, and the direction corresponding to the maximum value of the distance as the preset adjustment direction; counting the weighted cumulative sum of the preset adjustment values ​​of the target corner points in the target corner point set in the four preset adjustment directions of up, down, left and right; determining the direction with the largest weighted cumulative sum as the adjustment direction.

[0011] Optionally, determining the direction with the largest weighted cumulative sum as the adjustment direction includes: determining a second variance value of the cumulative sum of the preset adjustment values ​​in the four preset adjustment directions of up, down, left and right; when the second variance value is greater than or equal to a second preset threshold, determining the direction with the largest weighted cumulative sum as the adjustment direction.

[0012] According to another embodiment of the present invention, a position determination device is provided, comprising: an acquisition module, used to acquire a group of images obtained by a target image acquisition device after photographing a target image at a group of preset positions respectively, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line; a determination module, used to determine an image with the largest clarity value included in the group of images as the target image, and determine the position where the target image is photographed in the group of preset positions as the first position; an adjustment module, used to adjust the first position according to the distance between each target corner point included in the target image and an adjacent corner point to obtain a second position, wherein the second position is a position for installing the target image acquisition device.

[0013] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.

[0014] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] Through the present invention, a group of images are obtained after the target image acquisition device respectively shoots the target image at a group of preset positions, wherein the group of preset positions includes at least two positions, and at least two positions are on the same vertical line; the image with the largest clarity value included in the group of images is determined as the target image, and the position where the target image is obtained by shooting in the group of preset positions is determined as the first position; the first position is adjusted according to the distance between each target corner point included in the target image and the adjacent corner point to obtain the second position, wherein the second position is the position for installing the target image acquisition device. Therefore, the problem of low automation and accuracy of the posture adjustment of the image acquisition device can be solved, and the automatic adjustment of the posture adjustment of the image acquisition device is realized, and the effect of improving the accuracy of the posture adjustment is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0017] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for determining a position according to an embodiment of the present invention;

[0018] Figure 2is a flow chart of a method for determining a position according to an embodiment of the present invention;

[0019] Figure 3 4 is a structural block diagram of a device for determining a position according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0022] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for determining a position according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal 10 may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the position in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] In this embodiment, a method for determining the position of the mobile terminal is provided. Figure 2 is a flow chart of a method for determining a position according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0026] Step S202, obtaining a group of images obtained by the target image acquisition device after shooting the target image at a group of preset positions respectively, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line;

[0027] Step S204, determining an image with the largest definition value included in the group of images as a target image, and determining a position in the group of preset positions where the target image is captured as a first position;

[0028] Step S206, adjusting the first position according to the distance between each target corner point and an adjacent corner point included in the target image to obtain a second position, wherein the second position is a position for installing the target image acquisition device.

[0029] Through the above steps, a group of images are obtained after the target image acquisition device takes pictures of the target image at a group of preset positions, wherein the group of preset positions includes at least two positions, and at least two positions are on the same vertical line; the image with the largest clarity value included in the group of images is determined as the target image, and the position where the target image is taken in the group of preset positions is determined as the first position; the first position is adjusted according to the distance between each target corner point included in the target image and the adjacent corner point to obtain the second position, wherein the second position is the position for installing the target image acquisition device. Therefore, the problem of low automation and accuracy of the posture adjustment of the image acquisition device can be solved, and the automatic adjustment of the posture adjustment of the image acquisition device is realized, and the effect of improving the accuracy of the posture adjustment is achieved.

[0030] Optionally, the execution subject of the above steps may be a terminal, etc., but is not limited thereto.

[0031] As an optional implementation, the target image acquisition device may be a camera, and the target image may be an image obtained by photographing a checkerboard target. In this embodiment, the weighted average method is used to grayscale the image. The edge gradient information is used through the formula:

[0032] ,

[0033] The accumulated average value of all pixel gradient values ​​is calculated as the clarity value of the current image, where: The pixel coordinates are the pixel coordinates. The camera is continuously moved to find the peak point of the image clarity in the vertical direction. This point is the optimal installation position for the camera height adjustment. A checkerboard target is placed parallel to the front of the image acquisition device. The camera is continuously moved to find the peak point of the image clarity in the vertical direction. This point is the optimal installation position for the camera height adjustment, corresponding to the first position.

[0034] Optionally, before adjusting the first position according to the distance between each target corner point included in the target image and an adjacent corner point, the method further includes: performing corner point detection on the target image to obtain a group of corner points of the target image; calculating the distance between each corner point in the group of corner points and an adjacent corner point; and determining a target corner point set including the target corner point in the group of corner points based on the distance between each corner point in the group of corner points and an adjacent corner point.

[0035] As an optional implementation, the Harris corner point detection algorithm is used to detect all checkerboard corner points to obtain a set of corner points. The formula is:

[0036] ,

[0037] in, is a window function. Traverse all corner points in a set of corner points. Calculate the distance between each corner point and its neighboring corner points in four directions. The Euclidean distance between a corner point and its neighboring corner points can be calculated by the Euclidean distance algorithm. The Euclidean distance between the corner point and the neighboring corner points in four directions can be recorded as dF, dB, dL, and dR respectively. The target corner point in a set of corner points is determined based on dF, dB, dL, and dR.

[0038] Optionally, determining a target corner point set including the target corner point in the group of corner points based on the distance between each corner point in the group of corner points and an adjacent corner point includes: performing the following operations on each corner point included in the group of corner points, wherein when performing the following operations, the first corner point is any corner point included in the group of corner points: determining a first variance value of the distance between the first corner point and the adjacent corner point; and determining that the first corner point is a target corner point included in the target corner point set when the first variance value is greater than or equal to a first preset threshold.

[0039] As an optional implementation, the variance of dF, dB, dL, and dR is calculated. If the variance is greater than a first preset threshold, the corner point is determined to be a target corner point. Otherwise, it is not processed. The first preset threshold can be determined according to actual conditions. For example, it can be 5, 10, 15, etc.

[0040] Optionally, after performing corner point detection on the target image to obtain a group of corner points of the target image, the method further includes: assigning a weight value to each corner point included in the group of corner points according to the position of each corner point in the target image, wherein the closer the corner point is to the center point of the target image, the larger the weight value.

[0041] As an optional implementation, the corner points in a group of detected corner points can be sorted by row, and the corner points can be obtained at equal intervals from the edge to the center. Because the lens has distortion, a weight table is set to reduce the influence of distortion. The weight value decreases from the center to the edge. Each corner point corresponds to a weight value. The corner point at the center The weight is the largest, which can be set to 2, the corner point at the edge The weight of is the smallest and can be set to 1. Use the interpolation formula:

[0042] ,

[0043] The weight table is interpolated in the diagonal direction, and the weight values ​​on both sides of the diagonal are symmetrical and equal. for Point weight value, for Point weight value, is the horizontal coordinate of any point except the center point.

[0044] Optionally, the first position is adjusted according to the distance between each target corner point and the adjacent corner point included in the target image to obtain the second position, including: determining an adjustment direction according to the distance between the target corner point and the adjacent corner point in the target corner point set, and the weight value of the target corner point; taking the first position as the initial position, and adjusting the preset value according to the adjustment direction to obtain the second position.

[0045] As an optional implementation, the adjustment direction of the image acquisition device can be determined based on the Euclidean distance between the target corner point and its adjacent corner point, and the weight value corresponding to the target corner point. The preset value is adjusted according to the adjustment direction to obtain the second position. The second position is the installation posture of the image acquisition device, which can be adjusted according to the adjustment step size. The adjustment preset value can be the adjustment step size value, for example, it can be 1, 2, 3 steps, etc. The specific value can be determined according to the actual situation.

[0046] Optionally, the adjacent corner points are corner points adjacent to the target corner point in four directions of up, down, left and right, and the adjustment direction is determined based on the distance between the target corner point and the adjacent corner points in the target corner point set and the weight value of the target corner point, including: performing the following operations on each target corner point included in the target corner point set, wherein the target corner point is the second corner point when performing the following operations: determining the distance between the second corner point and adjacent corner points in four directions of up, down, left and right; determining the maximum value of the distance as a preset adjustment value, and the direction corresponding to the maximum value of the distance as the preset adjustment direction; counting the weighted cumulative sum of the preset adjustment values ​​of the target corner points in the target corner point set in the four preset adjustment directions of up, down, left and right; determining the direction with the largest weighted cumulative sum as the adjustment direction.

[0047] As an optional implementation, the Euclidean distances between each target corner point and its neighboring corner points in four directions are calculated, where the Euclidean distances in the up, down, left, and right directions are denoted as dF, dB, dL, and dR, respectively, and the maximum value dmax =max {dF, dB, dL, dR) is calculated. If the maximum value dmax is equal to dF, the preset adjustment direction adjF count is added to the weight value of the corner point.

[0048] After traversing all target corner points in all target corner point sets, calculate the maximum value of the Euclidean distance of all corner points and the corresponding preset adjustment direction. Count the cumulative values ​​of the weighted Euclidean distances of the target corner point set in the four directions of up, down, left, and right. Determine the direction with the largest cumulative value as the adjustment direction. For example, in the target corner point set, the maximum Euclidean distance of target corner point 1 is dF=1, and the corresponding weight value is 1.1, the maximum Euclidean distance of target corner point 2 is dB=3, and the corresponding weight value is 1.2, the maximum Euclidean distance of target corner point 3 is dL=2, and the corresponding weight value is 1.5, the maximum Euclidean distance of target corner point 4 is dR=1, and the corresponding weight value is 1.3, the maximum Euclidean distance of target corner point 5 is dF=2, and the corresponding weight value is 1.4, the maximum Euclidean distance of target corner point 6 is dB=1, and the corresponding weight value is 1.3, the maximum Euclidean distance of target corner point 7 is dL=1, and the corresponding weight value is 1.4, and the maximum Euclidean distance of target corner point 8 is dR=2, and the corresponding weight value is 1.5. The weighted cumulative sum of the above target corner points 1 to 8 in the dF direction is: , the weighted cumulative sum in the dB direction is: , the weighted cumulative sum in the dL direction is: , the weighted cumulative sum in the dR direction is: If the direction with the largest weighted cumulative sum is the dB direction, the adjustment direction is determined to be downward adjustment.

[0049] Optionally, determining the direction with the largest weighted cumulative sum as the adjustment direction includes: determining a second variance value of the cumulative sum of the preset adjustment values ​​in the four preset adjustment directions of up, down, left and right; when the second variance value is greater than or equal to a second preset threshold, determining the direction with the largest weighted cumulative sum as the adjustment direction.

[0050] As an optional implementation, for example, in the target corner point set, the maximum Euclidean distance of target corner point 1 is dF=1, the maximum Euclidean distance of target corner point 2 is dB=3, the maximum Euclidean distance of target corner point 3 is dL=2, the maximum Euclidean distance of target corner point 4 is dR=1, the maximum Euclidean distance of target corner point 5 is dF=2, the maximum Euclidean distance of target corner point 6 is dB=1, the maximum Euclidean distance of target corner point 7 is dL=1, and the maximum Euclidean distance of target corner point 8 is dR=2. The sum of the Euclidean distances in four directions is calculated respectively, sumdF=3, sum dB=4, sum dL=3, sum dR=3, and the variance of the above four values ​​is calculated. If the variance is greater than or equal to the second preset threshold, adjustment is performed. If the variance value is less than the threshold, no adjustment is performed. In this embodiment, the second preset threshold can be determined according to actual conditions, for example, it can be 5, 10, 15, etc. This application proposal introduces machine vision to accurately measure the camera posture and adjusts the posture according to the measurement results, thereby reducing the difficulty of adjusting industrial cameras on the production line and improving the degree of automation of camera posture adjustment. This method is simple, feasible and easy to operate.

[0051] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0052] In this embodiment, a device for determining a position is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0053] Figure 3 is a structural block diagram of a device for determining a position according to an embodiment of the present invention. Figure 3As shown, the device includes: an acquisition module 32, used to acquire a group of images obtained by a target image acquisition device after photographing the target image at a group of preset positions respectively, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line; a determination module 34, used to determine the image with the largest clarity value included in the group of images as the target image, and determine the position where the target image is photographed in the group of preset positions as the first position; an adjustment module 36, used to adjust the first position according to the distance between each target corner point included in the target image and the adjacent corner point to obtain a second position, wherein the second position is the position for installing the target image acquisition device.

[0054] Optionally, the above-mentioned device is also used to perform corner point detection on the target image to obtain a group of corner points of the target image before adjusting the first position according to the distance between each target corner point included in the target image and the adjacent corner point; calculate the distance between each corner point in the group of corner points and the adjacent corner point; and determine a target corner point set including the target corner point in the group of corner points based on the distance between each corner point in the group of corner points and the adjacent corner point.

[0055] Optionally, the above-mentioned device is also used to perform the following operations on each corner point included in the group of corner points, wherein, when performing the following operations, the first corner point is any corner point included in the group of corner points: determine a first variance value of the distance between the first corner point and an adjacent corner point; when the first variance value is greater than or equal to a first preset threshold, determine that the first corner point is a target corner point included in the target corner point set.

[0056] Optionally, the above-mentioned device is also used to assign a weight value to each corner point according to the position of each corner point included in the group of corner points in the target image after performing corner point detection on the target image to obtain a group of corner points of the target image, wherein the closer the corner point is to the center point of the target image, the larger the weight value.

[0057] Optionally, the above-mentioned adjustment module is also used to determine the adjustment direction according to the distance between the target corner point and the adjacent corner point in the target corner point set, and the weight value of the target corner point; taking the first position as the initial position, adjusting the preset value according to the adjustment direction to obtain the second position.

[0058] Optionally, the adjacent corner points are corner points adjacent to the target corner point in four directions of up, down, left and right. The above-mentioned device is also used to perform the following operations on each target corner point included in the target corner point set, wherein the target corner point is a second corner point when performing the following operations: determining the distance between the second corner point and the adjacent corner points in four directions of up, down, left and right; determining the maximum value of the distance as a preset adjustment value, and the direction corresponding to the maximum value of the distance as the preset adjustment direction; counting the weighted cumulative sum of the preset adjustment values ​​of the target corner points in the target corner point set in the four preset adjustment directions of up, down, left and right; determining the direction with the largest weighted cumulative sum as the adjustment direction.

[0059] Optionally, the above-mentioned device is also used to implement the determination of the direction with the largest weighted cumulative sum as the adjustment direction in the following manner: determine the second variance value of the cumulative sum of the preset adjustment values ​​in the four preset adjustment directions of up, down, left and right; when the second variance value is greater than or equal to a second preset threshold, determine the direction with the largest weighted cumulative sum as the adjustment direction.

[0060] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0061] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0062] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0063] S1, acquiring a group of images obtained by a target image acquisition device after photographing a target image at a group of preset positions, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line;

[0064] S2, determining an image with the largest definition value included in the group of images as a target image, and determining a position in the group of preset positions where the target image is captured as a first position;

[0065] S3, adjusting the first position according to the distance between each target corner point and an adjacent corner point included in the target image to obtain a second position, wherein the second position is a position for installing the target image acquisition device.

[0066] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0067] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0068] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0069] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0070] S1, acquiring a group of images obtained by a target image acquisition device after photographing a target image at a group of preset positions, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line;

[0071] S2, determining an image with the largest definition value included in the group of images as a target image, and determining a position in the group of preset positions where the target image is captured as a first position;

[0072] S3, adjusting the first position according to the distance between each target corner point and an adjacent corner point included in the target image to obtain a second position, wherein the second position is a position for installing the target image acquisition device.

[0073] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0074] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0075] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining a position, characterized in that: include: Acquire a group of images obtained by photographing the target at a group of preset positions by a target image acquisition device, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line; Determine an image with the largest definition value included in the group of images as a target image, and determine a position in the group of preset positions where the target image is photographed as a first position; Performing corner point detection on the target image to obtain a group of corner points of the target image, determining a target corner point set from the group of corner points, and assigning a weight value to each target corner point in the target corner point set; The adjustment direction is determined according to the distance between each target corner point and the adjacent corner point included in the target corner point set, and the weight value of the target corner point; the first position is taken as the initial position, and the preset value is adjusted according to the adjustment direction to obtain the second position, wherein the second position is the position for installing the target image acquisition device.

2. The method according to claim 1, characterized in that: Determining a target corner point set from the set of corner points includes: Calculate the distance between each corner point and the adjacent corner points in the set of corner points; According to the distance between each corner point in the group of corner points and an adjacent corner point, a target corner point set including the target corner point is determined in the group of corner points.

3. The method according to claim 2, characterized in that The step of determining a target corner point set including the target corner point from the group of corner points according to the distance between each corner point in the group of corner points and an adjacent corner point comprises: Perform the following operations on each corner point included in the set of corner points, wherein the first corner point when performing the following operations is any corner point included in the set of corner points: Determine a first variance value of a distance between the first corner point and an adjacent corner point; When the first variance value is greater than or equal to a first preset threshold, the first corner point is determined to be a target corner point included in the target corner point set.

4. The method according to claim 1, characterized in that: Assigning a weight value to each target corner point in the target corner point set includes: A weight value is assigned to each corner point according to a position of each corner point included in the group of corner points in the target image, wherein a corner point closer to a center point of the target image has a larger weight value.

5. The method according to claim 4, characterized in that The adjacent corner points are corner points adjacent to the target corner point in four directions: up, down, left, and right. The adjusting direction is determined according to the distance between the target corner point and the adjacent corner points in the target corner point set and the weight value of the target corner point, including: Performing the following operations on each target corner point included in the target corner point set, wherein when performing the following operations, the target corner point is a second corner point: determining the distance between the second corner point and adjacent corner points in four directions of up, down, left, and right; determining the maximum value of the distance as a preset adjustment value, and the direction corresponding to the maximum value of the distance as a preset adjustment direction; Counting the weighted cumulative sum of the preset adjustment values ​​of the target corner points in the target corner point set in four preset adjustment directions of up, down, left and right; The direction in which the weighted cumulative sum is the largest is determined as the adjustment direction.

6. The method according to claim 5, wherein determining the direction with the maximum weighted cumulative sum as the adjustment direction comprises: Determine a second variance value of the accumulated sum of the preset adjustment values ​​in the four preset adjustment directions of up, down, left and right; When the second variance value is greater than or equal to a second preset threshold, the direction in which the weighted cumulative sum is the largest is determined as the adjustment direction.

7. A device for determining a position, characterized in that: include: An acquisition module, used to acquire a group of images obtained by the target image acquisition device after photographing the target at a group of preset positions, wherein the group of preset positions includes at least two positions, and the at least two positions are on the same vertical line; a determination module, configured to determine an image with the largest definition value included in the group of images as a target image, and determine a position in the group of preset positions where the target image is captured as a first position; An adjustment module is used to perform corner point detection on the target image to obtain a group of corner points of the target image, determine a target corner point set in the group of corner points, and assign a weight value to each target corner point in the target corner point set; determine an adjustment direction according to the distance between each target corner point included in the target corner point set and the adjacent corner point, and the weight value of the target corner point; take the first position as the initial position, and adjust the preset value according to the adjustment direction to obtain a second position, wherein the second position is a position for installing the target image acquisition device.

8. A storage medium, characterized in that: The storage medium stores a computer program, wherein the program can be executed by a terminal device or a computer to execute the method described in any one of claims 1 to 6.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.