track.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:DrosophilaCooperative 作者: avaccari 项目源码 文件源码
def processFrame(self):
        # If we are enhancing the image
        if self.enhance:
            # Frangi vesselness to highlight tubuar structures
            gray = cv2.cvtColor(self.sourceFrame, cv2.COLOR_BGR2GRAY)
            tub = tubes(gray, [5, 12])
            tubular = cv2.cvtColor(tub, cv2.COLOR_GRAY2BGR)

            # Merge with original to ennhance tubular structures
            high = 0.3
            rest = 1.0 - high
            colorized = cv2.addWeighted(self.sourceFrame, rest, tubular, high, 0.0)
    #        colorized = cv2.add(self.sourceFrame, tubular)

            # Tile horizontally
            self.processedFrame = np.concatenate((self.sourceFrame,
                                                  tubular,
                                                  colorized),
                                                 axis=1)
        else:
            self.processedFrame = self.sourceFrame;

        self.workingFrame = self.processedFrame.copy()

        # If we are tracking, track and show analysis
        if self.tracking is True:
            self.trackObjects()
            self.showBehavior()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号