Imaging system, position calibration method and imaging methodTechnical Field
The invention relates to the field of imaging, in particular to an imaging system, a position calibration method and an imaging method.
Background
The current industrial cameras almost have the problem of difficult alignment during installation, and in order to solve the problem, the installation alignment problem is solved by the experience of an installer per se and multiple times of debugging in the current industry. Currently, only japan ken adopts a method of mounting a plurality of LEDs on a sensor board of a camera, and then producing a plurality of indication points through a lens to obtain a mounting position. The structure is complex, a separate lens is needed to make the LED light source focus on the same focal plane with the sensor, but the cost of the camera is too high.
Other cameras have no mode of indicating the calibration installation position, and can only be adjusted by means of manual experience, so that time and labor are wasted.
The above background disclosure is only for the purpose of assisting understanding of the inventive concept and technical solutions of the present invention, and does not necessarily belong to the prior art of the present patent application nor give technical teaching; the above background should not be used to assess the novelty and inventive aspects of the present application in the absence of express evidence that the above disclosure is published prior to the filing date of the present patent application.
Disclosure of Invention
The invention aims to provide a position calibration solution for easily and quickly finding a drawing area of a midline of a linear array camera or an area array camera.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
an imaging system, comprising:
a camera device configured to capture image information;
the camera device comprises two laser light source devices, a lens and a lens, wherein the two laser light source devices are symmetrically arranged on the left side and the right side of the camera device and are configured to emit laser light signals along the direction parallel to the optical axis of the lens of the camera device, and the light emitting side of each laser light source device is also provided with a cross-shaped lens;
the driving mechanism is connected with the output end of the controller; wherein the controller is configured to perform the following steps to complete the position calibration between the camera device and the object under test:
turning on the laser light source device, and under the premise that the imaging system is opposite to a measured object placed on the table board, triggering the camera device by the controller to enable the camera device to acquire a first image on the measured object at a current first position and through the cross-shaped lens and then through laser light extending in a cross shape on the table board;
the controller analyzes the position of the laser light in the first image and generates a first driving instruction so as to enable the driving mechanism to drive the camera device to rotate until the laser light of the two laser light source devices are overlapped in the left and right extending directions or an included angle smaller than a preset angle threshold value is formed;
the controller triggers the camera device again to enable the camera device to acquire a second image of the measured object and the laser light extending on the table top at the current second position;
and the controller analyzes the position of the laser light in the second image and generates a second driving instruction so as to enable the driving mechanism to drive the camera device to translate until the distance between the midpoint of the cross point of the laser light of the two laser light source devices and the preset central position of the measured object is smaller than a preset distance threshold.
Further, in accordance with any one or combination of the preceding claims, the first drive instruction is configured to cause the drive mechanism to drive the camera device to rotate about a virtual axis perpendicular to the tabletop;
the second drive instructions are configured to cause the drive mechanism to drive the camera apparatus to translate within a virtual plane parallel to the tabletop.
Further, in accordance with any one or a combination of the foregoing technical solutions, the laser light source device and the camera device are fixedly disposed on the same structural plate.
Further, in view of any one or a combination of the foregoing technical solutions, the laser light source device and the structural plate are fixedly connected by using a screw mounting hole of the camera device, so that the sensors of the laser light source device and the camera device are in a parallel state in space.
Further, in any one or a combination of the foregoing technical solutions, a multi-axis attitude sensor is built in a circuit board where a sensor of the camera device is located, and is electrically connected to an input end of the controller, and configured to detect angle information of the camera device and send a detection result to the controller.
Further, in accordance with any one or a combination of the preceding claims, the imaging system further comprises a remote control switch configured to remotely control a switching state of the laser light source device.
Further, in view of any one or a combination of the foregoing technical solutions, the remote control switch is connected to the laser light source device through a shielding cable of 5 meters or more, and a signal sent by the remote control switch is transmitted by single-ended-to-differential transmission.
Further, in accordance with any one or combination of the preceding claims, the angle threshold is set to be between 0 ° and 3 °; the set value of the distance threshold is smaller than one twentieth of the diameter of the maximum inscribed circle of the measured object.
Further, in view of any one or a combination of the foregoing technical solutions, the camera device is a line-array camera or an area-array camera.
Further, in any one or a combination of the foregoing technical solutions, an emitting direction of the laser light signal and an optical axis direction of a lens of the camera device are perpendicular to the table top, or are not perpendicular to the table top.
According to another aspect of the present invention, there is provided a position calibration method of an imaging system for performing position calibration between a camera device and an object to be measured, the method comprising the steps of:
the imaging system comprises a camera device, laser light source devices, a cross lens and a light source control module, wherein the laser light source devices are symmetrically arranged on the left side and the right side of the camera device of the imaging system, the laser light source devices are configured to emit laser light signals along the direction parallel to the optical axis of a lens of the camera device, and the light emitting side of each laser light source device is also provided with the cross lens;
placing a measured object on a table board, enabling a lens of the camera device to face the measured object, and turning on the laser light source device;
observing whether the laser light rays extending in a cross shape on the table top coincide in the left and right extending directions, if so, continuing to execute the next step, otherwise, rotating the camera device until the laser light rays of the laser light source devices on the left and right sides coincide in the left and right extending directions or form an included angle smaller than a preset angle threshold value, and continuing to execute the next step;
and observing whether the distance between the middle point of the two cross points of the laser light rays extending in the cross shape on the table board and the preset central position of the object to be measured is smaller than a preset distance threshold, if not, translating the camera device until the distance between the middle point of the two cross points of the laser light rays of the laser light source devices on the left side and the right side and the preset central position of the object to be measured is smaller than the preset distance threshold.
Further, in accordance with any one or a combination of multiple technical solutions described above, a first image is acquired by the camera device, and a controller configured in the imaging system analyzes whether laser light rays extending in a cross shape in the first image coincide in a left-right extending direction;
and/or, acquiring a second image through the camera device, and analyzing whether the distance between the midpoint of two cross points of the laser light extending in the second image in a cross shape and the preset central position of the measured object is smaller than a preset distance threshold value by the controller.
Further, in view of any one or a combination of the foregoing technical solutions, if the controller analyzes that the laser light rays extending in a cross shape in the first image do not coincide in the left-right extending direction, the controller sends a first driving instruction to a driving device configured in the imaging system to drive the camera device to rotate around a virtual axis perpendicular to the tabletop;
and/or if the controller analyzes that the distance between the midpoint of the two cross points of the laser light extending in the cross shape in the second image and the preset central position of the object to be measured is greater than or equal to a preset distance threshold, sending a second driving instruction to the driving device to drive the camera device to translate in the virtual plane parallel to the table board.
According to still another aspect of the present invention, there is provided an imaging method of an imaging system, including the steps of:
completing position calibration between the camera device and the measured object by using the imaging system; or, the imaging system completes the position calibration between the camera device and the measured object by using the position calibration method;
starting linear array scanning or area array scanning of the imaging system;
and splicing the sub-images obtained by linear array scanning or area array scanning in sequence to obtain an imaging result.
The technical scheme provided by the invention has the following beneficial effects:
according to the invention, the device for calibrating the position is externally hung on the camera, and various industrial cameras can be compatible by changing the structural part, so that the scheme cost of the whole imaging system is reduced;
the position of the camera and the observation area is accurately calibrated, and particularly, the effect is obvious under the condition that the central axis of the camera is not vertical to the observation area;
the installation can be realized only by fixing the screw holes of the industrial camera through a plurality of screws, and the installation is simple, convenient and fast.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a state diagram illustrating imaging system position calibration provided by an exemplary embodiment of the present invention;
FIG. 2 is a schematic view of an imaging system mounted on a structural plate according to an exemplary embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for calibrating a position of an imaging system according to an exemplary embodiment of the present invention;
fig. 4 is a flowchart illustrating an imaging method of an imaging system according to an exemplary embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.
Taking a linear array camera as an example, before a linear array camera is used for line scanning imaging of a measured object, position correction needs to be performed on the linear array camera, and the purpose of the position correction is to enable the optical axis of a lens of the linear array camera to be close to the center of a measured area as much as possible. Especially, in the case that the optical axis of the lens is not perpendicular to the plane of the object to be measured, it is difficult to precisely align the center of the camera with the center of the area to be measured by naked eyes.
In one embodiment of the present invention, there is provided an imaging system, as shown in fig. 1, comprising:
acamera device 100 configured to capture image information, which may be a line camera or an area camera;
two laserlight source devices 200, wherein the two laserlight source devices 200 are symmetrically arranged at the left and right sides of thecamera device 100, and are configured to emit laser light signals along a direction parallel to the optical axis of thelens 110 of thecamera device 100, and a cross-shaped lens (not shown) is further arranged at the light emitting side of each laserlight source device 200; the cross-shaped lens can enable the laser ray signals to be in a cross shape after penetrating through the cross-shaped lens.
The system further comprises a controller (not shown) and a driving mechanism (not shown) connected with an output end of the controller; wherein the controller is configured to perform the following steps to complete the position calibration between thecamera device 100 and the object under test 400:
turning on the laserlight source device 200, and on the premise that theimaging system 100 is opposite to a measuredobject 400 placed on a table top, triggering thecamera device 100 by the controller, so that thecamera device 100 acquires a first image on the table top by a cross-shaped extending laser light after passing through the cross-shaped lens and facing the measured object at a current first position;
the controller analyzes the orientation of the laser light in the first image, and generates a first driving instruction, so that the driving mechanism drives thecamera device 100 to rotate, specifically, drives the camera device to rotate around a virtual axis perpendicular to the table surface, until the laser light of the two laserlight source devices 200 coincide with each other in the left-right extending direction or form an included angle smaller than a preset angle threshold (for example, 2 °);
the controller triggers thecamera device 100 again to enable thecamera device 100 to acquire a second image of the object to be measured extending on the table top at the current second position;
the controller analyzes the orientation of the laser light in the second image, and generates a second driving instruction, so that the driving mechanism drives thecamera device 100 to translate, specifically drives thecamera device 100 to translate in a virtual plane parallel to the table top, until a distance between a midpoint of thecross point 210 of the laser light of the two laserlight source devices 200 and a preset central position of the object to be measured is smaller than a preset distance threshold (for example, one twentieth of the diameter of the maximum inscribed circle of the object to be measured or an arbitrary value smaller than the distance).
As shown in fig. 2, the laserlight source device 200 and thecamera device 100 are fixedly disposed on the samestructural board 300, and the laserlight source device 200 and thestructural board 300 are fixedly connected by using thescrew mounting holes 310 of thecamera device 100, so that the laserlight source device 200 and the sensor 120 (specifically, PCBA board) of thecamera device 100 are in a parallel state in space, which may be defined as that, in a case where thelens 110 of thecamera device 100 is vertically downward as shown in fig. 2, the two laserlight source devices 200 and thehorizontal sensor 120 are at the same height.
In one embodiment, a multi-axis attitude sensor (not shown) is built in a circuit board on which thesensor 120 of thecamera apparatus 100 is located, and is electrically connected to an input terminal of the controller, and configured to detect angle information of thecamera apparatus 100 and send a detection result to the controller, and the controller may control the driving apparatus to stop operating when it is determined that a driving end point is reached, based on the detection result of the multi-axis attitude sensor.
In one embodiment, the imaging system further comprises a remote control switch configured to remotely control a switching state of the laser light source device. The remote control switch is connected with the laser light source device through a shielding cable more than 5 meters, and signals sent by the remote control switch are transmitted in a differential mode through single end conversion, so that the transmission distance can be effectively increased. The cable adopts easy plug aviation plug, and supports the hot plug and use.
The scheme of this embodiment can be applied to the scene that the emission direction of the laser ray signal and the optical axis direction of thelens 100 of the camera device are perpendicular to the tabletop, and under the scene that the optical axis direction of thelens 100 is not perpendicular to the tabletop, the advantage of the fast position calibration of this embodiment is particularly obvious, and the accuracy is high.
The embodiment of the invention uses at least two laser diodes, and cross light is generated after passing through a cross lens to indicate the photosensitive position of a CMOS or CCD sensor of the current camera; meanwhile, the current posture can be obtained by using a 3-axis, 6-axis or 9-axis sensor, and data is transmitted to other processing platforms (including but not limited to a computer, an FPGA processor, an ARM processor, a DSP and the like), for example, the detection result (including the camera position and the angle information of each axis) of the posture sensor can be displayed by an upper computer, and the upper computer is used for completing the man-machine interaction with the controller. By adopting a plug-in mode and integrating the attitude sensor, an installer can easily find the position and acquire information such as the angular attitude and the like of the current camera.
Referring to fig. 3, an embodiment of the present invention provides a position calibration method for an imaging system, for completing position calibration between a camera device and a measured object, where the position calibration method includes the following steps:
the imaging system comprises a camera device, laser light source devices, a cross lens and a control system, wherein the laser light source devices are symmetrically arranged on the left side and the right side of the camera device of the imaging system, the laser light source devices are configured to emit laser light signals along the direction parallel to the optical axis of a lens of the camera device, and the light emitting side of each laser light source device is also provided with the cross lens;
placing a measured object on a table board, enabling a lens of the camera device to face the measured object, and turning on the laser light source device;
observing whether the laser light rays extending in a cross shape on the table top coincide in the left and right extending directions, if so, continuing to execute the next step, otherwise, rotating the camera device until the laser light rays of the laser light source devices on the left and right sides coincide in the left and right extending directions or form an included angle smaller than a preset angle threshold value, and continuing to execute the next step;
and observing whether the distance between the middle points of the two crossedpoints 210 of the laser light extending in the cross shape on the table board and the preset central position of the object to be measured is smaller than a preset distance threshold, if not, translating the camera device until the distance between the middle points of the two crossedpoints 210 of the laser light source devices on the left side and the right side and the preset central position of the object to be measured is smaller than the preset distance threshold.
Specifically, a first image is acquired through the camera device, and whether laser rays extending in a cross shape in the first image are overlapped in the left-right extending direction or not is analyzed by a controller configured in the imaging system; if the controller analyzes that the laser light rays extending in a cross shape in the first image are not overlapped in the left-right extending direction, a first driving instruction is sent to a driving device configured in the imaging system to drive the camera device to rotate around a virtual axis vertical to the table top;
acquiring a second image through the camera device, and analyzing whether the distance between the midpoint of twocross points 210 of the laser light extending in a cross shape in the second image and the preset central position of the measured object is smaller than a preset distance threshold value by the controller; if the controller analyzes that the distance between the midpoint of the twocross points 210 of the laser light extending in the cross shape in the second image and the preset central position of the object to be measured is greater than or equal to a preset distance threshold, a second driving instruction is sent to the driving device to drive the camera device to translate in the virtual plane parallel to the table top.
In one embodiment of the present invention, the present invention provides an imaging method of an imaging system, referring to fig. 4, the imaging method including the steps of:
completing position calibration between the camera device and the measured object by using the imaging system; or, the imaging system completes the position calibration between the camera device and the measured object by using the position calibration method;
starting linear array scanning or area array scanning of the imaging system;
and splicing the sub-images obtained by linear array scanning or area array scanning in sequence to obtain an imaging result.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.