光电工程, 2018, 45 (8): 180101, 网络出版: 2018-08-25
斑马鱼行为学自动观测装置关键算法研究
Research on key algorithms of automatic device for observing the behavior of zebrafish
摘要
斑马鱼行为学研究已受到越来越多的关注,其空间坐标计算是斑马鱼行为分析的基础。本文设计了一种基于双目立体视觉技术的斑马鱼行为学自动观测装置。结合p 率阈值化和模式阈值化,提出了图像阈值算法。计算斑马鱼图像轮廓像素坐标的平均值,得到单条斑马鱼的水平二维坐标X 和Y。当不同斑马鱼的Y 坐标差异较大时,对两台摄像机各自得到的斑马鱼的Y 坐标分别按大小排序,同一序号即为同一目标;当Y 坐标大小较为接近时,应用最小距离法识别同一斑马鱼。根据折射定理和观测装置结构,推导出斑马鱼三维空间坐标计算公式。算法复杂度分析显示本文提出的算法具有较少的运行时间。通过预设多条模型鱼的位置进行测试,计算结果与预设位置接近,验证了本文提出算法的正确性。
Abstract
Studies on the zebrafish behavior have attracted more and more attention. The algorithm of 3D coordinate calculation is the basis of zebrafish behavioral analysis. An automatic device for observing the behavior of zebrafish was designed based on binocular stereo vision technology. According to methods of p-rate threshold and pattern threshold, the image threshold algorithm was proposed. Horizontal X and Y coordinates of single zebrafish were figured out by calculating the average of pixel coordinates of image contour. If the difference of Y coordinate values among different zebrafishes is large, two groups of zebrafishes captured by two cameras will be set up separately according to the Y coordinate values, and the same serial number in two groups means the same target. If the difference of Y coordinate is small, the same target in different cameras was identified by the method of minimum distance. The formula of three-dimensional coordinates was conducted based on the refraction theorem and the structure of the observation device. Algorithm analysis shows that the running time of the algorithm proposed in the paper is saved. Validating testing to a number of fishes is designed and carried out to show that the calculated coordinates are close to the preset locations.
莫思特, 刘天琪, 何凌. 斑马鱼行为学自动观测装置关键算法研究[J]. 光电工程, 2018, 45(8): 180101. Mo Site, Liu Tianqi, He Ling. Research on key algorithms of automatic device for observing the behavior of zebrafish[J]. Opto-Electronic Engineering, 2018, 45(8): 180101.