A method and system for quickly building a machine vision environment
By introducing obstacles sensors and dual -road indicators, combined with two -way contour clamping and key feature sequences, the problem of poor visual flexibility of the machine, the efficiency of rapid environmental construction and target division, improvement accuracy.
Patent Information
- Application Number
- CN202111157043.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Machine vision has poor flexibility and is difficult to adapt to the objective world of complex and diverse nature. Especially when light changes, shadows and backgrounds are unstable, false targets are easily detected and affect target extraction.
By introducing obstacles sensors, real -time detection and identification targets, and controlling the camera based on environmental parameters, obtaining initial images. The target segmentation is used to use dual -way indications control and two -way contours to reduce the division difficulty of identifying targets, and to determine environmental changes through key feature sequences, and the rapid construction of environmental parameter reconstruction and software and hardware environment.
Without increasing more software and hardware expenses, the calculation quantity and computing complexity are reduced, the flexibility and accuracy of the machine vision can be improved, and the environmental changes and scene reconstruction can be adapted to the environment.
Smart Images

Figure CN113902888B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision, and in particular to a method and system for quickly constructing a machine vision environment. Background Art
[0002] On the one hand, robots integrate modern industrial manufacturing technology, information control technology and new material technology, and are representative products of intelligent manufacturing. Their research and development, production and application are important indicators of a country's scientific and technological innovation capabilities and manufacturing level, and have attracted great attention from the world's manufacturing powers. On the other hand, artificial intelligence technology is developing rapidly, and its commercialization speed has exceeded expectations, especially in image and video analysis and processing. Machine vision is a rapidly developing branch of artificial intelligence. Simply put, machine vision is to use machines instead of human eyes to make measurements and judgments.
[0003] With the development of information technology, the research on computer vision and image processing related topics has been continuously deepened, and its application fields have been continuously expanded, from digital cameras that can automatically locate faces to unmanned smart cars, from high-resolution remote sensing satellite image analysis to microscopic image recognition technology, all of which have been widely studied. Machine vision is a comprehensive technology. The most basic feature is to improve the flexibility and automation of production. In some dangerous working environments that are not suitable for manual operations or where artificial vision cannot meet the requirements, machine vision is often used to replace artificial vision. At present, the application scope of machine vision covers various industries of the national economy such as industry, agriculture, medicine, military, aerospace, meteorology, astronomy, public security, transportation, security, scientific research, etc., bringing subversive changes to the entire society. In recent years, machine vision has been widely used in industrial manufacturing, artificial intelligence and other increasingly intelligent industries as a convenient, fast and stable detection method. Using machine vision as a monitoring and detection system greatly reduces labor and saves costs. At the same time, it also has high accuracy and stability, which makes machine vision go further and further in manufacturing and application.
[0004] Although machine vision has made great progress, it is still simple and crude compared to biological vision systems. It lacks reverse feedback mechanisms and information fusion capabilities, and cannot adapt to the complexity and diversity of the objective world. The main problem is that machine vision is heavily dependent on the scene built for the vision. In other words, what kind of scene is built for the vision will determine what kind of vision it can achieve and what it can see clearly. This will lead to a worse flexibility of machine vision. Even the combined effects of camera shaking, dynamic background, etc. will cause changes in the objective world that machine vision can understand. For example, changes in lighting, shadows, and unstable backgrounds will detect false targets and affect target extraction. However, if the system components are readjusted or the hardware and software systems are reconstructed every time a problem occurs, the efficiency of the machine working shoes will be greatly reduced. Therefore, how to improve the flexibility of machine vision without increasing more hardware and software overhead is a problem to be solved. The beneficial effects of the present invention are: (1) Introducing target sensors into environmental control greatly reduces the amount and complexity of calculation while increasing system overhead to a limited extent; (2) Through dual-path indication control supported by direct-connection paths, control errors that may be caused by controller communication delays are avoided; (3) Target segmentation is performed by bidirectional contour clamping, which utilizes the characteristics of machine vision objects and environments and reduces the difficulty of segmenting targets; (4) Based on the simplified feature regions and the key feature sequences corresponding to the diversified significant features, it is judged whether environmental changes have occurred, and further provides a quantitative basis for environmental parameter reconstruction and the rapid construction of the entire hardware and software environment. Summary of the invention
[0005] In order to overcome the above defects, the present invention proposes a method and system for quickly constructing a machine vision environment.
[0006] In a first aspect, a method for quickly constructing a machine vision environment is provided, the method comprising the following steps:
[0007] Step I: Obstacle sensor detects and identifies the target in real time;
[0008] Step II: Turning on the camera based on detecting the identified target.
[0009] Furthermore, the obstacle sensor is an infrared sensor.
[0010] Furthermore, when an obstacle is detected ahead, the obstacle sensor sends an obstacle indication to the controller.
[0011] Furthermore, after receiving the obstacle indication, the controller sends an opening indication based on the environmental parameters to control the camera shutter to open, and the camera acquires an initial image.
[0012] Furthermore, the obstacle sensor sends obstacle indications to the control and the camera simultaneously.
[0013] Further, after receiving the obstacle indication and / or the opening indication, the camera opens the shutter and acquires the initial image.
[0014] In a second aspect, a system for rapidly constructing a machine vision environment is provided, the system comprising:
[0015] Obstacle sensor, light source, camera, target recognition and controller; the controller is in communication connection with the light source and camera;
[0016] The system is used to execute the method for rapidly constructing a machine vision environment.
[0017] Furthermore, the obstacle sensor is used to detect the presence of an identification target.
[0018] Furthermore, the controller is used to receive obstacle sensor and camera information, and control the obstacle sensor, light source, and camera based on the information.
[0019] According to a third aspect, a device for rapidly constructing a machine vision environment is provided, wherein the device is used to execute the method for rapidly constructing a machine vision environment.
[0020] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0021] (1) Introducing target sensors into environmental control greatly reduces the amount of calculation and complexity while increasing system overhead to a limited extent; (2) Through dual-path indication control supported by direct-connection paths, control errors that may be caused by controller communication delays are avoided; (3) Target segmentation is performed through the bidirectional contour clamping method, which utilizes the characteristics of machine vision objects and the environment and reduces the difficulty of target segmentation; (4) Based on the key feature sequence corresponding to the simplified feature region and the diversified significant features, it is judged whether the environmental change has occurred, and further provides a quantitative basis for the reconstruction of environmental parameters and the rapid construction of the entire hardware and software environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of an application scenario of the method for rapidly constructing a machine vision environment provided by the present invention;
[0023] Figure 2 It is a schematic diagram of the method for quickly constructing a machine vision environment provided by the present invention. DETAILED DESCRIPTION
[0024] The present invention provides a method and system for quickly constructing a machine vision environment, which will be described in detail below in conjunction with the accompanying drawings;
[0025] As attached Figure 1 As shown, the machine vision environment rapid construction system includes: an obstacle sensor, a light source, a camera, a recognition target and a controller; the controller is connected to the light source and the industrial camera for communication;
[0026] The obstacle sensor is used to detect the presence of an identification target; the obstacle sensor is cheap and can reduce the identification overhead of the entire system; the obstacle sensor is an infrared sensor;
[0027] The controller is used to receive information from obstacle sensors and cameras, and control the obstacle sensors, light sources, cameras, etc. based on the information; the control is performed by sending instructions;
[0028] Preferably: sending instructions via wired or wireless means;
[0029] Preferably: the light source is one or more;
[0030] The recognition target is an object viewed by machine vision;
[0031] Preferably: the obstacle sensor is directly connected to the camera; when the obstacle sensor detects an obstacle, it sends an obstacle indication to the camera and also to the controller;
[0032] Preferably: a buffer space is set in the camera for storing a preset time length, and the preset time length is used for camera delay; the controller adjusts and calculates the preset time length based on environmental parameters, and performs camera delay based on the preset time length in real time, thereby adapting to environmental changes and performing rapid reconstruction of the environment;
[0033] In a first aspect, the present invention provides a method for quickly constructing a machine vision environment, as shown in the attached Figure 2 As shown, the method comprises the following steps:
[0034] Step S1: Obtain environmental parameters and make adjustments based on the environmental parameters;
[0035] The obtaining of environmental parameters is specifically: obtaining environmental parameters from the head position of the environmental parameter queue;
[0036] Preferably: based on the current environmental changes, an environmental parameter is selected from the first few positions of the queue to obtain; such environmental changes include time changes, time interval changes, etc.;
[0037] Preferably: each adjustable system component is provided with an environmental parameter queue; the environmental parameter queue may be provided in a buffer zone inside the system component, or in a buffer zone in the controller corresponding to the system component; then the present invention provides a basis for the rapid change of environmental parameters and the rapid construction of the equipment environment by means of a corresponding buffer queue, and the environmental parameter at the head of the queue is equivalent to the predicted optimal possible next adaptation environmental parameter;
[0038] Preferably: the length of the environment parameter queue is 2; the default environment parameter is placed at the end of the environment parameter queue;
[0039] The adjustment based on the environmental parameters is specifically: adjusting instructions to the system components to adjust the system components according to the environmental parameters; for example: adjusting the camera angle, resolution; adjusting the light intensity, angle, etc. of the light source;
[0040] Step S2: The obstacle sensor detects and identifies the target in real time;
[0041] Preferably: the obstacle sensor is an infrared sensor; when an obstacle is detected ahead, the obstacle sensor sends an obstacle indication to the controller;
[0042] Step S3: Turning on the camera based on detecting the identified target to obtain an initial image; specifically: after receiving the obstacle indication, the controller sends an opening indication based on the environmental parameters to control the camera shutter to open, and the camera obtains the initial image;
[0043] The method of controlling the camera shutter to open based on the environmental parameters is as follows: obtaining a preset time length in the environmental parameters, and after receiving the delayed preset time length, controlling the camera shutter to open to capture an image as the initial image;
[0044] Preferably: the obstacle sensor sends an obstacle indication to the controller and the camera at the same time, and the camera opens the shutter and acquires the initial image after receiving the obstacle indication and / or the opening indication; since the camera and the sensor are usually located in the same small communication range, the control error caused by the communication delay of the controller can be avoided by the dual-path indication control supported by the direct path; compared with the method of relying solely on image analysis to correct the image difference caused by the position offset in the prior art, the amount of calculation and the complexity of calculation are greatly reduced while the system overhead is limitedly increased;
[0045] Step S4: acquiring image features of the initial image and performing image segmentation to obtain a recognition target image;
[0046] Preferably, the segmentation is to segment the initial image in a clustering manner.
[0047] For machine vision, especially factory machine vision, the background is fixed and not often changed. The relatively fixed feature of the background can be utilized; therefore, alternatively, the step S4 specifically includes the following steps:
[0048] Step S41: Analyze the color space / grayscale space of the recognition target, extract the foreground space component HF that can highlight the recognition target; create a foreground template based on the foreground space component; and obtain a first contour based on the foreground template and the initial image;
[0049] For example: taking the average gray value as the foreground space component; performing color space clustering, selecting the color space vector corresponding to the cluster center of the largest cluster as the foreground space component, etc.;
[0050] Step S42: Analyze and identify the color space / grayscale space of the background, extract the background space component HB that can best highlight the background; create a background template based on the background space component; and obtain a second contour based on the background template and the initial image;
[0051] Step S43: acquiring a fuzzy area based on the first contour and the second contour; the fuzzy area is an inconsistent area of the recognition target determined by the first contour and the second contour;
[0052] Step S44: Determine the depth blur region by bidirectional clustering; randomly select multiple first center points from the blur region; the first center point is closer to the background than to the color space / grayscale space of the recognition target; the second center point is closer to the recognition target than to the color space / grayscale space of the background; clustering is performed with the multiple first center points as the center; and multiple first connected domains corresponding to the clustering are formed; clustering is performed with the multiple second center points as the center; and multiple second connected domains corresponding to the clustering are formed; the blur region after removing the first connected domain and the second connected domain is used as the depth blur region;
[0053] Preferably: when the area of the depth blur region is smaller than the threshold, the segmentation ends; at this time, the segmentation of the identified target is performed based on the first connected domain, the second connected domain, the first contour and the second contour; for example: the first connected domain is attributed to the background and the second connected domain is attributed to the target;
[0054] Step S45: eliminating the depth blurred area; a simple approach is to directly use the depth blurred area as the background area; of course, the above step S44 can be performed again to amplify the clustering effect to eliminate the depth blurred area; or the depth blurred area can be directly discarded;
[0055] An alternative approach is: select calibration points in the second connected domain, connect the calibration points to form a calibration line, and extend the second connected domain along the calibration line to connect the plurality of second connected domains; the connection here is based on the order of coordinate positions; determine the depth fuzzy area of the calibration line toward the second connected domain as a part of the second connected domain, and determine the depth fuzzy area of another defense line as a part of the first connected domain;
[0056] Preferably, the extension is to extend the second connected domain along the calibration line when the calibration line passes through the depth fuzzy area; for example, to extend along the direction where the gradient change is smaller;
[0057] Preferably: the gradient direction is increased along the boundary between the depth fuzzy region and the first connected domain and / or the second connected domain, thereby expanding the size of the first connected domain and the second connected domain and reducing the size of the depth fuzzy region;
[0058] Starting from the intersection of the boundary of the second connected domain and the calibration line, extending along the gradient direction and / or the calibration line; preferably: the gradient is an N-order gradient direction; N=2; the extension here is an iterative process; thereby forming a bidirectional clamping;
[0059] Preferably, the calibration point is the cluster center of the cluster corresponding to the second connected domain, or the geometric center of the connected domain;
[0060] Step S5: adjusting the recognition target image and / or the initial image based on the target feature of the recognition target; specifically: performing rotation adjustment / stretching adjustment on the recognition target image and / or the initial image based on the color space / grayscale space data value of the recognition target image;
[0061] Specifically; obtaining the center position of the recognition target, dividing the recognition target image into U sub-regions in a specific division method, calculating the eigenvalue of each sub-region, and sorting the eigenvalues in the adjacent order of the sub-regions to form a eigenvalue sequence; comparing the eigenvalue sequence with the default eigenvalue sequence to determine the rotation angle / stretching method, and rotating / stretching the recognition target image and / or the initial image based on the rotation angle / stretching method; the default eigenvalue sequence here is obtained by standard image processing;
[0062] Preferably: the specific division method is to divide in a manner of radial lines with uniform angles centered on the geometric center;
[0063] Preferably, the specific division method is a multi-grid division method centered on the geometric center, where a large number of grids are obtained after division, and a representative grid is selected, and the representative grid is associated with the visual features of the identified target; that is, the features in the feature value sequence are about the representative grid;
[0064] The characteristic value sequence is compared with the default characteristic value sequence to determine the rotation angle, specifically: the characteristic value sequence is compared with multiple default characteristic value sequences, the most similar default characteristic value sequence is determined, and the rotation angle corresponding to the default characteristic value sequence is searched; the corresponding relationship between multiple default characteristic value sequences and their corresponding rotation angles is stored in advance; an optional method is: obtaining the characteristic value sequence corresponding to the recognition target at multiple positions under the current environmental parameter conditions and the rotation angle between the current position and the standard position;
[0065] The default eigenvalue sequence is obtained by the target image under the standard or default parameter environment; different parameter environments correspond to multiple different eigenvalue sequences; they can be associated and compared one by one;
[0066] The stretching adjustment can also be done in a similar way, so that the size of each mesh after stretching is close to the standard size;
[0067] Step S6: judging the environmental change, and determining the environmental parameter adjustment or scene reconstruction based on the change; specifically, comparing the key feature sequence corresponding to the specific area set in the rotated recognition target image and the default target image, and when the difference is small, proceeding to step S7, determining the environmental parameters that need to be adjusted based on the difference, and making system adjustments based on the adjusted environmental parameters, otherwise, proceeding to step S8;
[0068] Preferably: the difference is the difference in the amount of change and the type of change;
[0069] Determine a specific area set in the target image and the default target image; set a specific area set in advance according to the visual characteristics of the background and the recognition target; and determine the key features corresponding to the set according to the visual characteristics, and combine the key features corresponding to these sets in order to form a key feature sequence; for example: the characteristic of an area is that the color change is very strong, and its gradient change can be calculated as the key feature; the characteristic of an area is that the color is very dark, and its average gray value is calculated as the key feature; that is, the key features of each area in these feature sets can be the same or different; this method can submit efficiency with human participation, which is equivalent to the introduction of artificial intelligence;
[0070] Alternative: Divide the target image and the default target image into grids, select multiple specific grids as specific area sets, calculate the key features corresponding to them, and calculate which key features for which grid can be based on random allocation; the number of grids can be large, and in order to obtain significant features and to obtain enough features, it is necessary to obtain feature information of the object to be tested for the feature point extraction operator. The feature point extraction operator includes describing a feature point according to the grayscale change in the local area, and is used to extract feature points that are significantly different from the field pixels, such as corner points, origins, and other areas with large differences in grayscale distribution from the surrounding areas;
[0071] Preferably: the comparison of the key feature sequence is a comparison based on sequence distance calculation. Since each feature in the key feature sequence reflects different prominent characteristics, then based on the comparison of this item or the comparison difference of several items, it can be reflected whether an environmental parameter has changed. For example, if the average gray value of area 1 increases significantly, then it can be considered whether the light source conditions in the environment have changed. With the assistance of other key features, it can be determined that the environmental feature has changed, or has changed significantly; for example, if the gray values corresponding to multiple specific areas have increased significantly, or the average gray value of the entire target image has increased, and correspondingly, the camera angle has not changed, then it can be more certain that the light conditions of the light source have changed;
[0072] In summary, the comparison of key feature sequences is based on the comparison of the differences between each feature in the sequence. The environmental changes and the degree of change are discovered through the differences of one or more features, and the changes and the degree of change of the environmental features are determined by keeping other features unchanged. When the degree of change is large, the range of environmental parameters that need to be adjusted may be large, otherwise it is small. The relationship between the change and the adjustment amount can be determined based on experience or experiments, and the adjustment amount that needs to be adjusted can be obtained based on the query;
[0073] Making system adjustments based on the adjusted environmental parameters, specifically: obtaining the environmental parameters that have changed, and sending adjustment instructions to the system components corresponding to the environmental parameters; for example: adjusting the camera angle, resolution; adjusting the light intensity, angle, etc. of the light source;
[0074] Step S7: determining the environmental parameters that need to be adjusted, and adjusting the system components based on the adjusted environmental parameters;
[0075] Preferably: the key features include the size and position of the recognition target; the size of the recognition target in the recognition target image is compared with the size of the recognition target in the default target image, specifically: the area size of the recognition target in the rotationally adjusted target image is compared with that in the default target image, and the position of the recognition target in the initial image is compared with that in the default image, so as to determine whether the first environmental parameter has changed;
[0076] Preferably: the key feature includes a brightness space vector of a specific area of the recognition target; comparing the rotationally adjusted recognition target image and the default target image, and the brightness space vector of the recognition target therein, to determine whether the second parameter or the second parameter combination has changed;
[0077] Wherein: the first environmental parameter is: the preset time length required for delay; the second parameter is: one or more of: the camera angle, the light intensity and the brightness of the light source; wherein: the brightness space vector is the average brightness of multiple specific areas; the area position here is a relative position;
[0078] By analogy, based on such comparisons we can determine whether multiple environmental parameters have changed; of course, we can also make more accurate judgments based on changes in feature combinations. Of course, if artificial intelligence is introduced for judgment, it will definitely be more accurate, but what we need to do here is to quickly load the parameters of the perceived environment, that is, to adjust some parameters that can be solved on the spot, and make clear adjustments and improvements to the physical equipment in the system in a timely manner, without making more complex adjustment controls; but only make adjustments and controls when necessary;
[0079] The specific method of comparison here can be: divide the target image and the default target image into grids, and compare all the grids in order to determine the difference changes between the features of the two. When the difference changes greatly, it is determined that the environmental parameters have changed; otherwise, it is determined that the environmental parameters have not changed;
[0080] Preferably, the adjusting of the system components based on the adjusted environmental parameters is to write the adjusted environmental parameters into the environmental parameter queue corresponding to the system components; for example, writing into the head of the environmental parameter queue;
[0081] Step S8: quickly reconstruct the environment; specifically, the environment reconstruction is a multi-level environment reconstruction based on the change situation;
[0082] Preferred: When the change is large, it is reflected in that when the difference of one or more key feature combinations in the key feature sequence changes greatly, the scene is reconstructed; the features here are some key global features;
[0083] The multi-level environment reconstruction is a two-level environment reconstruction; the first level is the adjustment of the system component environment parameters; this has been executed in step 7; the second level is the reconstruction of the hardware and software system; for example: the obvious change of the key features of the recognition target leads to the change of the recognition target itself, after multiple recognition target confirmations, that is, after executing steps S1-S7, it enters step S8 multiple times, then it means that the recognition target has changed, and the machine vision recognition software and hardware environment parameters need to be reloaded; the system component environment parameters are reconfigured based on the recognition target, for example: initialized to the environment parameters corresponding to the current recognition target;
[0084] Preferably: the reconstruction of the hardware system includes replacing the camera and light source, etc.; and also includes updating the controller itself;
[0085] The software reconstruction includes: updating the controller control system and resetting the initial state of the system components to the initial state corresponding to the current recognition target;
[0086] The adjustment here is: writing the relevant adjustment data into the environment parameter queue in the parameter space of the system component;
[0087] Preferably: storing the adjusted environmental parameters at the head of the environmental parameter queue;
[0088] The terms "data processing apparatus", "data processing system", "user equipment" or "computing device" encompass all kinds of apparatus, devices and machines for processing data, including, for example, a programmable processor, a computer, a system on a chip, or a plurality or combination thereof. The apparatus can include dedicated logic circuits, such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). In addition to hardware, the apparatus may also include code that creates an execution environment for the computer program, for example, code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform operating environment, a virtual machine, or a combination of one or more of the above. The apparatus and execution environment may implement a variety of different computing model infrastructures, such as web services, distributed computing, and grid computing infrastructures.
[0089] A computer program (also referred to as a program, software, software application, script, or code) can be written in any form of a programming language, including an assembled or interpreted language, a declarative or procedural language, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, object, or other unit suitable for use in a computing environment. A computer program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program, or in multiple collaborative files (e.g., files storing one or more modules, subroutines, or code portions). A computer program can be deployed to execute on one computer or on multiple computers located at one site or distributed across multiple sites and interconnected by a communication network.
[0090] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0091] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for quickly constructing a machine vision environment, characterized in that: The method comprises the following steps: Step S1: Obtain environmental parameters; Step S2: The obstacle sensor detects and identifies the target in real time; Step S3: Turning on the camera based on the detected and identified target to obtain an initial image; specifically: after receiving the obstacle indication, the controller sends an opening indication based on the environmental parameters to control the camera shutter to open, and the camera obtains the initial image; Step S4: acquiring image features of the initial image and performing image segmentation to obtain a recognition target image; Step S41: Analyze the color space / grayscale space of the recognition target and extract the foreground space component HF that can highlight the recognition target; Creating a foreground template based on the foreground spatial component; Obtaining a first contour based on the foreground template and the initial image; Step S42: Analyze and identify the color space / grayscale space of the background, extract the background space component HB that can best highlight the background; and create a background template based on the background space component; Obtaining a second contour based on the background template and the initial image; Step S43: acquiring a fuzzy area based on the first contour and the second contour; the fuzzy area is an inconsistent area of the recognition target determined by the first contour and the second contour; Step S44: Determine the depth blur region by bidirectional clustering, including: randomly selecting a plurality of first center points from the blur region; the proximity between the first center point and the background is greater than the proximity between the first center point and the color space / grayscale space of the recognition target; the proximity between the second center point and the recognition target is greater than the proximity between the second center point and the color space / grayscale space of the background; clustering is performed with the plurality of first center points as the center; and a plurality of first connected domains corresponding to the clustering are formed; clustering is performed with the plurality of second center points as the center; and a plurality of second connected domains corresponding to the clustering are formed; and the blur region after removing the first connected domain and the second connected domain is used as the depth blur region; Step S45: eliminating the depth blur area; Step S5: adjusting the recognition target image and / or the initial image based on the target feature of the recognition target, specifically: performing rotation adjustment / stretching adjustment on the recognition target image and / or the initial image based on the color space / gray space data value of the recognition target image; Step S6: judging the environmental change, and determining the environmental parameter adjustment or scene reconstruction based on the change, specifically: comparing the key feature sequence corresponding to the specific area set in the rotated recognition target image and the default target image, and when the difference is small, proceeding to step S7, otherwise, proceeding to step S8; Step S7: determining the environmental parameters that need to be adjusted, and adjusting the system components based on the adjusted environmental parameters; Step S8: Rapidly reconstruct the environment.
2. The method according to claim 1, characterized in that: The obstacle sensor is an infrared sensor.
3. The method according to claim 1, characterized in that: When an obstacle is detected ahead, the obstacle sensor sends an obstacle indication to the controller.
4. The method according to claim 1, characterized in that: The obstacle sensor sends obstacle indications to both the controller and the camera.
5. A system for rapidly building a machine vision environment, characterized in that: The system comprises: Obstacle sensor, light source, camera, target recognition and controller; the controller is in communication connection with the light source and camera; The system is used to perform the method according to any one of claims 1 to 4.
6. The system according to claim 5, characterized in that: The obstacle sensor is used to detect the presence of an identification target.
7. The system according to claim 5, characterized in that: The controller is used to receive information from obstacle sensors and cameras, and control the obstacle sensors, light sources, and cameras based on the information.
8. A device for quickly constructing a machine vision environment, the device comprising: A memory, and a processor connected to the memory, wherein the memory stores computer program instructions, wherein the processor is used to execute the computer program instructions stored in the memory to execute the method for rapidly constructing a machine vision environment according to any one of claims 1 to 4.
Citation Information
Patent Citations
Remote and intelligent line-tracking method of electric transmission line
CN103260016A
Method and apparatus for saving power consumption of device
CN112867104A
Video monitoring equipment capable of automatically tracking objects
CN203301636U