コード例 #1
0
    def get_frame(self, src):

        #tempc = fof.to_float(src)
        tempc = src
        tempc = cv2.cvtColor(tempc, cv2.COLOR_BGR2GRAY)
        tempc = fof.to_uint(fof.to_float(tempc) * 1.5)
        tempc = self.diff1.get_frame(tempc)

        tempc = fof.thresh(tempc, 50)

        tempc = fof.blur(tempc, 5)

        #temp1 = cv2.cvtColor(tempc, cv2.COLOR_GRAY2BGR)
        temp1 = fof.squash(tempc, 12.0, 0.9)
        # temp1 = cv2.cvtColor
        # temp1 = tempc
        temp1 = self.diff2.get_frame(temp1)
        temp1 *= 5
        temp1 = self.trails.get_frame(temp1, 9.0, .9)

        temp2 = cv2.bitwise_not(tempc)
        temp2 = self.wrap109.get_frame(temp2, 225)
        temp2 = cv2.bitwise_not(temp2)


        dst = 0.8 * fof.to_float(temp1) + 0.6 * fof.to_float(temp2)

        # dst = cv2.cvtColor(dst.astype('float32'), cv2.COLOR_GRAY2BGR)
        # dst = cv2.cvtColor(dst, cv2.COLOR_GRAY2BGR)


        return fof.to_uint(dst)
コード例 #2
0
    def get_frame(self, src, threshold):
        temp = src.copy()
        temp = fof.thresh(temp, threshold)
        temp = fof.contour(temp, .01, 9, 1.5, (255, 255, 255))

        temp = self.trails.get_frame(temp, 9.0, 0.8)

        temp = 2 * fof.to_float(temp) + fof.to_float(src) * .6
        return fof.to_uint(temp)
コード例 #3
0
    def get_frame(self, src, threshold):
        temp = fof.to_uint(src.copy())
        temp = fof.thresh(temp, threshold)
        temp = fof.contour(temp, .01, 9, 1, (255, 255, 255))

        temp = self.trails.get_frame(fof.to_float(temp), 9.0, 0.8)

        temp = temp * 10 + src

        return fof.to_float(temp)
コード例 #4
0
ファイル: Trails.py プロジェクト: MichaelRyanWebber/funcv
    def get_frame(self, src, gain, decay):

        if self.first:
            self.avg = fof.to_float(src)
            self.first = False

        ret, self.avg = cv2.threshold(self.avg, 0.001, 255, cv2.THRESH_TOZERO)

        self.avg = (1.0 - decay) * fof.to_float(src) + decay * self.avg

        #fof.to_uint(self.avg)

        return fof.to_uint(self.avg)
コード例 #5
0
    def get_frame(self, src):
        tempc = fof.to_float(src)
        tempc = fof.blur(tempc, 15)
        tempd = cv2.cvtColor(tempc, cv2.COLOR_BGR2GRAY)
        tempd = self.diff.get_frame(tempd)
        tempd = self.blacklines2.get_frame(tempd, 60)
        tempd = fof.blur(tempd, 1)

        tempd = self.alpha.get_frame(tempd, tempc) / 255.0
        return tempd