Visual control method, system, storage medium, computer program, and controller

文档序号:1300863 发布日期:2020-08-07 浏览:4次 中文

阅读说明:本技术 视觉控制方法、系统、存储介质、计算机程序、控制器 (Visual control method, system, storage medium, computer program, and controller ) 是由 张旭阳 王海 于 2020-05-12 设计创作,主要内容包括:本发明属于控制器技术领域,公开了一种视觉控制方法、系统、存储介质、计算机程序、控制器,控制器连接,运行上电;设置光源参数及对应指令;软件处理进行检测;控制器继续运行检测。本发明实现了软件控制光源的多种形态与相机配合采集理想图像效果;通过上位机发送指令控制器控制光源不同亮度及在不同亮度下相机的拍图;实现了4路光源的光源的常量与频闪模式切换,频闪模式光源与相机触发同步;控制光源常亮状态的亮度,软件调节0-255级,控制光源频闪模式0-255级。本发明实现了相机软件控制相机IO触发采图,光源常亮控制、频闪控制,相机与光源的同步结合,实现光源的48V瞬间增亮功能,多种亮度组合控制。(The invention belongs to the technical field of controllers and discloses a visual control method, a system, a storage medium, a computer program and a controller, wherein the controller is connected and powered on in operation; setting light source parameters and corresponding instructions; software processing for detection; the controller continues to run the test. The invention realizes the effect that the software controls various forms of the light source to be matched with the camera to acquire an ideal image; sending an instruction by an upper computer to control the controller to control different brightness of the light source and the shooting of the camera under different brightness; constant and stroboscopic mode switching of a light source of the 4 paths of light sources is realized, and the stroboscopic mode light source is triggered and synchronized with the camera; the brightness of the light source in a normally bright state is controlled, the software adjusts the level of 0-255, and the light source stroboscopic mode is controlled to be level 0-255. The invention realizes the control of camera software to control the IO triggering image acquisition of the camera, the normal-lighting control and the stroboscopic control of the light source, the synchronous combination of the camera and the light source, the 48V instant brightening function of the light source and the combined control of various brightnesses.)

1. A visual control method, characterized in that the visual control method comprises:

firstly, connecting a controller, and running and electrifying;

secondly, setting light source parameters and corresponding instructions;

step three, carrying out image acquisition by software processing, and carrying out step four if the image acquisition effect is met; if the image collecting effect is poor, returning to the second step;

fourthly, the controller continues to operate the detection.

2. The vision control method according to claim 1, wherein the instruction information sent from the upper computer in the vision control method is analyzed and executed to each part through a COM port.

3. The vision control method of claim 2, wherein different command requirements can be realized by cooperating with the upper computer command, and the method can be divided into two forms: (1) receiving a serial port instruction to respond to subsequent actions; (2) and receiving the external IO signal response follow-up action.

4. The vision control method of claim 3, wherein the subsequent action of receiving the serial port command response is that after the upper computer sends a camera trigger command and a brightness parameter of the light source lighting through the serial port, the control board sets the corresponding light source to be at a corresponding brightness in a normal lighting or strobe lighting mode, and triggers an IO output signal corresponding to the camera, thereby completing a camera image collection process under the brightness of the light source.

5. The vision control method of claim 3, wherein the subsequent action of receiving the external IO signal response is that the host computer sets the corresponding brightness of the light source in advance through the serial port, when the IO signal is received, the control board responds to the constant brightness or stroboscopic of the corresponding light source brightness, the corresponding camera triggers the IO output signal, and the camera image collection process under the primary light source brightness is completed.

6. A program storage medium for receiving user input, the stored computer program causing an electronic device to perform the steps comprising:

firstly, connecting a controller, and running and electrifying;

secondly, setting light source parameters and corresponding instructions;

step three, software processing is carried out for detection, and if the detection effect is good, the step four is carried out; if the detection effect is poor, returning to the second step;

fourthly, the controller continues to operate the detection.

7. A computer program product stored on a computer readable medium, comprising a computer readable program for providing a user input interface for implementing a visual control method as claimed in any one of claims 1 to 5 when executed on an electronic device.

8. A vision control system for implementing the vision control method according to any one of claims 1 to 5, wherein the vision control system comprises:

the light source module is used for providing light source brightness;

the camera module is used for realizing image acquisition;

the light source control module is connected with the light source module and used for realizing the brightness control of the light source module;

the trigger output module is connected with the camera module and is used for realizing the output of trigger instructions of the external trigger module and the software trigger module;

the external trigger module is connected with the light source control module and the trigger output module and used for realizing the triggering and starting of an external instruction;

the software triggering module is connected with the light source control module and the triggering output module and used for realizing triggering and starting of software instructions;

the software instruction module is connected with the constant brightness control module and the stroboscopic pulse width control module and used for sending software instructions;

the constant-brightness control module is connected with the light source module and is used for realizing the constant-brightness control of the light source module 1;

and the stroboscopic pulse width control module is used for realizing the stroboscopic pulse width control of the light source module.

9. A controller, characterized in that the controller is mounted with the vision control system of claim 8, the controller comprising: the device comprises a first input terminal, a first camera channel, a second camera channel, a first light source channel, a second light source channel, a communication COM terminal, a second input terminal, a controller fixing M3 hole, a front panel, a control panel, a shell and a rear panel;

the front panel is arranged at the front end of the shell through bolts, the rear panel is arranged at the rear end of the shell through bolts, the control panel is arranged in the shell, and two ends of the control panel are connected with the front panel and the rear panel;

a first input terminal, a first camera channel, a second camera channel, a first light source channel and a second light source channel are sequentially embedded on the front panel from left to right; the back panel is sequentially embedded with a communication COM terminal and a second input terminal from left to right; the controller fixing M3 hole is opened on the shell.

10. The controller of claim 9, wherein the first input terminal is a 24V power input positive and negative, two-way IO trigger signal input; the first input terminal is a power input terminal of 12V and 48V;

the first light source channel and the second light source channel respectively control terminals powered by two paths of light sources, and SM plugs are adopted; the first camera channel and the second camera channel are power supply and triggering connecting terminals of two paths of cameras, and adopt M8 four-core aerial plug with a thread locking function;

the rear panel is provided with two paths of power supply input terminals of 24V +, 24V-, 48V +, 48V-and one path of communication port DB9 terminals, and the two paths of power supply input terminals are communicated with an upper computer by adopting RS 232;

four M3 threaded holes are distributed in the bottom of the shell.

Technical Field

The invention belongs to the technical field of controllers, and particularly relates to a visual control method, a visual control system, a storage medium, a computer program and a controller.

Background

At present, a controller controls the brightness of a light source, software controls the brightness of the light source, and a stroboscopic controls the brightness of the light source; the function of the existing controller is only used for controlling the brightness of the light source, in the industry of industrial visual inspection, the image acquisition time of the camera needs to be well matched with the brightness of the light source, and the existing controller can not meet the requirement when being applied to a complex environment and needs to be matched with the camera in various different brightness, so that the function is difficult to realize.

Through the above analysis, the problems and defects of the prior art are as follows: the existing controller can not realize the matching use of various different brightnesses and a camera when being applied to a complex environment, and the existing controller is used for controlling the brightness of a light source.

The difficulty in solving the above problems and defects is: how to effectively integrate the matching use of the camera trigger control and the light source brightness control.

The significance of solving the problems and the defects is as follows: the intelligent control system effectively solves the problems of complicated and changeable application environment of an industrial field, integration control of a camera and a light source, instability of equipment, abnormal image acquisition, false triggering, inapplicable image acquisition brightness change and the like caused by a plurality of irregular control implementation schemes in the equipment development process.

Disclosure of Invention

The invention provides a visual control method, a system, a storage medium, a computer program and a controller, aiming at the problems in the prior art.

The present invention is achieved as such, and a vision control method includes:

firstly, connecting a controller, and running and electrifying;

secondly, setting light source parameters and corresponding instructions (the brightness level is 0-255);

step three, carrying out image acquisition by software processing, and carrying out step four if the image acquisition effect is met; if the image collecting effect is poor, returning to the second step;

fourthly, the controller continues to operate the detection.

Further, the instruction information sent by the upper computer of the vision control method through the COM port is analyzed and executed to each part.

Further, the instruction requirements of different types can be realized by matching with instructions of an upper computer, and the instruction requirements can be divided into two types: (1) receiving a serial port instruction to respond to subsequent actions; (2) and receiving the external IO signal response follow-up action.

Further, the subsequent action of receiving the serial port instruction response is that after the upper computer sends a camera triggering instruction and a brightness parameter of the light source lighting through the serial port, the control board sets the corresponding light source to be normally-on or stroboscopically-on to be corresponding brightness, the corresponding camera triggers an IO output signal, and the camera image collection process under the light source brightness is completed.

Further, the subsequent action of receiving the external IO signal response is that the upper computer sets the corresponding brightness of the light source in advance through the serial port, when the IO receiving signal is input, the control panel responds that the brightness of the corresponding light source is normally bright or stroboscopic, the corresponding camera triggers the IO output signal, and the camera image collecting process under the light source brightness is completed once.

It is another object of the present invention to provide a program storage medium for receiving user input, the stored computer program causing an electronic device to perform the steps comprising:

firstly, connecting a controller, and running and electrifying;

secondly, setting light source parameters and corresponding instructions;

step three, carrying out software processing to carry out image acquisition, and carrying out the step four if the image acquisition effect is good; if the detection effect is poor, returning to the second step;

fourthly, the controller continues to operate the detection.

It is another object of the present invention to provide a computer program product stored on a computer readable medium, comprising a computer readable program for providing a user input interface to implement the visual control method when executed on an electronic device.

Another object of the present invention is to provide a vision control system implementing the vision control method, the vision control system including:

the light source module is used for providing light source brightness;

the camera module is used for realizing image acquisition;

the light source control module is connected with the light source module and used for realizing the brightness control of the light source module;

the trigger output module is connected with the camera module and is used for realizing the output of trigger instructions of the external trigger module and the software trigger module;

the external trigger module is connected with the light source control module and the trigger output module and used for realizing the triggering and starting of an external instruction;

the software triggering module is connected with the light source control module and the triggering output module and used for realizing triggering and starting of software instructions;

the software instruction module is connected with the constant brightness control module and the stroboscopic pulse width control module and used for sending software instructions;

the constant-brightness control module is connected with the light source module and is used for realizing the constant-brightness control of the light source module 1;

and the stroboscopic pulse width control module is used for realizing the stroboscopic pulse width control of the light source module.

Another object of the present invention is to provide a controller having the vision control system mounted thereto, the controller including: the device comprises a first input terminal, a first camera channel, a second camera channel, a first light source channel, a second light source channel, a communication COM terminal, a second input terminal, a controller fixing M3 hole, a front panel, a control panel, a shell and a rear panel;

the front panel is arranged at the front end of the shell through bolts, the rear panel is arranged at the rear end of the shell through bolts, the control panel is arranged in the shell, and two ends of the control panel are connected with the front panel and the rear panel;

a first input terminal, a first camera channel, a second camera channel, a first light source channel and a second light source channel are sequentially embedded on the front panel from left to right; the back panel is sequentially embedded with a communication COM terminal and a second input terminal from left to right; the controller fixing M3 hole is opened on the shell.

Further, the first input terminal is a 24V power supply input positive and negative terminal, and two paths of IO trigger signals are input; the first input terminals are 12V and 48V power input terminals.

The first light source channel and the second light source channel respectively control terminals powered by two paths of light sources, and SM plugs are adopted; the first camera channel and the second camera channel are power supply and triggering connecting terminals of two paths of cameras, and adopt M8 four-core aerial plug with a thread locking function;

the rear panel is provided with two paths of power supply input terminals of 24V +, 24V-, 48V +, 48V-and one path of communication port DB9 terminals, and the two paths of power supply input terminals are communicated with an upper computer by adopting RS 232;

four M3 threaded holes are distributed in the bottom of the shell.

By combining all the technical schemes, the invention has the advantages and positive effects that: the invention realizes the effect that the software controls various forms of the light source to be matched with the camera to acquire an ideal image, and the effect comprises four paths of light source control and two paths of camera control; sending an instruction by an upper computer to control the controller to control different brightness of the light source and the shooting of the camera under different brightness; constant and stroboscopic mode switching of a light source of the 4 paths of light sources is realized, and the stroboscopic mode light source is triggered and synchronized with the camera; controlling the brightness of the light source in a normally bright state, adjusting the brightness by software to be 0-255 grade, and controlling the light source stroboscopic mode to be 0-255 grade; the camera triggering is controlled by the command; the method realizes that a single software command respectively controls the stroboflash of the four single-channel light sources and the triggering of the camera; the software is used for sending the instruction, the single-instruction controller is used for realizing the synchronous image acquisition of the triggering of the four-channel cameras and the stroboscopic lighting of the light source, the high-frequency stroboscopic mode of the light source can be realized, the triggering of the cameras is synchronous, and the lighting delay of the light source is within 10 uS; the trigger of the single-channel camera is controlled by a single instruction, and the synchronous stroboflash of multiple light sources is controlled at the same time (the brightness is controlled by a constant mode); the IO control camera triggering and light source synchronous stroboscopic are realized, when an external 24V IO signal is given to the controller, the controller controls the light source stroboscopic and the camera to capture images simultaneously.

The intelligent integrated vision controller realizes the control of camera software to trigger IO (input/output) image acquisition of the camera, the normal-light control and stroboscopic control of the light source, the synchronous combination of the camera and the light source, the 48V instant brightening function of the light source and the combined control of various brightnesses.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained from the drawings without creative efforts.

Fig. 1 is a flowchart of a vision control method according to an embodiment of the present invention.

FIG. 2 is a schematic structural diagram of a vision control system provided by an embodiment of the present invention;

FIG. 3 is a logic control relationship diagram of a vision control system provided by an embodiment of the present invention;

FIG. 4 is a schematic diagram of a functional terminal layout of a front panel according to an embodiment of the present invention;

FIG. 5 is a schematic diagram of a rear panel functional terminal layout provided by an embodiment of the present invention;

FIG. 6 is a schematic view of the arrangement of the housing mounting openings provided by the embodiment of the present invention;

FIG. 7 is a diagram of application logic provided by an embodiment of the present invention;

FIG. 8 is a schematic structural diagram of a controller provided in an embodiment of the present invention;

in the figure: 1. a first input terminal; 2. a first camera channel; 3. a second camera channel; 4. a first light source channel; 5. a second light source channel; 6. a communication COM terminal; 7. a second input terminal; 8. the controller fixes the M3 hole; 9. a front panel; 10. a control panel; 11. a housing; 12. a rear panel; 13. a light source module; 14. a camera module; 15. a light source control module; 16. a trigger output module; 17. an external trigger module; 18. a software triggering module; 19. a software instruction module; 20. a constant brightness control module; 21. and a strobe pulse width control module.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

In view of the problems in the prior art, the present invention provides a vision control method, a system, a storage medium, a computer program, and a controller, which are described in detail below with reference to the accompanying drawings.

As shown in fig. 1, the vision control method provided by the present invention comprises the following steps:

s101: the controller is connected and powered on in operation;

s102: setting light source parameters and corresponding instructions;

s103: the software processing is carried out for drawing, and if the drawing effect is satisfied, S104 is carried out; if the image collecting effect is poor, returning to S102;

s104: the controller continues to run the test.

As shown in fig. 2, the vision control system provided by the present invention includes:

and a light source module 13 for providing light source brightness.

And the camera module 14 is used for realizing image acquisition.

And the light source control module 15 is connected with the light source module 13 and is used for realizing brightness control of the light source module 13.

And the trigger output module 16 is connected with the camera module 14 and is used for realizing the output of the trigger instruction of the external trigger module 17 and the software trigger module 18.

And the external trigger module 17 is connected with the light source control module 15 and the trigger output module 16 and is used for realizing the triggering and starting of an external instruction.

And the software triggering module 18 is connected with the light source control module 15 and the triggering output module 16 and is used for realizing triggering and starting of software instructions.

And the software instruction module 19 is connected with the constant brightness control module 20 and the flash pulse width control module 21, and is used for sending software instructions.

And the normally-on brightness control module 20 is connected with the light source module 13 and is used for realizing the normally-on brightness control of the light source module 13.

And the strobe pulse width control module 21, and the light source module 13 is configured to implement strobe pulse width control of the light source module 13.

The technical solution of the present invention is further described below with reference to the accompanying drawings.

As shown in fig. 4, 5, 6 and 8, the vision controller provided by the present invention includes: the device comprises a first input terminal 1, a first camera channel 2, a second camera channel 3, a first light source channel 4, a second light source channel 5, a communication COM terminal 6, a second input terminal 7, a controller fixing M3 hole 8, a front panel 9, a control panel 10, a shell 11 and a back panel 12.

The first input terminal 1 is a 24V power supply input positive and negative, and two paths of IO trigger signals are input; the first input terminal 1 is a 12V and 48V power input terminal.

The front panel 9 is installed at the front end of the shell 11 through bolts, the rear panel 12 is installed at the rear end of the shell 11 through bolts, the control panel 10 is installed inside the shell 11, two ends of the control panel 10 are connected with the front panel 9 and the rear panel 12,

a first input terminal 1, a first camera channel 2, a second camera channel 3, a first light source channel 4 and a second light source channel 5 are sequentially embedded on the front panel 9 from left to right; the back panel 12 is embedded with a communication COM terminal 6 and a second input terminal 7 from left to right in sequence; the controller fixing M3 hole 8 is opened on the shell 11,

the invention comprises a control panel 10, a shell 11, a front panel 9 and a back panel 12; the front panel 9 is provided with four light source controls of two cameras, input signals and power supply access terminals; the back panel 12 has a communication COM terminal 6 and a second input terminal 7.

The first light source channel 4 and the second light source channel 5 of the front panel 9 respectively control the terminals of two paths of light source power supplies, and the SM plug which is universal for the visual light sources in the market is adopted, so that the light sources can be conveniently connected and powered; the first camera channel 2 and the second camera channel 3 are power supply and triggering connecting terminals of two paths of cameras, adopt M8 four-core aerial plug and have a thread locking function, are convenient for field installation and connection, are firm and reliable, and are suitable for complex environments of industrial fields; the green terminal row adopts 6-pin pluggable terminals, is convenient to fix and wire, and is respectively a camera 1 trigger signal input (in1 & lt- & gt and in1-), a camera 2 trigger signal input (in2 & lt- & gt and in2-), and a 24V power supply input positive and negative (24 & lt- & gt and 24-).

The rear panel 12 is provided with two power input terminals (24V +, 24V-, 48V + and 48V-), and one communication port DB9 terminal (COM1) which is communicated with an upper computer by RS 232.

Four M3 threaded holes are distributed at the bottom of the shell 11 and used for fixing products.

The control board 10 of the present invention is a brain part for logic processing, and analyzes and executes command information transmitted from an upper computer through a COM port to each part. The controller is internally provided with a core control board 10, a core processing logic part is matched with an upper computer instruction to realize different instruction requirements, and the controller can be used in two forms, wherein one form is to receive a serial port instruction to respond to subsequent actions, and the other form is to receive an external IO signal to respond to subsequent actions.

The first form: after the upper computer sends a camera trigger instruction and a brightness parameter of the light source lighting through the serial port, the control panel sets the corresponding light source (normally-on or stroboscopic) to be corresponding brightness, the corresponding camera triggers an IO output signal, and the camera image collecting process under the light source brightness is completed once.

The second form: the upper computer sets corresponding brightness of the light source in advance through the serial port, when IO (input/output) signals are received, the control panel responds to the corresponding light source brightness (normally bright or stroboscopic), the corresponding camera triggers IO output signals, and the camera image collecting process under the primary light source brightness is completed.

The invention realizes synchronous use of various combinations of the camera and the light source, realizes flexible communication and coordination of software and hardware, realizes acceptance of both software instructions and hardware IO instructions, efficiently and accurately realizes brightness coordination of the camera and the light source, and is suitable for more complex industrial field use environments.

The technical effects of the present invention will be described in detail with reference to the tests below.

TABLE 1 record of experimental test data

It should be noted that the embodiments of the present invention can be realized by hardware, software, or a combination of software and hardware. The hardware portion may be implemented using dedicated logic; the software portions may be stored in a memory and executed by a suitable instruction execution system, such as a microprocessor or specially designed hardware. Those skilled in the art will appreciate that the apparatus and methods described above may be implemented using computer executable instructions and/or embodied in processor control code, such code being provided on a carrier medium such as a disk, CD-or DVD-ROM, programmable memory such as read only memory (firmware), or a data carrier such as an optical or electronic signal carrier, for example. The apparatus and its modules of the present invention may be implemented by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of hardware circuits and software, e.g., firmware.

The above description is only for the purpose of illustrating the present invention and the appended claims are not to be construed as limiting the scope of the invention, which is intended to cover all modifications, equivalents and improvements that are within the spirit and scope of the invention as defined by the appended claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种灯具智能控制方法和系统以及灯具

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!