Object inspection method and device and electronic equipment
By receiving inspection instructions and determining the spatial coordinates of the target object and the field of view of the camera, the problem of not being able to quickly locate the camera during non-preset inspections is solved, and efficient and accurate inspection results are achieved.
Patent Information
- Application Number
- CN202510095434.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
AI Technical Summary
During non-preset inspections, it is impossible to quickly locate the camera.
By receiving inspection instructions, the target spatial coordinates of the target object and the preset spatial coordinates and field of view parameters of the initial camera are determined, the candidate camera is determined from multiple initial cameras, and the target camera is selected according to the observation parameters, and the target camera is finally controlled to inspect.
It realizes rapid positioning and selection of suitable cameras in non-preset inspections, improving the efficiency and accuracy of inspections.
Smart Images

Figure CN120014048A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an object inspection method, device and electronic equipment. Background Art
[0002] In the related art, when the traditional online inspection method is used for online inspection, due to the complexity of the inspection environment, the uncertainty of the inspection requirements, the dependency on preset positions, etc., it leads to the technical problem that the camera cannot be quickly located during non-preset position inspections.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide an object inspection method, device and electronic device to at least solve the technical problem in the related art that a camera cannot be quickly positioned during non-preset position inspection.
[0005] According to one aspect of an embodiment of the present invention, there is provided an object inspection method, comprising: receiving an inspection instruction, wherein the inspection instruction carries an identification of a target object to be inspected; in response to the inspection instruction, determining the target space coordinates of a target object corresponding to the target object identification, and preset space coordinates and field of view parameters respectively corresponding to a plurality of initial cameras, wherein the field of view parameters are parameters for characterizing the field of view of the corresponding initial camera; determining a plurality of candidate cameras from the plurality of initial cameras based on the target space coordinates, and the preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras; determining a target camera from the plurality of candidate cameras based on observation parameters respectively corresponding to the plurality of candidate cameras, wherein the observation parameters are parameters for characterizing the observation range of the corresponding candidate camera, and the observation range includes the target object; and controlling the target camera to perform inspection to obtain an inspection result.
[0006] Optionally, determining a plurality of candidate cameras from the plurality of initial cameras based on the target spatial coordinates, and the preset spatial coordinates and field of view parameters respectively corresponding to the plurality of initial cameras, includes: determining the spatial distance parameters respectively corresponding to the plurality of initial cameras based on the target spatial coordinates, and the preset spatial coordinates respectively corresponding to the plurality of initial cameras; determining a plurality of alternative cameras based on the spatial distance parameters respectively corresponding to the plurality of initial cameras, wherein the alternative cameras are initial cameras whose spatial distance parameters are less than a predetermined distance threshold; determining the field of view parameters respectively corresponding to the plurality of alternative cameras; determining a plurality of candidate cameras from the plurality of alternative cameras based on the target spatial coordinates, and the preset spatial coordinates and field of view parameters respectively corresponding to the plurality of alternative cameras.
[0007] Optionally, determining the field of view parameters respectively corresponding to the multiple initial cameras includes: determining angle parameters, magnification parameters, focal length parameters and object distance parameters respectively corresponding to the multiple initial cameras, wherein the angle parameter is a parameter used to characterize the rotation angle of the initial camera, the magnification parameter is a parameter used to characterize the size ratio between the target object and the image of the target object in the initial camera, the focal length parameter is a parameter used to characterize the observation clarity of the initial camera, and the object distance parameter is a parameter used to characterize the observation distance of the initial camera; based on the angle parameter, the magnification parameter, the focal length parameter, and the object distance parameter, determine the preset spatial coordinates and field of view parameters respectively corresponding to the multiple initial cameras.
[0008] Optionally, before determining the target camera based on the observation parameters respectively corresponding to the multiple candidate cameras, the method further includes: determining multiple observation points corresponding to the target object; determining an observation plane corresponding to the target object based on the multiple observation points corresponding to the target object; determining observation parameters respectively corresponding to the multiple candidate cameras based on the observation plane corresponding to the target object and the field of view parameters respectively corresponding to the multiple candidate cameras.
[0009] Optionally, determining the target camera based on the observation parameters respectively corresponding to the multiple candidate cameras includes: when the corresponding observation parameters include observation angles, determining multiple pixel coordinates respectively corresponding to the multiple observation objects under the observation angles corresponding to each candidate camera; taking each candidate camera as the origin, determining the corresponding updated pixel coordinates respectively corresponding to the multiple observation objects; determining the occlusion parameters respectively corresponding to the multiple candidate cameras based on the corresponding updated pixel coordinates respectively corresponding to the multiple observation objects, wherein the corresponding occlusion results are parameters of the degree of occlusion of the corresponding target objects; determining the target camera from the multiple candidate cameras based on the occlusion parameters respectively corresponding to the multiple candidate cameras.
[0010] Optionally, taking each candidate camera as the origin, determining the updated pixel coordinates corresponding to the multiple observed objects respectively, includes: determining initial depth indices corresponding to the multiple pixel coordinates respectively according to the multiple pixel coordinates corresponding to the multiple observed objects respectively; determining target depth indices corresponding to multiple preset pixel coordinates respectively according to the initial depth indices corresponding to the multiple pixel coordinates respectively; determining updated pixel coordinates corresponding to the multiple observed objects respectively according to the target depth indices corresponding to the multiple preset pixel coordinates respectively.
[0011] Optionally, controlling the target camera to perform an inspection and obtaining an inspection result includes: determining a viewing angle vector of the target camera and a center vector of the target object, wherein the viewing angle vector is a vector used to characterize the lens orientation of the target camera, and the center vector is a vector used to characterize the orientation of the target object; determining adjustment parameters of the target camera based on the viewing angle vector of the target camera, the preset spatial coordinates and the field of view parameters, and the center vector and target spatial coordinates of the target object; adjusting the orientation angle of the target camera based on the adjustment parameters; and controlling the target camera after adjusting the orientation angle to perform an inspection and obtain an inspection result.
[0012] According to one aspect of an embodiment of the present invention, there is provided an object inspection device, comprising: a receiving module, receiving an inspection instruction, wherein the inspection instruction carries an identifier of a target object to be inspected; a response module, in response to the inspection instruction, determining the target space coordinates of a target object corresponding to the target object identifier, and preset space coordinates and field of view parameters respectively corresponding to a plurality of initial cameras, wherein the field of view parameters are parameters for characterizing the field of view of the initial camera; a first determination module, determining a plurality of candidate cameras from the plurality of initial cameras according to the target space coordinates, and the preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras; a second determination module, determining a target camera from the plurality of candidate cameras according to observation parameters respectively corresponding to the plurality of candidate cameras, wherein the observation parameters are parameters for characterizing the observation range of the candidate camera, and the observation range includes the target object; and a third determination module, controlling the target camera to perform an inspection and obtain an inspection result.
[0013] According to one aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any one of the object inspection methods described above.
[0014] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned object inspection methods.
[0015] In an embodiment of the present invention, an inspection instruction is received, wherein the inspection instruction carries an identification of a target object to be inspected; in response to the inspection instruction, the target spatial coordinates of the target object identification, as well as preset spatial coordinates and field of view parameters corresponding to a plurality of initial cameras, are determined, wherein the field of view parameters are parameters for characterizing the field of view of the corresponding initial camera; based on the target spatial coordinates, and the preset spatial coordinates and field of view parameters corresponding to the plurality of initial cameras, a plurality of candidate cameras are determined from the plurality of initial cameras; based on the observation parameters corresponding to the plurality of candidate cameras, a target camera is determined from the plurality of candidate cameras, wherein the observation parameters are parameters for characterizing the observation range of the corresponding candidate camera, and the observation range includes the target object identification; the target camera is controlled to perform an inspection to obtain an inspection result. By determining the target spatial coordinates of the target object, as well as the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras, the specific positions of the target object and the multiple initial cameras at the site where the target object is located can be achieved; by determining multiple candidate cameras from the multiple initial cameras according to the target spatial coordinates, as well as the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras, it is ensured that the selected candidate cameras have the ability to cover the target object, thereby improving the accuracy of camera selection; by using the observation parameters corresponding to the multiple candidate cameras, the target camera is determined from the multiple candidate cameras, wherein the observation parameters are parameters used to characterize the observation range of the corresponding candidate camera, and the observation range includes the target object, thereby ensuring that the selected target camera can provide the best observation effect of the target object, while avoiding indiscriminate calling of all candidate cameras; by controlling the selected target camera to perform actual inspection tasks, the tedious process of manually controlling the camera is avoided, the efficiency and accuracy of the inspection are improved, and the technical problem of the inability to quickly locate the camera in non-preset position inspection in the related technology is solved. 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 is a flow chart of an object inspection method according to an embodiment of the present invention;
[0018] Figure 2 It is a flow chart of non-preset position inspection of a rotatable camera in an optional embodiment of the present invention;
[0019] Figure 3 is a flowchart of the best field of view algorithm matching camera in an optional implementation manner of the present invention;
[0020] Figure 4 is a structural block diagram of an object inspection device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] 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. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0024] PCL C++ Library: PCL is the abbreviation of Point Cloud Library. It is a large cross-platform open source C++ programming library that focuses on processing three-dimensional point cloud data. It implements a large number of general algorithms and efficient data structures for point cloud acquisition, filtering, segmentation, registration, retrieval, feature extraction, recognition, tracking, surface reconstruction and visualization.
[0025] Three.js: Three.js is an open source JavaScript library based on WebGL. Three.js hides the complexity of WebGL by providing a series of high-level APIs, allowing developers to focus on creativity and logic implementation rather than the underlying graphics rendering details.
[0026] VUE: Vue.js (often referred to as Vue) is an open source JavaScript framework that focuses on building user interfaces. It uses responsive data binding and component-based development models, allowing developers to build modern web applications more efficiently.
[0027] Example 1
[0028] According to an embodiment of the present invention, an embodiment of an object inspection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a flow chart of an object inspection method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0030] S102, receiving an inspection instruction, wherein the inspection instruction carries an identifier of a target object to be inspected;
[0031] In step S102 provided in the present application, a patrol instruction is received.
[0032] Among them, a patrol instruction is involved, and the patrol instruction is an instruction for executing a patrol inspection, and the patrol instruction carries a target object identifier.
[0033] Among them, the target object identification is involved, and the target object identification is an identification used to identify the target object to be inspected. The target object identification can be any identifier that helps to locate and identify the target, such as the name, number, location coordinates, QR code, radio frequency tag (RFID) information, etc. of the target object.
[0034] By receiving an inspection instruction for performing an inspection, and the inspection instruction carries the identification of the target object to be inspected, it is helpful to accurately determine the target object to be inspected, and further helps to determine the corresponding camera for subsequent inspection of the target object.
[0035] S104, in response to the inspection instruction, determining the target space coordinates of the target object corresponding to the target object identifier, and the preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras, wherein the field of view parameters are parameters used to characterize the field of view range of the corresponding initial camera;
[0036] In step S104 provided in the present application, the inspection instruction is responded to, and the target space coordinates of the target object, as well as the preset space coordinates and field of view parameters corresponding to the multiple initial cameras are determined.
[0037] Among them, a target object is involved, and the target object is an object to be inspected. For example, in a power station, the target object may include power equipment.
[0038] Among them, target space coordinates are involved, which are coordinates used to characterize the specific position of the target object in the physical space. The position of the target object can be accurately determined by the target space coordinates. The target space coordinates may include the three-dimensional coordinates of the target object.
[0039] Among them, the initial camera is involved, which is a camera pre-set in the space where the target object to be inspected is located. For example, in a power station, in order to realize the inspection of power equipment, multiple cameras will be pre-installed at key positions, which are equivalent to the initial camera. Each camera will cover a certain area. After receiving the inspection instruction, one or more cameras will be selected from these cameras for inspection to realize effective monitoring of specific target objects.
[0040] The preset space coordinates are the position coordinates of the initial camera in the physical space, and may include the three-dimensional coordinates of the initial camera.
[0041] Among them, the field of view parameter is involved, which is a parameter used to characterize the field of view that the initial camera can monitor. The field of view parameter may include a horizontal field of view angle parameter, a vertical field of view angle parameter, a diagonal field of view angle parameter, a focal length parameter, a magnification parameter, etc. For example, the field of view parameters of a camera may be a horizontal field of view angle of 90 degrees, a vertical field of view angle of 60 degrees, a focal length of 50 mm, and a magnification of 10 times. These parameters determine the observation range of the camera and the clarity of the image details.
[0042] By responding to inspection instructions and determining the target spatial coordinates of the target object, as well as the preset spatial coordinates and field of view parameters corresponding to multiple initial cameras, it is possible to achieve the specific positions of the target object and multiple initial cameras at the site where the target object is located, which will help to accurately determine the camera suitable for inspecting the target object in the future, thereby helping to improve the targeted inspection and inspection efficiency.
[0043] S106, determining a plurality of candidate cameras from the plurality of initial cameras according to the target space coordinates and the preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras;
[0044] In step S106 provided in the present application, a plurality of candidate cameras are determined from a plurality of initial cameras.
[0045] The candidate camera is selected from the multiple initial cameras according to the target space coordinates and the preset space coordinates and field of view parameters corresponding to the multiple initial cameras, and can cover the target object. The field of view of the candidate camera can include the target object.
[0046] By determining multiple candidate cameras from multiple initial cameras based on the target spatial coordinates and the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras, it is ensured that the selected candidate cameras have the ability to cover the target object, thereby improving the accuracy of camera selection, which helps to quickly screen out cameras suitable for the inspection target object in the subsequent process, avoids unnecessary calculations for all cameras, improves the efficiency of camera selection, and further solves the problem of quickly locating available cameras in non-preset position inspections, thereby improving the inspection effect.
[0047] S108, determining a target camera from the plurality of candidate cameras according to observation parameters corresponding to the plurality of candidate cameras, wherein the observation parameters are parameters used to characterize an observation range of the corresponding candidate camera, and the observation range includes the target object;
[0048] In step S108 provided in the present application, a target camera is determined from a plurality of candidate cameras.
[0049] Among them, an observation parameter is involved, and the observation parameter is a parameter used to characterize the observation ranges corresponding to multiple candidate cameras respectively, and the observation range includes the target object.
[0050] Among them, the target camera is involved, which is a camera that is selected and suitable for inspecting the specified target object. For example, if a specific high-voltage device inside a substation needs to be observed, the target camera can be a camera that can obtain the clearest and unobstructed image of the device after adjusting the angle, focal length and magnification.
[0051] A target camera is determined from multiple candidate cameras through observation parameters corresponding to each of the multiple candidate cameras, wherein the observation parameters are parameters used to characterize the observation range of the corresponding candidate camera, and the observation range includes the target object, thereby ensuring that the selected target camera can provide the best observation effect on the target object, while avoiding indiscriminate calling of all candidate cameras, reducing unnecessary camera adjustments, and thus improving inspection efficiency.
[0052] S110, controlling the target camera to perform inspection and obtaining inspection results.
[0053] In step S110 provided in the present application, the target camera is controlled to perform an inspection and an inspection result is obtained.
[0054] Among them, the inspection result is involved, which is the result of the state of the target object obtained after responding to the inspection instruction and using the target camera for actual monitoring. The inspection result can include real-time video stream, high-definition image, infrared thermal map, abnormal detection report, equipment status assessment, etc. For example, if the target object is a high-voltage device in an electric power facility, the inspection result may be a high-definition video stream showing the appearance of the device, or an infrared thermal map used to monitor the temperature distribution of the device, so as to determine whether the device is operating normally or has potential faults.
[0055] By controlling the selected target camera to carry out actual inspection tasks, the tedious process of manually controlling the camera is avoided, and the efficiency and accuracy of the inspection are improved, which helps to timely discover potential equipment failures and achieve early warning, thereby helping to prevent major accidents.
[0056] Through the above steps S102-S110, an inspection instruction is received, wherein the inspection instruction carries the target object identification to be inspected; in response to the inspection instruction, the target space coordinates of the target object identification, and the preset space coordinates and field of view parameters corresponding to the multiple initial cameras are determined, wherein the field of view parameters are parameters used to characterize the field of view of the corresponding initial camera; based on the target space coordinates, and the preset space coordinates and field of view parameters corresponding to the multiple initial cameras, multiple candidate cameras are determined from the multiple initial cameras; based on the observation parameters corresponding to the multiple candidate cameras, a target camera is determined from the multiple candidate cameras, wherein the observation parameters are parameters used to characterize the observation range of the corresponding candidate camera, and the observation range includes the target object identification; the target camera is controlled to perform inspection to obtain an inspection result. By determining the target spatial coordinates of the target object, as well as the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras, the specific positions of the target object and the multiple initial cameras at the site where the target object is located can be achieved; by determining multiple candidate cameras from the multiple initial cameras according to the target spatial coordinates, as well as the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras, it is ensured that the selected candidate cameras have the ability to cover the target object, thereby improving the accuracy of camera selection; by using the observation parameters corresponding to the multiple candidate cameras, the target camera is determined from the multiple candidate cameras, wherein the observation parameters are parameters used to characterize the observation range of the corresponding candidate camera, and the observation range includes the target object, thereby ensuring that the selected target camera can provide the best observation effect of the target object, while avoiding indiscriminate calling of all candidate cameras; by controlling the selected target camera to perform actual inspection tasks, the tedious process of manually controlling the camera is avoided, the efficiency and accuracy of the inspection are improved, and the technical problem of the inability to quickly locate the camera in non-preset position inspection in the related technology is effectively solved.
[0057] As an optional embodiment, multiple candidate cameras are determined from multiple initial cameras based on target spatial coordinates, and preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras, including: determining spatial distance parameters corresponding to the multiple initial cameras based on the target spatial coordinates and the preset spatial coordinates corresponding to the multiple initial cameras; determining multiple alternative cameras based on the spatial distance parameters corresponding to the multiple initial cameras, wherein the alternative cameras are initial cameras whose spatial distance parameters are less than a predetermined distance threshold; determining field of view parameters corresponding to the multiple alternative cameras; determining multiple candidate cameras from the multiple alternative cameras based on the target spatial coordinates, and the preset spatial coordinates and field of view parameters corresponding to the multiple alternative cameras.
[0058] In this embodiment, specific steps of determining a plurality of candidate cameras from a plurality of initial cameras based on target space coordinates and preset space coordinates and field of view parameters corresponding to the plurality of initial cameras are described.
[0059] Among them, a spatial distance parameter is involved, which is a parameter representing the spatial distance between the target object and the camera based on the target spatial coordinates and the preset spatial coordinates of the camera.
[0060] Among them, an alternative camera is involved, which is an initial camera whose spatial distance parameter is less than a predetermined distance threshold.
[0061] Among them, a predetermined distance threshold is involved, which is predetermined and used to limit the maximum allowable distance between the camera and the target object. The setting of the predetermined distance threshold is based on factors such as the effective monitoring distance of the camera, the size of the target object, and the clarity required for monitoring. For example, in power facility monitoring, if the target device is small in size and requires high-definition monitoring, the predetermined distance threshold may be set to 300 meters or less to ensure that the camera can capture enough details.
[0062] In the steps involved in this embodiment, first, based on the target spatial coordinates and the preset spatial coordinates corresponding to the multiple initial cameras, the spatial distance parameters corresponding to the multiple initial cameras are determined; then, based on the spatial distance parameters corresponding to the multiple initial cameras, a plurality of alternative cameras are determined, wherein the alternative cameras are initial cameras whose spatial distance parameters are less than a predetermined distance threshold; then, the field of view parameters corresponding to the multiple alternative cameras are determined; finally, based on the target spatial coordinates and the preset spatial coordinates and field of view parameters corresponding to the multiple alternative cameras, a plurality of candidate cameras are determined from the multiple alternative cameras.
[0063] Through the above steps, the candidate cameras are screened by setting the distance threshold, which reduces the calculation amount of subsequent field of view parameter matching, effectively avoids unnecessary calls to cameras that are far away or whose field of view cannot cover the target, and improves the efficiency of camera selection. According to the field of view parameters, the ability of the camera to cover the target object can be accurately evaluated to ensure that the candidate camera finally selected can provide high-quality images. By considering the spatial distance parameters and the field of view parameters, the problem of fixed camera coverage in traditional preset position monitoring can be overcome, and flexible monitoring of non-preset position targets can be achieved.
[0064] As an optional embodiment, determining the field of view parameters corresponding to multiple initial cameras respectively includes: determining angle parameters, magnification parameters, focal length parameters and object distance parameters corresponding to the multiple initial cameras respectively, wherein the angle parameter is a parameter used to characterize the rotation angle of the initial camera, the magnification parameter is a parameter used to characterize the size ratio between the target object and the image of the target object in the initial camera, the focal length parameter is a parameter used to characterize the observation clarity of the initial camera, and the object distance parameter is a parameter used to characterize the observation distance of the initial camera; based on the angle parameter, magnification parameter, focal length parameter, and object distance parameter, determine the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras respectively.
[0065] In this embodiment, specific steps of determining the field of view parameters respectively corresponding to a plurality of initial cameras are described.
[0066] Among them, the angle parameter is involved. The angle parameter is a parameter used to characterize the initial camera rotation angle, including the camera's horizontal and vertical rotation angles, reflecting the horizontal and vertical ranges that the camera can cover. For example, the angle parameters of a camera may include a horizontal rotation range of 0° to 360° and a vertical tilt range of -90° to +90°, which means that the camera can achieve full rotation in the horizontal direction and full tilt from the ground to the sky in the vertical direction.
[0067] Among them, a magnification parameter is involved, which is a parameter used to characterize the size ratio between the target object and the image of the target object in the initial camera, and reflects the multiple by which the image of the target object can be magnified after the camera is adjusted.
[0068] Among them, the focal length parameter is involved. This focal length parameter is a parameter used to characterize the initial camera observation clarity. It reflects the distance from the center of the lens to its focus. The longer the focal length, the smaller the camera's field of view and the higher the imaging clarity, which is suitable for long-distance observation; the shorter the focal length, the larger the field of view and is suitable for close-range large-scene coverage.
[0069] Among them, an object distance parameter is involved, which is a parameter used to characterize the initial camera observation distance and reflects the distance that the camera can observe.
[0070] In the steps involved in this embodiment, the angle parameters, magnification parameters, focal length parameters and object distance parameters corresponding to the multiple initial cameras are first determined, wherein the angle parameter is a parameter used to characterize the rotation angle of the initial camera, the magnification parameter is a parameter used to characterize the size ratio between the target object and the imaging of the target object in the initial camera, the focal length parameter is a parameter used to characterize the observation clarity of the initial camera, and the object distance parameter is a parameter used to characterize the observation distance of the initial camera. Then, based on the angle parameter, magnification parameter, focal length parameter, and object distance parameter, the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras are determined.
[0071] By evaluating the camera's field of view parameters from multiple dimensions, including angle parameters, magnification parameters, focal length parameters, and object distance parameters corresponding to multiple initial cameras, the limitations of fixed camera positions and field of view in traditional preset position monitoring can be overcome, and flexible monitoring of any target position can be achieved. Based on angle parameters, magnification parameters, focal length parameters, and object distance parameters, it helps to reasonably allocate camera resources, avoids calling cameras that are inefficient or ineffective even if they can cover the target, and improves inspection efficiency.
[0072] As an optional embodiment, before determining the target camera based on the observation parameters corresponding to multiple candidate cameras, it also includes: determining multiple observation points corresponding to the target object; determining the observation plane corresponding to the target object based on the multiple observation points corresponding to the target object; determining the observation parameters corresponding to the multiple candidate cameras based on the observation plane corresponding to the target object and the field of view parameters corresponding to the multiple candidate cameras.
[0073] In this embodiment, the specific steps before determining the target camera based on the observation parameters corresponding to a plurality of candidate cameras are described.
[0074] Among them, an observation point is involved, and the observation point is a point used to determine the position of the target object. The observation point can be manually selected by the user in the three-dimensional scene.
[0075] Among them, an observation plane is involved, which is a plane determined based on multiple observation points and includes the target object. The observation plane is used to describe a two-dimensional perspective or section required to observe the target object. And the observation plane is used to ensure that the camera's field of view can at least cover the key features of the target object. For example, in a three-dimensional scene, if the target object is a transformer in a substation, the observation plane may be a plane parallel to the top of the transformer to ensure that its structure and status can be observed from above, or a plane perpendicular to the side of the transformer to check the details of its side.
[0076] In the steps involved in this embodiment, multiple observation points corresponding to the target object are first determined, then the observation plane corresponding to the target object is determined based on the multiple observation points corresponding to the target object, and finally, based on the observation plane corresponding to the target object and the field of view parameters corresponding to the multiple candidate cameras, the observation parameters corresponding to the multiple candidate cameras are determined.
[0077] By determining the observation points and observation planes, the target object can be accurately located and the observation direction can be determined, ensuring that the camera's field of view can cover the key parts of the target object. According to the observation requirements of the target object and the field of view parameters of the candidate cameras, it can be ensured that the camera can provide the best observation effect, such as clear field of view, complete coverage, etc. Especially in non-preset position inspections, determining the observation points and planes can adapt to the uncertainty of the target object's position. Even if the target is not in the preset position, it is possible to find the angle and distance most suitable for monitoring the target object through adjustment, thereby improving the accuracy of camera selection and inspection efficiency.
[0078] As an optional embodiment, a target camera is determined based on observation parameters corresponding to multiple candidate cameras, including: when the corresponding observation parameters include observation angle, determining multiple pixel coordinates corresponding to multiple observation objects under the observation angle corresponding to each candidate camera; taking each candidate camera as the origin, determining the updated pixel coordinates corresponding to the corresponding multiple observation objects; determining the occlusion parameters corresponding to the multiple candidate cameras based on the updated pixel coordinates corresponding to the corresponding multiple observation objects, wherein the corresponding occlusion results are parameters of the degree of occlusion of the corresponding target objects; and determining the target camera from the multiple candidate cameras based on the occlusion parameters corresponding to the multiple candidate cameras.
[0079] In this embodiment, specific steps of determining a target camera based on observation parameters corresponding to a plurality of candidate cameras are described.
[0080] Among them, the observation angle is involved, which is the angle and direction of the camera when observing the target, including the horizontal and vertical angle settings of the camera. It determines the field of view that the camera can cover and the specific position of the observed target.
[0081] Among them, pixel coordinates are involved, which are the position coordinates of each pixel point on the image plane in the image including the target object acquired by the camera. For example, the pixel coordinates can be represented by two-dimensional coordinates. In a 1920x1080 resolution image, the pixel coordinates can be (1200, 500), which means the position of the image 1200 pixels horizontally to the right and 500 pixels vertically downward from the upper left corner.
[0082] This involves updating pixel coordinates, which are coordinates of the pixel points after the depth information is updated.
[0083] Among them, the occlusion parameter is involved. The occlusion parameter is a quantitative indicator used to describe the degree to which the target object in the camera's field of view is blocked by other objects. The occlusion parameter can be a percentage or a continuous value from 0 to 1, where 0 means no blockage at all and 1 means full blockage. For example, if the occlusion ratio of the target object in the camera's field of view is 30%, then the occlusion parameter is 0.3, indicating that 30% of the target area is blocked by other objects.
[0084] In the steps involved in this embodiment, when the corresponding observation parameters include the observation angle of view, first, the multiple pixel coordinates corresponding to the multiple observation objects under the observation angle of view corresponding to each candidate camera are determined, then, with each candidate camera as the origin, the updated pixel coordinates corresponding to the corresponding multiple observation objects are determined, and then, based on the updated pixel coordinates corresponding to the corresponding multiple observation objects, the occlusion parameters corresponding to the multiple candidate cameras are determined, wherein the corresponding occlusion results are parameters of the degree of occlusion of the corresponding target object, and finally, based on the occlusion parameters corresponding to the multiple candidate cameras, a target camera suitable for inspecting the target object is determined from the multiple candidate cameras.
[0085] By determining multiple pixel coordinates corresponding to multiple observation objects when the corresponding observation parameters include the observation angle of view, the occlusion situation of each pixel level of the target object can be accurately determined. Therefore, by determining a target camera suitable for inspecting the target object from multiple candidate cameras according to the occlusion parameters corresponding to the multiple candidate cameras, it can be ensured that the selected camera can provide the best field of view of the target object and avoid monitoring blind spots caused by poor viewing angle or occlusion.
[0086] As an optional embodiment, taking each candidate camera as the origin, determining the updated pixel coordinates corresponding to the corresponding multiple observation objects, including: determining the initial depth indices corresponding to the corresponding multiple pixel coordinates based on the multiple pixel coordinates corresponding to the multiple observation objects; determining the target depth indices corresponding to the multiple preset pixel coordinates based on the initial depth indices corresponding to the corresponding multiple pixel coordinates; determining the updated pixel coordinates corresponding to the corresponding multiple observation objects based on the target depth indices corresponding to the multiple preset pixel coordinates.
[0087] In this embodiment, the specific steps of determining the updated pixel coordinates corresponding to the corresponding multiple observation objects respectively with each candidate camera as the origin are described.
[0088] Among them, an initial depth index is involved, which is pre-set and used to represent the depth information of each observed object (such as a part of a power facility or a specific point) at its pixel coordinate position in the current field of view of the camera. The depth information describes the distance of the object from the camera at the pixel position, which can be determined based on the focal length of the camera and the actual physical distance of the object. The initial depth index can be set to a maximum value, indicating infinity. The depth index represents the depth information of each observed object (such as a part of a power facility or a specific point) at its pixel coordinate position in the current field of view of the camera.
[0089] Among them, the target depth index is involved, which is the depth information of each observed object in the physical space and its distance from a specific camera. The target depth index is used to determine whether the initial depth index corresponding to each pixel in the observed object needs to be updated. For example, if the initial depth index is set to a maximum value, indicating infinity, then if the target depth index is less than the initial depth index, it means that the pixel is closer to the camera position, and the initial depth index of the pixel is changed to the target depth index.
[0090] In the steps involved in this embodiment, first, based on the multiple pixel coordinates corresponding to the multiple observed objects, the initial depth indices corresponding to the corresponding multiple pixel coordinates are determined, then, based on the initial depth indices corresponding to the corresponding multiple pixel coordinates, the target depth indices corresponding to the multiple preset pixel coordinates are determined, and finally, based on the target depth indices corresponding to the multiple preset pixel coordinates, the updated pixel coordinates corresponding to the corresponding multiple observed objects are determined.
[0091] Through the above steps, by determining the depth index and updating the pixel coordinates, it is possible to accurately determine the distance of each object from the camera in the observation area at the pixel level, and then accurately analyze whether there is any obstruction when using a certain camera to inspect the target object, which helps to improve the inspection effect.
[0092] As an optional embodiment, controlling a target camera to perform an inspection and obtaining an inspection result includes: determining a viewing angle vector of the target camera and a center vector of the target object, wherein the viewing angle vector is a vector used to characterize the lens orientation of the target camera, and the center vector is a vector used to characterize the orientation of the target object; determining adjustment parameters of the target camera based on the viewing angle vector of the target camera, preset spatial coordinates and field of view parameters, and the center vector of the target object and the target spatial coordinates; adjusting the orientation angle of the target camera based on the adjustment parameters; and controlling the target camera after adjusting the orientation angle to perform an inspection and obtain an inspection result.
[0093] In this embodiment, specific steps of controlling a target camera to perform inspection and obtain inspection results are described.
[0094] Among them, a viewing angle vector is involved, which is used to indicate the direction in which the camera lens is pointing. The viewing angle vector reflects the observation axis of the camera in three-dimensional space.
[0095] Among them, a center vector is involved, which is a vector used to describe the orientation of the target object and can be used to determine the position of the target in the camera field of view.
[0096] Among them, adjustment parameters are involved, which are determined based on the viewing angle vector of the target camera, preset spatial coordinates and field of view parameters, as well as the center vector and target spatial coordinates of the target object. The parameters required for the camera to aim at the target object and provide the best field of view.
[0097] In the steps involved in this embodiment, first, the viewing angle vector of the target camera and the center vector of the target object are determined, wherein the viewing angle vector is a vector used to characterize the lens orientation of the target camera, and the center vector is a vector used to characterize the orientation of the target object. Next, based on the viewing angle vector of the target camera, preset spatial coordinates and field of view parameters, as well as the center vector and target spatial coordinates of the target object, the adjustment parameters of the target camera are determined. Then, based on the adjustment parameters, the orientation angle of the target camera is adjusted. Finally, the target camera after adjusting the orientation angle is controlled to perform inspection to obtain the inspection result for the target object.
[0098] By determining the viewing angle vector and the center vector, the camera can be accurately aimed at the target object, avoiding monitoring blind spots caused by improper camera position or angle. The adjustment parameters of the target camera are determined by comprehensively considering the viewing angle vector of the target camera, the preset spatial coordinates and field of view parameters, as well as the center vector and target spatial coordinates of the target object, ensuring that the target camera can provide the best field of view coverage and image clarity during inspection, thereby improving the reliability and accuracy of the inspection results.
[0099] Based on the above embodiments and optional embodiments, an optional implementation is provided, which is described in detail below.
[0100] In the related art, when the traditional online inspection method is used for online inspection, due to the complexity of the inspection environment, the uncertainty of the inspection requirements, the dependency on preset positions, etc., it leads to the technical problem that the camera cannot be quickly located during the non-preset position inspection.
[0101] To address the above-mentioned problems, no effective solution has been proposed yet.
[0102] In view of this, an optional embodiment of the present invention provides an object inspection method, which can also be called a method for non-preset position inspection of a rotatable camera, which can solve the technical problem in the related art that the camera cannot be quickly positioned during non-preset position inspection.
[0103] Figure 2 is a flow chart of non-preset position inspection of a rotatable camera in an optional embodiment of the present invention, Figure 3 is a flowchart of the optimal field of view algorithm matching camera in an optional implementation manner of the present invention, such as Figure 2 ,as well as Figure 3 As shown, a detailed description is given below.
[0104] S1: Use 3D point cloud laser scanner to construct 3D point cloud data of substation.
[0105] 3D point cloud data refers to a data set consisting of a large number of independent points in three-dimensional space, which captures the surface position information of an object or environment.
[0106] Use 3D point cloud laser scanner to construct 3D point cloud data of substation. Since substation has many devices and complex environment, high-precision and large-range scanning equipment is generally used. At the same time, high-precision data is also conducive to later data processing, equipment positioning, spatial calculation, etc. The 3D point cloud file information of substation includes point cloud coordinates, color (RGB), intensity, classification, etc.
[0107] S2: Preprocess the collected three-dimensional point cloud data of the substation. Since the effect of point cloud data preprocessing directly affects the subsequent data analysis and calculation, point cloud preprocessing is one of the steps in utilizing point cloud data. Preprocessing includes removing noise points based on the median filtering algorithm, performing point cloud smoothness processing based on the Gaussian filtering algorithm, dividing objects and regions based on the voxel segmentation algorithm, aligning and splicing multiple point cloud data based on the feature and global optimization registration algorithm, and converting the coordinate system of the point cloud data to the standard coordinate system (WGS84) based on the center normalization algorithm, and finally forming a global point cloud data set. The point cloud data preprocessing of the present invention is implemented based on the open source PCL C++ library.
[0108] S3: Based on Three.js and VUE, three-dimensional point cloud data loading and web page browsing interaction are realized. From loading to rendering, the Three.js model needs to go through the steps of model downloading, serializing the model, mesh parsing, writing to cache and rendering the model. When loading a relatively large model, it will load slowly or freeze. The present invention adopts a step-by-step loading solution. When the model is loaded, the first layer of grids is traversed first, all grids are hidden, and then these grids are looped. The rendering method is executed once each time one is displayed. In this way, a large freeze can be dispersed into multiple small fragments, and the instantaneous loading and rendering pressure of the front end is reduced. In order to shorten the first screen rendering time, the shader (steamdeck) is pre-cached, and the results of the shader compilation are persisted. As long as the results of the shape key compilation of each grid are stored, the page loading time is shortened. After the three-dimensional point cloud data is loaded, the browsing and interactive functions of the three-dimensional scene can be realized through the web page.
[0109] S4: Construct a rotatable camera field of view model.
[0110] The main parameters of the rotatable camera (same as the field of view parameters mentioned above) include horizontal rotation range, vertical rotation range, lens size, magnification, and focal length.
[0111] The camera field of view model mainly includes the definition of field of view range, magnification and object-image distance, focal length and object-image distance, and distance.
[0112] (1) The field of view (same as the above angle parameters) includes:
[0113] 1) The horizontal field of view HFOV1 is:
[0114]
[0115] 2) The vertical field of view HFOV2 is:
[0116]
[0117] 3) The diagonal field of view HFOV3 is:
[0118]
[0119] Among them, w is the lens width, f is the focal length, and h is the lens height (which can also be regarded as the height of the object image).
[0120] (2) The relationship between focal length f and object distance to image distance (same as the focal length parameter above) is expressed as:
[0121]
[0122] Among them, u is the object distance and v is the image distance.
[0123] (3) The relationship between the magnification z and the object distance and the image distance (same as the magnification parameter above) is expressed as:
[0124]
[0125] Among them, I A is the size of the object on the image, I B is the size of the object on the object.
[0126] (4) The expression of distance D (same as the object distance parameter mentioned above) is:
[0127]
[0128] Among them, f is the focal length and H is the actual height of the object.
[0129] Step 5: Determine the spatial installation position and orientation of the camera in the 3D point cloud, and associate the actual camera (same as the initial camera mentioned above).
[0130] (1) By adding three points (point C A , point C B , point C c ) represents the installation position of the camera (same as the preset spatial coordinates above):
[0131] C A (Cx1,Cy1,Cz1),C B (Cx2,Cy2,Cz2),C c (Cx3,Cy3,Cz3),
[0132] Among them, Cx1, Cx2, Cx3 are point C A , point C B , point C c The horizontal coordinates of point C are Cy1, Cy2, and Cy3 respectively. A , point C B , point C c The vertical coordinates of point C, Cz1, Cz2, and Cz3 are A , point C B , point C c The depth direction coordinate of .
[0133] (2) The initial orientation of the camera uses the normal vector Cen (same as the viewing angle vector mentioned above). This normal vector points to the direction of the camera lens center line of sight, that is, the front direction of the camera. The formula is as follows:
[0134] Cen=[(Cy2-Cy1)(Cz3-Cz1)-(Cy3-Cy1)(Cz2-Cz1),
[0135] (Cz2-Cz1)(Cx3-Cx1)-(Cz3-Cz1)(Cx2-Cx1),
[0136] (Cx2-Cx1)(Cy3-Cy1)-(Cx3-Cx1)(Cy2-Cy1)]
[0137] (3) After the position and orientation are confirmed, the actual camera can be associated by directly accessing the camera video stream, and the camera real-time video can be browsed on the web page.
[0138] S6: Select any point in the three-dimensional space (same as the target object mentioned above).
[0139] The arbitrary point method also uses three points to confirm a surface. Click three points (points T A , click T B , click T c ), the system automatically obtains the spatial coordinates of the target object (same as the above target spatial coordinates):
[0140] T A (Tx1,Ty1,Tz1),T B (Tx2,Ty2,Tz2),T c (Tx2,Ty2,Tz2).
[0141] Among them, Tx1, Tx2, and Tx3 are point T A , point T B , point T c The horizontal coordinates of point T are Ty1, Ty2, and Ty3 respectively. A , point T B , point T c The vertical coordinates of point T are Tz1, Tz2, and Tz3. A , point T B , point T c The depth direction coordinate of .
[0142] At the same time, the system automatically calculates the normal vector Tar (same as the center vector above) of the surface corresponding to any point:
[0143] Tar=[(Ty2-Ty1)(Tz3-Tz1)-(Ty3-Ty1)(Tz2-Tz1),
[0144] (Tz2-Tz1)(Tx3-Tx1)-(Tz3-Tz1)(Tx2-Tx1),
[0145] (Tx2-Tx1)(Ty3-Ty1)-(Tx3-Tx1)(Ty2-Ty1)].
[0146] The coordinates and normal vector of any point determined in this way are the positioning field of view, and the camera is required to automatically view the position.
[0147] S7: Automatically calculate and select the most suitable camera (same as the candidate cameras mentioned above) based on the optimal field of view algorithm.
[0148] The optimal field of view algorithm uses a traversal method to find the target camera with the optimal distance and field of view.
[0149] Based on the camera model constructed by S4, first calculate the distance between the coordinates of the arbitrary point and all cameras (the same as the above-mentioned spatial distance parameters). Suppose there are two points PA and PB, which are PA (Px1, Py1, Pz1) and PB (Px2, Py2, Pz2) respectively.
[0150] Among them, PA is the coordinate of any point, PB is the coordinate of the camera, Px1 and Px2 are the horizontal coordinates of PA and PB respectively, Py1 and Py2 are the vertical coordinates of PA and PB respectively, and Pz1 and Pz2 are the depth coordinates of PA and PB respectively.
[0151] Then the distance d between these two points can be expressed as:
[0152]
[0153] The camera with the shortest distance is selected (same as the alternative cameras mentioned above). If there are multiple cameras with the same distance, the calculation is performed in parallel.
[0154] Then the field of view matching calculation is performed, including whether the camera rotation direction, magnification and object-image distance, focal length and object-image distance can meet the field of view.
[0155] Determine the actual selected camera:
[0156] 1) Expression of the relationship between focal length and object distance and image distance
[0157] 2) The relationship between magnification and object distance and image distance
[0158] 3) Distance Whether any point is within the visible range.
[0159] If there is no match, the next camera with the shortest distance is calculated according to the distance calculation order, and the appropriate camera is matched again.
[0160] S8: Calculate whether the selected camera's field of view is blocked based on the field of view occlusion algorithm.
[0161] The method of judging occlusion by corresponding any point with the center point of the camera has a great disadvantage. The arbitrary point to be observed is a surface, and the field of view of the camera is also a surface. Through the point-to-point method, it is impossible to accurately judge whether the field of view is covered.
[0162] The present invention uses a depth comparison algorithm to implement surface diagnostic calculations. First, an observation distance range Den (same as the above observation parameters) is constructed based on the field of view model of the camera and the surface constructed by any point. All objects within this observation distance range Den (same as the above observation object) are initialized, that is, the depth of all point clouds of objects within this distance range is set to a maximum value (same as the above initial depth index), representing infinity, and stored in the depth cache. Then, the objects within the observation distance range are scanned and converted into pixel representation (x, y) (same as the above pixel coordinates), and the depth of each pixel (x, y) covered by the object is calculated to obtain Z (x, y) (same as the above target depth index).
[0163] Among them, x and y represent the horizontal coordinate and vertical coordinate of the pixel respectively, and Z(x, y) represents the depth coordinate of the pixel.
[0164] If Z(x,y) is less than the initial value of the depth buffer, it means that the surface corresponding to the current pixel is closer to the camera than the previously stored surface, so it is necessary to update the color value in the frame buffer with the color value of the current pixel, and update the depth value in the depth buffer with Z(x,y). If Z(x,y) is greater than or equal to the value in the depth buffer, no update is performed.
[0165] Repeat the above steps, and perform the above depth calculation and comparison update process for all polygons to be rendered and each pixel they cover, and finally determine whether there is a point cloud with Z(x, y) less than the initial value of the depth buffer within an observation distance range Den and the field of view. If so, it is determined to be occluded.
[0166] S9: After determining the camera with the best field of view (the same as the target camera mentioned above), adjust the corresponding parameters of the camera (the same as the adjustment parameters mentioned above) to make the field of view of any point optimal.
[0167] Based on the spatial coordinates of any point T A (Tx1,Ty1,Tz1),T B (Tx2,Ty2,Tz2),T c (Tx2, Ty2, Tz2) and normal vector Tar, optimal camera space coordinate C A (Cx1,Cy1,Cz1),C B (Cx2,Cy2,Cz2),C c(Cx3, Cy3, Cz3), and the initial orientation normal vector Cen, combined with the camera's horizontal rotation range, vertical rotation range, lens size, magnification, and focal length calculation, the camera orientation, magnification, focal length and other parameters can be adjusted.
[0168] The rotation offset is calculated as follows:
[0169]
[0170] Ratio calculation:
[0171]
[0172] Among them, x set is the target horizontal offset, y set is the target vertical offset, x offset is the default horizontal offset of the camera in the actual physical space, y offset is the default vertical offset of the camera in the actual physical space, fov_x is the horizontal field of view of the camera (that is, the angle range that the camera can capture in the horizontal direction), and fov_y is the vertical field of view of the camera (that is, the angle range that the camera can capture in the vertical direction).
[0173] Finally, check the real-time video of the camera through the web page to confirm the adjustment of the camera with the best field of view.
[0174] After the training and learning of the above steps, a non-preset position inspection of a rotatable camera based on the optimal field of view algorithm is formed, thereby realizing efficient call of cameras for non-preset position scenes and achieving fast and flexible inspection.
[0175] Through the above optional implementation, at least the following beneficial effects can be achieved:
[0176] (1) Compared with the related art, the present invention can achieve the specific positions of the target object and the multiple initial cameras in the field where the target object is located by determining the target spatial coordinates of the target object and the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras respectively; by determining multiple candidate cameras from the multiple initial cameras according to the target spatial coordinates and the preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras respectively, it is ensured that the selected candidate cameras have the ability to cover the target object, thereby improving the accuracy of camera selection; by using the observation parameters corresponding to the multiple candidate cameras respectively, the target camera is determined from the multiple candidate cameras, wherein the observation parameters are parameters used to characterize the observation range of the corresponding candidate camera, and the observation range includes the target object, thereby ensuring that the selected target camera can provide the best observation effect of the target object, while avoiding indiscriminate calling of all candidate cameras; by controlling the selected target camera to perform the actual inspection task, the tedious process of manually controlling the camera is avoided, the efficiency and accuracy of the inspection are improved, and thus the technical problem of the related art that the camera cannot be quickly located in the non-preset position inspection is solved.
[0177] (2) Compared with the related art, the present invention sets a distance threshold to screen candidate cameras, thereby reducing the amount of calculation for subsequent field of view parameter matching, effectively avoiding unnecessary calls to cameras that are far away or whose field of view cannot cover the target, and improving the efficiency of camera selection. Based on the field of view parameters, the ability of the camera to cover the target object can be accurately evaluated to ensure that the candidate camera finally selected can provide high-quality images. By considering the spatial distance parameter and the field of view parameter, the present invention can overcome the problem of fixed camera coverage in traditional preset position monitoring and realize flexible monitoring of targets in non-preset positions.
[0178] (3) Compared with the related art, the present invention can overcome the limitation of fixed camera position and field of view in traditional preset position monitoring by evaluating the field of view parameters of the camera from multiple dimensions of angle parameters, magnification parameters, focal length parameters and object distance parameters corresponding to multiple initial cameras, and realize flexible monitoring of any target position. Based on angle parameters, magnification parameters, focal length parameters and object distance parameters, it is helpful to reasonably allocate camera resources, avoid calling cameras that are inefficient or ineffective even if they can cover the target, and improve inspection efficiency.
[0179] (4) Compared with the related art, the present invention can accurately locate the target object and determine the observation direction by determining the observation point and the observation plane, ensuring that the camera's field of view can cover the key parts of the target object. According to the observation requirements of the target object and the field of view parameters of the candidate cameras, it can ensure that the camera can provide the best observation effect, such as clear field of view and complete coverage. Especially in non-preset position inspections, the observation point and plane are determined to adapt to the uncertainty of the target object's position. Even if the target is not in the preset position, the angle and distance most suitable for monitoring the target object can be found through adjustment, thereby improving the accuracy of camera selection and inspection efficiency.
[0180] (5) Compared with the related art, the present invention can accurately determine the distance of each object from the camera in the observation area from the pixel level by determining the depth index and updating the pixel coordinates, and can then accurately analyze whether there is any obstruction when a certain camera is used to inspect the target object, thereby ensuring that the selected camera can provide the best field of view for the target object and avoiding monitoring blind spots caused by poor viewing angles or obstructions, thereby helping to improve the inspection effect.
[0181] (6) Compared with the related art, the present invention provides a non-preset inspection mode based on point cloud space calculation. If needed temporarily or in an emergency, it can quickly find the corresponding camera and automatically adjust the field of view and distance, so as to realize the mobile and rapid inspection of the camera outside the preset position. The optimal field of view and occlusion algorithm adopted by the present invention uses a traversal method to find the target camera with the optimal distance and field of view; the depth comparison algorithm is used to determine whether the target object surface is blocked, so as to solve the field of view occlusion problem of the camera selected based on the point-to-point field of view occlusion algorithm calculation, and effectively improve the practicality.
[0182] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0183] 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 is essentially 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, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0184] Example 2
[0185] According to an embodiment of the present invention, a device for implementing the above object inspection method is also provided. Figure 4 is a structural block diagram of an object inspection device according to an embodiment of the present invention. Figure 4 As shown, the device includes: a receiving module 402, a responding module 404, a first determining module 406, a second determining module 408 and a third determining module 410. The device is described in detail below.
[0186] A receiving module 402 receives an inspection instruction, wherein the inspection instruction carries an identifier of a target object to be inspected; a response module 404 is connected to the above-mentioned receiving module 402, and determines the target space coordinates of the target object identifier, as well as preset space coordinates and field of view parameters corresponding to multiple initial cameras respectively, in response to the inspection instruction, wherein the field of view parameters are parameters used to characterize the field of view of the initial camera; a first determination module 406 is connected to the above-mentioned response module 404, and determines multiple candidate cameras from multiple initial cameras based on the target space coordinates, and the preset space coordinates and field of view parameters corresponding to the multiple initial cameras respectively; a second determination module 408 is connected to the above-mentioned first determination module 406, and determines a target camera from multiple candidate cameras based on observation parameters corresponding to the multiple candidate cameras respectively, wherein the observation parameters are parameters used to characterize the observation range of the candidate camera, and the observation range includes the target object identifier; a third determination module 410 is connected to the above-mentioned second determination module 408, and controls the target camera to perform an inspection to obtain an inspection result.
[0187] It should be noted here that the above-mentioned receiving module 402, response module 404, first determination module 406, second determination module 408 and third determination module 410 correspond to steps S102 to S110 in the object inspection method, and the instances and application scenarios implemented by the multiple modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0188] Example 3
[0189] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement any of the above object inspection methods.
[0190] Example 4
[0191] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned object inspection methods.
[0192] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0193] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0195] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0196] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0197] If the integrated 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 technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0198] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for inspecting an object, characterized in that: include: receiving an inspection instruction, wherein the inspection instruction carries an identifier of a target object to be inspected; In response to the inspection instruction, determining the target space coordinates of the target object corresponding to the target object identifier, and the preset space coordinates and field of view parameters corresponding to the plurality of initial cameras, wherein the field of view parameters are parameters used to characterize the field of view range of the corresponding initial camera; Determining a plurality of candidate cameras from the plurality of initial cameras according to the target space coordinates and the preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras; Determining a target camera from the plurality of candidate cameras based on observation parameters corresponding to the plurality of candidate cameras, wherein the observation parameters are parameters used to characterize an observation range of the corresponding candidate camera, and the observation range includes the target object; Control the target camera to perform inspection and obtain inspection results.
2. The method according to claim 1, characterized in that The determining of a plurality of candidate cameras from the plurality of initial cameras based on the target space coordinates and the preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras comprises: Determining spatial distance parameters corresponding to the multiple initial cameras respectively based on the target spatial coordinates and the preset spatial coordinates corresponding to the multiple initial cameras respectively; Determining a plurality of candidate cameras according to the spatial distance parameters corresponding to the plurality of initial cameras, wherein the candidate cameras are initial cameras whose spatial distance parameters are less than a predetermined distance threshold; Determining field of view parameters corresponding to the multiple candidate cameras respectively; A plurality of candidate cameras are determined from the plurality of candidate cameras according to the target space coordinates and the preset space coordinates and field of view parameters respectively corresponding to the plurality of candidate cameras.
3. The method according to claim 1, characterized in that Determining the field of view parameters corresponding to the multiple initial cameras respectively includes: Determining angle parameters, magnification parameters, focal length parameters, and object distance parameters corresponding to the multiple initial cameras, respectively, wherein the angle parameter is a parameter used to characterize the rotation angle of the initial camera, the magnification parameter is a parameter used to characterize the size ratio between the target object and the image of the target object in the initial camera, the focal length parameter is a parameter used to characterize the observation clarity of the initial camera, and the object distance parameter is a parameter used to characterize the observation distance of the initial camera; The preset spatial coordinates and field of view parameters corresponding to the multiple initial cameras are determined according to the angle parameter, the magnification parameter, the focal length parameter, and the object distance parameter.
4. The method according to claim 1, wherein Before determining the target camera based on the observation parameters corresponding to the plurality of candidate cameras, the method further includes: Determining a plurality of observation points corresponding to the target object; Determining an observation plane corresponding to the target object based on a plurality of observation points corresponding to the target object; Observation parameters corresponding to the multiple candidate cameras are determined based on the observation plane corresponding to the target object and the field of view parameters corresponding to the multiple candidate cameras.
5. The method according to claim 1, characterized in that The step of determining a target camera based on observation parameters corresponding to the plurality of candidate cameras includes: In a case where the corresponding observation parameters include an observation angle, determining a plurality of pixel coordinates corresponding to a plurality of observation objects under the observation angle corresponding to each candidate camera; Taking each candidate camera as the origin, determining the updated pixel coordinates corresponding to the corresponding plurality of observed objects; Determining occlusion parameters corresponding to the plurality of candidate cameras respectively according to the updated pixel coordinates corresponding to the plurality of observed objects, wherein the corresponding occlusion results are parameters indicating the degree of occlusion of the corresponding target objects; The target camera is determined from the multiple candidate cameras according to the occlusion parameters respectively corresponding to the multiple candidate cameras.
6. The method according to claim 5, characterized in that The determining of updated pixel coordinates corresponding to each of the plurality of observed objects with each candidate camera as the origin includes: Determining initial depth indices corresponding to the plurality of pixel coordinates, respectively, based on the plurality of pixel coordinates corresponding to the plurality of observed objects; Determining target depth indices corresponding to a plurality of preset pixel coordinates respectively according to the initial depth indices respectively corresponding to the plurality of pixel coordinates; According to the target depth indices respectively corresponding to the plurality of preset pixel coordinates, updated pixel coordinates respectively corresponding to the plurality of observed objects are determined.
7. The method according to any one of claims 1 to 6, characterized in that The controlling the target camera to perform inspection and obtain inspection results includes: Determining a viewing angle vector of the target camera and a center vector of the target object, wherein the viewing angle vector is a vector used to represent the lens orientation of the target camera, and the center vector is a vector used to represent the orientation of the target object; Determining adjustment parameters of the target camera based on the viewing angle vector of the target camera, the preset spatial coordinates and the field of view parameters, and the center vector and target spatial coordinates of the target object; Adjusting the orientation angle of the target camera according to the adjustment parameter; Control the target camera after adjusting the direction angle to conduct inspection and obtain the inspection results.
8. An object inspection device, characterized in that: include: A receiving module receives an inspection instruction, wherein the inspection instruction carries an identifier of a target object to be inspected; a response module, in response to the inspection instruction, determining the target space coordinates of the target object corresponding to the target object identifier, and preset space coordinates and field of view parameters corresponding to the plurality of initial cameras, wherein the field of view parameters are parameters used to characterize the field of view range of the initial camera; a first determining module, which determines a plurality of candidate cameras from the plurality of initial cameras based on the target space coordinates and preset space coordinates and field of view parameters respectively corresponding to the plurality of initial cameras; a second determining module, configured to determine a target camera from the plurality of candidate cameras based on observation parameters corresponding to the plurality of candidate cameras, wherein the observation parameters are parameters used to characterize an observation range of the candidate cameras, and the observation range includes the target object; The third determining module controls the target camera to perform inspection and obtains the inspection result.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the object inspection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the object inspection method according to any one of claims 1 to 7.