CN115753610A - Adjusting method for spectrum online detection of placement posture of target object - Google Patents
Adjusting method for spectrum online detection of placement posture of target object Download PDFInfo
- Publication number
- CN115753610A CN115753610A CN202211441064.6A CN202211441064A CN115753610A CN 115753610 A CN115753610 A CN 115753610A CN 202211441064 A CN202211441064 A CN 202211441064A CN 115753610 A CN115753610 A CN 115753610A
- Authority
- CN
- China
- Prior art keywords
- target object
- target
- spectrum
- detection
- posture
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 130
- 238000001228 spectrum Methods 0.000 title claims abstract description 70
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000003595 spectral effect Effects 0.000 claims abstract description 39
- 238000000605 extraction Methods 0.000 claims abstract description 14
- 238000007781 pre-processing Methods 0.000 claims abstract description 9
- 235000013399 edible fruits Nutrition 0.000 claims description 11
- 241001164374 Calyx Species 0.000 claims description 10
- 238000013519 translation Methods 0.000 claims description 7
- 239000011159 matrix material Substances 0.000 claims description 6
- 238000005286 illumination Methods 0.000 claims description 4
- 230000007246 mechanism Effects 0.000 claims description 3
- 238000009776 industrial production Methods 0.000 abstract description 2
- 238000005516 engineering process Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000012937 correction Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000009434 installation Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000037406 food intake Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 239000013077 target material Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000011179 visual inspection Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
本发明公开一种用于光谱在线检测目标物放置姿态的调整方法,包括创建光谱在线检测的目标物姿态检测系统和目标物姿态调整系统;进行目标物姿态检测系统和目标物姿态调整系统的标定;进行光谱在线检测目标物源图像的采集及预处理;预处理后的光谱在线检测目标物图像的特征提取;结合摄像几何原理求解光谱在线检测目标物空间几何信息;根据求解的光谱在线检测目标物空间几何信息,对比目标空间几何信息,使用目标物姿态调整系统调整光谱在线检测目标物姿态。本发明结构简单,设备成本比较低,检测效率高,物体姿态调整时间短,能有效提高光谱在线检测目标物的品质检测效率,能很好适应大规模目标物品质检测与工业生产需要,提高自动化率。
The invention discloses a method for adjusting the posture of a target object in online spectrum detection, which includes creating a target posture detection system and a target posture adjustment system for spectrum online detection; performing calibration of the target posture detection system and the target posture adjustment system ; Acquisition and preprocessing of spectral online detection target source images; feature extraction of preprocessed spectral online detection target images; combined with camera geometry principles to solve spectral online detection target spatial geometric information; according to the solved spectral online detection target The spatial geometric information of the object is compared with the geometric information of the target space, and the target posture adjustment system is used to adjust the spectrum to detect the target posture online. The invention has simple structure, relatively low equipment cost, high detection efficiency, short object attitude adjustment time, can effectively improve the quality detection efficiency of spectrum online detection target object, can well adapt to the needs of large-scale target object quality detection and industrial production, and improves automation Rate.
Description
技术领域technical field
本发明属于机器视觉技术领域,具体涉及一种用于光谱在线检测目标物放置姿态的调整方法。The invention belongs to the technical field of machine vision, and in particular relates to an adjustment method for spectrum online detection of target object placement posture.
背景技术Background technique
判断物体在空间内的处于何种状态的某一重要参数是姿态,光谱在线目标物姿态检测及姿态调整后的光谱在线目标物品质检测对工业自动化加工有相当重要的技术指导作用。An important parameter for judging the state of an object in space is attitude. Spectral online target object attitude detection and spectral online target object quality detection after attitude adjustment have a very important technical guidance for industrial automation processing.
视觉检测技术是精密测试技术领域内最具有发展潜力的新技术,它综合运用了电子学、光电探测、图象处理和计算机技术,将机器视觉引入到工业检测中,实现对物体(产品或零件)三维尺寸或位置的快速测量,具有非接触、速度快、柔性好等突出优点,在现代制造业中有着重要的应用前景。Visual inspection technology is a new technology with the most development potential in the field of precision testing technology. It comprehensively uses electronics, photoelectric detection, image processing and computer technology to introduce machine vision into industrial inspection to realize the detection of objects (products or parts) ) The rapid measurement of three-dimensional size or position has outstanding advantages such as non-contact, high speed, and good flexibility, and has important application prospects in modern manufacturing.
光谱在线检测目标物姿态调整技术使物体在短时间内进行姿态调整,提高了光谱在线检测目标物品质检测的效率和时间。现有光谱在线检测目标物姿态调整是通过人为位置标定进行手动调整,这不仅降低了检测效率,检测质量也不能得到有效地保证。这时自动化的光谱在线检测目标物姿态检测与调整方法变得尤为重要,通过姿态校正算法以实现光谱在线检测目标物自动化姿态调整,以满足光谱在线检测目标物品质检测与工业自动化生产。Spectrum online detection target attitude adjustment technology enables the object to adjust its posture in a short time, which improves the efficiency and time of spectrum online detection target object quality detection. The attitude adjustment of the existing spectral online detection target is manually adjusted through artificial position calibration, which not only reduces the detection efficiency, but also cannot effectively guarantee the detection quality. At this time, the automatic spectral online detection target posture detection and adjustment method becomes particularly important. The posture correction algorithm is used to realize the automatic spectral online detection target object posture adjustment, so as to meet the spectral online detection target quality detection and industrial automation production.
发明内容Contents of the invention
本发明提供一种用于光谱在线检测目标物放置姿态的调整方法。解决现有光谱在线检测目标物姿态调整时是通过人为位置标定的问题,通过姿态校正算法实现光谱在线检测目标物自动化姿态调整,增加检测装置自动化检测的程度,提高检测的效率和准确度。The invention provides an adjustment method for spectrum online detection of target object placement posture. It solves the problem that the attitude adjustment of the existing spectrum online detection target is manually calibrated, and realizes the automatic posture adjustment of the spectrum online detection target through the attitude correction algorithm, increases the degree of automatic detection of the detection device, and improves the efficiency and accuracy of detection.
为实现上述目的,本发明的技术方案是:提供一种用于光谱在线检测目标物放置姿态的调整方法。光谱在线检测目标物在线姿态调整方法,包括以下步骤:In order to achieve the above object, the technical solution of the present invention is to provide an adjustment method for spectrum online detection of target object placement posture. The method for online attitude adjustment of spectrum online detection target object comprises the following steps:
步骤S1:创建光谱在线检测的目标物姿态检测系统和目标物姿态调整系统;Step S1: Create a target posture detection system and a target posture adjustment system for online spectrum detection;
步骤S2:进行目标物姿态检测系统和目标物姿态调整系统的标定;Step S2: Calibrate the target attitude detection system and the target attitude adjustment system;
步骤S3:进行光谱在线检测目标物源图像的采集及预处理;Step S3: Acquisition and preprocessing of the source image of the target object in the online spectrum detection;
步骤S4:预处理后的光谱在线检测目标物图像的特征提取;Step S4: feature extraction of the preprocessed spectral online detection target image;
步骤S5:结合摄像几何原理求解光谱在线检测目标物空间几何信息;Step S5: Combining the camera geometry principle to solve the spatial geometric information of the spectral online detection target object;
步骤S6:根据求解的光谱在线检测目标物空间几何信息,对比目标空间几何信息,使用目标物姿态调整系统调整光谱在线检测目标物姿态。Step S6: Online detection of the spatial geometric information of the target object based on the solved spectrum, comparing the spatial geometric information of the target object, and using the target object posture adjustment system to adjust the spectrum to detect the object posture online.
可优选的,所述步骤S1中,目标物姿态检测系统包括左CCD相机和右CCD相机、光照箱、荧光灯、黑色背景和计算机,左CCD相机和右CCD相机和荧光灯均设置在光照箱内,被测光谱在线检测目标物放置在具有黑色背景的光照箱底部。Preferably, in the step S1, the target posture detection system includes a left CCD camera and a right CCD camera, a light box, a fluorescent lamp, a black background and a computer, and the left CCD camera and the right CCD camera and the fluorescent light are all arranged in the light box, The online detection target of the measured spectrum is placed at the bottom of the light box with a black background.
可优选的,所述步骤S1中,目标物姿态调整系统的调整物为放有目标物托盘,其托盘底部有近红外光透射孔,外周设置有4个滚轮,每个滚轮连接相对应的步进电机。相对的两个滚轮分别连接水平旋转电机,另外两个相对的滚轮分别连接垂直旋电机,水平旋转电机和垂直旋电机分别控制光谱在线检测目标物水平旋转和垂直旋转,以校正目标物姿态的准确性,托盘底部与光照箱底部平行。Preferably, in the step S1, the adjustment object of the target attitude adjustment system is a target tray, the bottom of the tray has a near-infrared light transmission hole, and the outer periphery is provided with 4 rollers, and each roller is connected to a corresponding step. into the motor. The two opposite rollers are respectively connected to the horizontal rotation motor, and the other two opposite rollers are respectively connected to the vertical rotation motor. The horizontal rotation motor and the vertical rotation motor respectively control the horizontal rotation and vertical rotation of the spectrum online detection target to correct the accuracy of the target posture. For stability, the bottom of the tray is parallel to the bottom of the light box.
可优选的,所述步骤S2中,目标物姿态检测系统和目标物姿态调整系统的标定,包括以下步骤:Preferably, in the step S2, the calibration of the target posture detection system and the target posture adjustment system includes the following steps:
步骤S21:准备光谱在线检测目标物,利用CCD相机采集目标物图像,然后进行特征提取,计算空间几何参数;Step S21: Prepare the spectrum for online detection of the target object, use the CCD camera to collect the image of the target object, then perform feature extraction and calculate the spatial geometric parameters;
步骤S22:建立基座坐标系,然后进行坐标系参数的计算;Step S22: Establish the base coordinate system, and then calculate the parameters of the coordinate system;
步骤S23:获取步骤S21、S22参数,将步骤S21求得的光谱在线检测目标物的空间几何参数转换到目标物姿态调整系统的基座坐标系下。分别定义CCD相机与基座坐标之间的旋转矩阵R’和平移向量T’,其中R’和T’为相机与基座坐标之间的初始校正参数。通过参数从而解得目标物姿态调整系统基座坐标系下的光谱在线检测目标物空间几何参数,并且与设定的目标姿态空间几何参数对比。Step S23: Obtain the parameters of steps S21 and S22, and convert the spatial geometric parameters of the spectral online detection target obtained in step S21 into the base coordinate system of the target attitude adjustment system. Define the rotation matrix R ' and translation vector T ' between the CCD camera and the base coordinates, respectively, where R ' and T ' are the initial correction parameters between the camera and the base coordinates. Through the parameter solution, the spectrum under the base coordinate system of the target attitude adjustment system is obtained, and the spatial geometric parameters of the target object are detected online, and compared with the set target attitude space geometric parameters.
可优选的,所述步骤S3中,目标物源图像的预处理包括图像增强算法,灰度化,直方图均衡化。Preferably, in the step S3, the preprocessing of the target source image includes image enhancement algorithm, gray scale, and histogram equalization.
可优选的,所述步骤S4中,进行光谱在线检测目标物特征提取时,要提取被测光谱在线检测目标物的位置点、果梗或花萼点、光谱在线检测目标物边缘特征以及大小特征;其中,目标物的大小特征提取,使用投影面积法来提取。Preferably, in the step S4, when performing the feature extraction of the online spectral detection target, the position point, fruit stem or calyx point of the measured spectral online detection target, edge features and size features of the spectral online detection target should be extracted; Among them, the size feature extraction of the target object is extracted using the projected area method.
可优选的,所述步骤S5中,通过判断是否有果梗或花萼点,并且目标物外轮廓寻找目标物形心点坐标及其对称轴来判断目标物放置方式,通过目标物图像的位置点和果梗或花萼点坐标提取像面轴线,采用空间交汇法来求解目标物轴线的三维姿态,采用近似匹配位置点的方法求解出目标物位置点世界坐标,以及利用光谱在线检测目标物大小求解公式得到光谱在线检测目标物实际大小。Preferably, in the step S5, by judging whether there is a fruit stalk or a calyx point, and looking for the coordinates of the centroid point of the target and its symmetry axis to determine the placement method of the target, through the position point of the target image Extract the axis of the image plane with the coordinates of the fruit stem or calyx point, use the space intersection method to solve the three-dimensional attitude of the target axis, use the method of approximately matching the position point to solve the world coordinates of the target position point, and use the spectrum to detect the size of the target object online The formula is used to obtain the actual size of the target object in online detection of the spectrum.
可优选的,所述步骤S6中,求解光谱在线检测目标物姿态参数时,分两种情况:目标物竖直放置时直接定义姿态参数,无需求解;倾斜放置时,采用空间几何知识的方法求解目标物姿态参数。Preferably, in the step S6, when solving the spectral online detection target attitude parameters, there are two cases: when the target is placed vertically, the attitude parameters are directly defined, and there is no need to solve; when the target is placed obliquely, the method of spatial geometry knowledge is used Solve the attitude parameters of the target object.
可优选的,所述步骤S6中,将光谱在线检测目标物姿态参数与目标姿态参数对比,若在误差范围内则光谱在线检测目标物姿态不需要调整,否则将姿态参数相关数据送入目标物姿态调整系统的控制机构,通过驱动电机调节托盘的滚轮按照光谱在线检测目标物目标姿态进行调整。Preferably, in the step S6, the online spectrum detection target posture parameters are compared with the target posture parameters, if within the error range, the spectrum online detection target posture does not need to be adjusted, otherwise the posture parameter related data is sent to the target object The control mechanism of the attitude adjustment system is adjusted by driving the motor to adjust the rollers of the tray according to the spectral online detection of the target attitude of the target.
对本技术方案的进一步补充,如上所述,本发明涉及的用于光谱在线检测目标物放置姿态的调整方法,具有以下实际有益效果:As a further supplement to the technical solution, as mentioned above, the adjustment method for spectrum online detection of target placement posture according to the present invention has the following practical beneficial effects:
本发明的用于光谱在线检测目标物放置姿态的调整方法,通过图像摄取、图像预处理、特征提取及其采用空间交汇方法求解,通过图像采集处理、特征提取以及光谱在线检测目标物投影方程与摄像光心确定的平面方程,求解得到光谱在线检测目标物的世界坐标系下的空间几何参数。利用计算机将数据参数送入执行结构中进行光谱在线检测目标物姿态调整;本发明结构简单,设备成本比较低,检测效率高,物体姿态调整时间短,能有效提高光谱在线检测目标物品质检测效率和工业自动化生产,能很好适应大规模目标物品质检测与工业生产需要。The method for adjusting the placement attitude of the spectrum online detection target object of the present invention is solved by image acquisition, image preprocessing, feature extraction and the method of spatial intersection, and the projection equation and the spectrum online detection target object through image acquisition processing, feature extraction and spectrum online detection. The plane equation determined by the optical center of the camera is solved to obtain the spatial geometric parameters in the world coordinate system of the online spectral detection target. Using the computer to send data parameters into the execution structure to adjust the attitude of the spectrum online detection target object; the invention has simple structure, relatively low equipment cost, high detection efficiency, short object posture adjustment time, and can effectively improve the quality detection efficiency of the spectrum online detection target object And industrial automation production, can well meet the needs of large-scale target material quality inspection and industrial production.
附图说明Description of drawings
图1是一种用于光谱在线检测目标物在线姿态调整方法的实施方式流程图;Fig. 1 is a flow chart of an embodiment of an online posture adjustment method for an online spectral detection target;
图2是目标物姿态检测系统构成图;Fig. 2 is a composition diagram of a target attitude detection system;
图3是姿态调整目标物托盘;Fig. 3 is the attitude adjustment target object tray;
图4是滚轮电机驱动安装位置图;Figure 4 is a diagram of the installation position of the roller motor drive;
图5是目标物姿态调整系统的标定的流程图;Fig. 5 is a flowchart of the calibration of the target attitude adjustment system;
图6是目标物姿态调整前的判断流程图;Fig. 6 is a flow chart of judgment before target attitude adjustment;
图7是实验结果数据表。Figure 7 is a data table of the experimental results.
元件标号说明:1、左CCD相机;2、右CCD相机;3、光照箱;4、荧光灯;5、黑色背景;6、计算机;7、托盘;8、近红外光透射孔;9、滚轮安装位置;10、滚轮;11、水平旋转电机;12、垂直旋电机;Component label description: 1. Left CCD camera; 2. Right CCD camera; 3. Illumination box; 4. Fluorescent lamp; 5. Black background; 6. Computer; 7. Tray; 8. Near-infrared light transmission hole; 9. Roller installation Position; 10, roller; 11, horizontal rotation motor; 12, vertical rotation motor;
具体实施方式Detailed ways
以下由具体的实施例说明本发明的实施方式,通过本说明书所提供的信息可以轻易地了解本发明的优点和功效。The implementation mode of the present invention is illustrated by specific examples below, and the advantages and effects of the present invention can be easily understood through the information provided in this description.
须知,本说明书附图所绘的结构、比例、大小等,均仅用以配合说明书所揭示的内容,以供熟悉此技术的人士了解与阅读,并非用以限定本发明可实施的限定条件,故不具技术上的实质意义,任何结构的修饰、比例关系的改变或大小的调整,在不影响本发明所能产生的功效及所能达成的目的下,均应仍落在本发明所揭示的技术内容能涵盖的范围内。同时,本说明书中所引用的如“上”、“下”、“左”、“右”、“中间”等的用语,亦仅为便于叙述明了,而非用以限定本发明可实施的范围,其相对关系的改变或调整,在无实质变更技术内容下,当亦视为本发明可实施的范畴。It should be noted that the structures, proportions, sizes, etc. drawn in the drawings of this specification are only used to match the content disclosed in the specification, for those who are familiar with this technology to understand and read, and are not used to limit the conditions for the implementation of the present invention. Therefore, there is no technical substantive meaning, and any modification of structure, change of proportional relationship or adjustment of size shall still fall within the scope of the disclosure of the present invention without affecting the functions and objectives of the present invention. within the scope of technical content. At the same time, terms such as "upper", "lower", "left", "right", and "middle" quoted in this specification are only for convenience of description, and are not used to limit the scope of the present invention. , the change or adjustment of its relative relationship, without substantive changes in the technical content, should also be regarded as the scope of the present invention that can be implemented.
本发明的用于光谱在线检测目标物放置姿态的调整方法,特征在于,首先创建光谱在线检测的目标物姿态检测系统和目标物姿态调整系统;其次将对建立的目标物姿态检测系统和目标物姿态调整系统进行系统标定。通过CCD相机采集目标物源图像及进行预处理,提取图像特征后根据摄像几何原理求解光谱在线检测目标物空间几何信息,对比目标空间几何信息后使用目标物姿态调整系统调整光谱在线检测目标物姿态,最终达到姿态校正的目的。具体流程如图1所示,具体包括如下步骤:The method for adjusting the posture of the target on-line detection of the spectrum of the present invention is characterized in that, firstly, a target posture detection system and a target posture adjustment system of the spectrum online detection are created; secondly, the target posture detection system and the target posture adjustment system established The attitude adjustment system performs system calibration. Use the CCD camera to collect target source images and perform preprocessing. After extracting image features, solve the spectral online detection target spatial geometric information according to the camera geometry principle. After comparing the target spatial geometric information, use the target posture adjustment system to adjust the spectral online detection target posture. , and finally achieve the purpose of attitude correction. The specific process is shown in Figure 1, and specifically includes the following steps:
步骤S1:创建光谱在线检测的目标物姿态检测系统和目标物姿态调整系统;Step S1: Create a target posture detection system and a target posture adjustment system for online spectrum detection;
步骤S2:进行目标物姿态检测系统和目标物姿态调整系统的标定;Step S2: Calibrate the target attitude detection system and the target attitude adjustment system;
步骤S3:进行光谱在线检测目标物源图像的摄取及预处理;Step S3: Carry out the ingestion and preprocessing of the target source image of the spectrum online detection;
步骤S4:预处理后的光谱在线检测目标物图像的特征提取;Step S4: feature extraction of the preprocessed spectral online detection target image;
步骤S5:结合摄像几何原理求解光谱在线检测目标物空间几何信息;Step S5: Combining the camera geometry principle to solve the spatial geometric information of the spectral online detection target object;
步骤S6:根据求解的光谱在线检测目标物空间几何信息,对比目标空间几何信息,使用目标物姿态调整系统调整光谱在线检测目标物姿态。Step S6: Online detection of the spatial geometric information of the target object based on the solved spectrum, comparing the spatial geometric information of the target object, and using the target object posture adjustment system to adjust the spectrum to detect the object posture online.
具体地,在步骤S1中,目标物姿态检测系统包括左CCD相机1和右CCD相机2两个CCD相机、光照箱3、荧光灯4、黑色背景5、计算机6。在系统中左CCD相机1和右CCD相机2均位于光照箱3的上方,两个CCD相机光心连线与光照箱3水平边平行,左CCD相机1和右CCD相机2光轴成角度放置,光照箱3顶部四角分别安装荧光灯4,被测光谱在线检测目标物放置在以黑色为黑色背景5的光照箱3底部。放置位置如图2所示。Specifically, in step S1 , the target posture detection system includes two CCD cameras, a
具体地,在步骤S1中,目标物姿态调整系统的调整物为放有目标物托盘7,圆形的托盘7底部孔洞为近红外光透射孔8,托盘7四周设置滚轮安装位置9,每个滚轮10分别连接相对应的水平旋转电机11和垂直旋电机12,水平旋转电机11和垂直旋电机12分别控制光谱在线检测目标物水平旋转和垂直旋转;水平旋转电机11和垂直旋电机12采用步进电机,托盘7底部与光照箱3底部平行并通过四个滚轮10将托盘7架空,而相应的步进电机固定在台面上。姿态调整目标物托盘如图3所示,步进电机放置位置如图4所示。Specifically, in step S1, the adjustment object of the target attitude adjustment system is the
具体地,在步骤S2中,创建好目标物姿态检测系统和目标物姿态调整系统之后,在进行摄取图像之前,需要对目标物姿态检测系统进行标定,系统标定流程如图5所示。标定出左右两个CCD相机参数和系统参数,对目标物姿态调整系统进行标定,标定托盘7和滚轮10坐标系参数和系统参数。Specifically, in step S2, after the target posture detection system and the target posture adjustment system are created, the target posture detection system needs to be calibrated before capturing images. The system calibration process is shown in FIG. 5 . The left and right CCD camera parameters and system parameters are calibrated, the target attitude adjustment system is calibrated, and the coordinate system parameters and system parameters of the
具体地,在步骤S2中,标定流程具体步骤为:Specifically, in step S2, the specific steps of the calibration process are:
步骤S21:采用相机获取目标物图像,然后进行图像特征提取,计算坐标参数;Step S21: Use the camera to acquire the image of the target object, then perform image feature extraction, and calculate the coordinate parameters;
两个处于同一水平面的左CCD相机1和右CCD相机2同时采集同一标定图像,分别标定左CCD相机1和右CCD相机2参数与系统参数,最后给出左CCD相机1和右CCD相机2在世界坐标系中的投影矩阵A1和A2。Two
上述根据空间几何原理标定出了各个相机的投影矩阵,系统参数即两台相机之间相对位置关系也需要确定,系统参数即旋转矩阵R和平移矢量T。左CCD相机1和世界坐标系的旋转、平移关系是Rl,Tl,右CCD相机2和世界坐标系的旋转、平移关系是与Rr,Tr。The projection matrix of each camera is calibrated according to the principle of space geometry above. The system parameters, that is, the relative positional relationship between the two cameras, also need to be determined. The system parameters are the rotation matrix R and the translation vector T. The rotation and translation relationship between the
世界坐标系坐标用Xw表示空间内任意一点,则左CCD相机1用Xl表示,右相CCD机2用Xr表示,则有下面方程式成立:The coordinates of the world coordinate system are represented by X w in any point in the space, then the
根据数学变换可以得到旋转矩阵R和平移矢量T:According to the mathematical transformation, the rotation matrix R and the translation vector T can be obtained:
以目标物苹果为实施例,根据相机采集的光谱在线检测目标物图像,提取光谱在线检测目标物特征点即苹果果蒂点或花萼点,以及苹果形心点坐标,用一条虚线连接这两点坐标,该虚线即为像面轴线。假设像面轴线的方程为ax+by+c=0,接着提取出光谱在线检测目标物在左右两个CCD相机平面上的投影方程分别为al x+bl y+cl=0和ar x+br y+cr=0。在各自CCD相机坐标系下,摄像系统焦距为f,投影方程与摄像光心所确定的的平面方程分别为:Taking the target apple as an example, detect the target image online according to the spectrum collected by the camera, extract the spectrum to detect the feature point of the target on-line, that is, the apple fruit pedicle point or calyx point, and the coordinates of the apple centroid point, and connect these two points with a dotted line Coordinates, the dotted line is the axis of the image plane. Assume that the equation of the image plane axis is ax+by+c=0, and then extract the projection equations of the spectral online detection target on the left and right CCD camera planes respectively as a l x+b l y+c l =0 and a r x+b r y+c r =0. In the respective CCD camera coordinate systems, the focal length of the camera system is f, and the plane equations determined by the projection equation and the camera optical center are respectively:
式中,al、bl、cl表示左CCD相机1轴线的相机坐标方程的系数;ar、br、cr表示右CCD相机2轴线的相机坐标方程的系数;x表示特征点横坐标,y表示特征点纵坐标。将公式(3)转换为世界坐标系中的方程为:In the formula, a l , b l , c l represent the coefficients of the camera coordinate equation of the 1-axis of the left CCD camera; a r , b r , and c r represent the coefficients of the camera coordinate equation of the 2-axis of the right CCD camera; x represents the horizontal axis of the feature point Coordinates, y represents the ordinate of the feature point. Convert formula (3) to the equation in the world coordinate system as:
式中,Al、Bl、Cl、Dl表示左CCD相机1轴线的世界坐标方程的系数;Ar、Br、Cr、Dr表示右CCD相机2轴线的世界坐标方程的系数;x表示特征点横坐标,y表示特征点纵坐标,z表示特征点竖坐标。根据空间几何原理,方程组(4)即为空间轴线的方程,空间轴线的三个方向数分别为:In the formula, A l , B l , C l , D l represent the coefficients of the world coordinate equation of the
根据式(5)求出光谱在线检测目标物轴线与空间坐标系中XOY平面投影的夹角和光谱在线检测目标物轴线在XOY平面的投影与空间X轴的夹角。According to the formula (5), the angle between the axis of the online spectrum detection object and the XOY plane projection in the space coordinate system and the angle between the projection of the axis of the spectrum online detection object on the XOY plane and the X axis of space are obtained.
步骤S22:建立基座坐标系,然后进行坐标系参数的计算;Step S22: Establish the base coordinate system, and then calculate the parameters of the coordinate system;
步骤S23:获取步骤S21、S22参数,将步骤S21求得的光谱在线检测目标物的空间几何参数转换到目标物姿态调整系统的基座坐标系下。分别定义CCD相机与基座坐标之间的旋转矩阵R’和平移向量T’,R’和T’为相机与基座坐标之间的初始校正参数。通过参数从而解得目标物姿态调整系统基座坐标系下的光谱在线检测目标物空间几何参数,并且与设定的目标姿态空间几何参数对比,对比检测如图6所示。Step S23: Obtain the parameters of steps S21 and S22, and convert the spatial geometric parameters of the spectral online detection target obtained in step S21 into the base coordinate system of the target attitude adjustment system. Define the rotation matrix R ' and translation vector T ' between the CCD camera and the coordinates of the base respectively, and R ' and T ' are the initial correction parameters between the coordinates of the camera and the base. Through the parameters, the spectrum in the base coordinate system of the target attitude adjustment system is obtained, and the spatial geometric parameters of the target object are detected online, and compared with the set target attitude space geometric parameters. The comparison detection is shown in Figure 6.
具体地,在步骤S23中,对比检测流程如图6所示,具体流程为:给出光谱在线检测目标物,判断该目标物是否在目标参数范围内,如果是则结束,如果不是则将空间参数转换为基座坐标参数,调整系统进行光谱在线检测,获取调整后的光谱在线检测目标物姿,然后再判断该目标是否在目标参数范围内,如果是则结束,如果不是则继续循环处理。Specifically, in step S23, the comparative detection process is shown in Figure 6, and the specific process is: given the spectrum to detect the target object on-line, judging whether the target object is within the target parameter range, if it is, then end, if not, then the space The parameters are converted into base coordinate parameters, and the system is adjusted for online spectrum detection, and the adjusted spectrum is obtained for online detection of the target object posture, and then it is judged whether the target is within the target parameter range, if it is, it ends, if not, it continues to loop.
具体地,在步骤S4中,本实施例的目标物以水果为例,系统摄取光谱在线检测目标物图像之后,对图像进行预处理,以适合光谱在线检测目标物特征提取。目标物源图像的预处理包括图像增强算法,灰度化,直方图均衡化。Specifically, in step S4, the object of this embodiment is fruit as an example. After the system captures the image of the object for online spectral detection, it preprocesses the image to be suitable for feature extraction of the object for online spectral detection. The preprocessing of the target source image includes image enhancement algorithm, gray scale, and histogram equalization.
具体地,在步骤S4中,进行光谱在线检测目标物特征提取时,要提取被测光谱在线检测目标物的位置点、果梗或花萼点、光谱在线检测目标物边缘特征以及大小特征;其中,目标物的大小特征提取,使用投影面积法来提取。Specifically, in step S4, when performing feature extraction of the online spectral detection target, the position point, fruit stem or calyx point of the measured spectral online detection target, edge features and size features of the spectral online detection target should be extracted; wherein, The size feature extraction of the target object is extracted using the projected area method.
具体地,在步骤S5中,通过判断是否有果梗或花萼点,并且目标物外轮廓寻找目标物形心点坐标及其对称轴来判断目标物放置方式,通过目标物图像的位置点和果梗或花萼点坐标提取像面轴线,采用空间交汇法来求解目标物轴线的三维姿态,采用近似匹配位置点的方法求解出目标物位置点世界坐标,以及利用光谱在线检测目标物大小求解公式得到光谱在线检测目标物实际大小。Specifically, in step S5, by judging whether there is a fruit stalk or a calyx point, and looking for the coordinates of the centroid point of the target and its symmetry axis on the outer contour of the target, the way to place the target is judged. The coordinates of the stalk or calyx point are used to extract the axis of the image plane, and the spatial intersection method is used to solve the three-dimensional attitude of the target axis. The spectrum detects the actual size of the target object online.
具体地,在步骤S6中,通过目标物位置点世界坐标,与目标坐标的世界坐标对比,判断是否通过目标物姿态调整系统调整光谱在线检测目标物姿态。求解光谱在线检测目标物姿态参数时,分两种情况:目标物竖直放置时直接定义姿态参数,无需求解;倾斜放置时,采用空间几何知识的方法求解目标物姿态参数。Specifically, in step S6, by comparing the world coordinates of the target position point with the world coordinates of the target coordinates, it is judged whether to adjust the spectrum to detect the target posture online through the target posture adjustment system. There are two situations when solving the attitude parameters of the spectrum online detection target object: when the target is placed vertically, the attitude parameters are directly defined, and there is no need to solve; when the object is placed obliquely, the spatial geometry knowledge method is used to solve the target attitude parameters.
将光谱在线检测目标物姿态参数与目标姿态参数对比,若在误差范围内则光谱在线检测目标物姿态不需要调整,否则将姿态参数相关数据送入目标物姿态调整系统的控制机构,通过驱动电机调节圆形托盘7的滚轮10按照光谱在线检测目标物目标姿态进行调整。本实施例中,采用步进电机控制滚轮转动实现不同的旋转角度后,相机拍摄并处理后得到的果品轮廓二值图如图7所示。Compare the attitude parameters of the spectrum online detection target with the target attitude parameters. If it is within the error range, the spectrum online detection target attitude does not need to be adjusted. Otherwise, the data related to the attitude parameters will be sent to the control mechanism of the target attitude adjustment system. Adjust the
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that, for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211441064.6A CN115753610A (en) | 2022-11-17 | 2022-11-17 | Adjusting method for spectrum online detection of placement posture of target object |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211441064.6A CN115753610A (en) | 2022-11-17 | 2022-11-17 | Adjusting method for spectrum online detection of placement posture of target object |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115753610A true CN115753610A (en) | 2023-03-07 |
Family
ID=85372727
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211441064.6A Pending CN115753610A (en) | 2022-11-17 | 2022-11-17 | Adjusting method for spectrum online detection of placement posture of target object |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115753610A (en) |
-
2022
- 2022-11-17 CN CN202211441064.6A patent/CN115753610A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110497187B (en) | Sunflower module assembly system based on vision guidance | |
WO2021138990A1 (en) | Adaptive detection method for checkerboard sub-pixel corner points | |
CN106935683B (en) | A kind of positioning of solar battery sheet SPEED VISION and correction system and its method | |
CN108010036A (en) | A kind of object symmetry axis detection method based on RGB-D cameras | |
CN105261022B (en) | PCB board matching method and device based on outer contour | |
CN106127758B (en) | A kind of visible detection method and device based on virtual reality technology | |
CN112949478B (en) | Target detection method based on tripod head camera | |
CN107869954B (en) | A binocular vision volume weight measurement system and its realization method | |
CN106485757A (en) | A kind of Camera Calibration of Stereo Vision System platform based on filled circles scaling board and scaling method | |
CN111210468A (en) | Image depth information acquisition method and device | |
CN107392929B (en) | An intelligent target detection and size measurement method based on human visual model | |
WO2022134490A1 (en) | Gimbal target conversion control method, apparatus, device, and storage medium | |
CN106643555B (en) | Connector recognition methods based on structured light three-dimensional measurement system | |
CN108986070A (en) | A kind of rock fracture way of extensive experimentation monitoring method based on high-speed video measurement | |
CN112258455A (en) | Detection method for detecting spatial position of part based on monocular vision | |
CN107292871A (en) | A kind of real-time correction algorithm of transformer station's round meter | |
CN110174065B (en) | Fruit size nondestructive testing method based on orthogonal binocular machine vision | |
CN111768453A (en) | Navigation and positioning device and method in spacecraft cluster ground simulation system | |
CN110554046A (en) | detection system and method for pins of electronic components | |
CN115187612A (en) | Plane area measuring method, device and system based on machine vision | |
CN117670887A (en) | Tin soldering height and defect detection method based on machine vision | |
CN106709529A (en) | Visual detection method for color difference classification of photovoltaic cells | |
CN115753610A (en) | Adjusting method for spectrum online detection of placement posture of target object | |
CN111738971A (en) | Circuit board stereo scanning detection method based on line laser binocular stereo vision | |
CN108898585B (en) | Shaft part detection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |