Exemplo n.º 1
0
    e2 = path2.index(".")

    n1 = int(path1[s1 + 1:e1])
    n2 = int(path2[s2 + 1:e2])

    if n1 < n2: return -1
    elif n1 == n2: return 0
    else: return 1


if __name__ == '__main__':

    imgPath = 'datasets/PhC-C2DL-PSC/Sequence 1'
    imgList = getAllImgPath1(imgPath)

    ct = CenterPointTracking()
    pathDic = defaultdict(list)

    for index, i in enumerate(imgList):

        img = cv2.imread(i)

        pathDic = task1(index, img, pathDic)

    imgPath1 = "cell3task1&2"
    imgList1 = getAllImgPath1(imgPath1)
    imgList1 = sorted(imgList1, key=functools.cmp_to_key(diySort))

    img = cv2.imread(imgList1[0])

    fps = 2
Exemplo n.º 2
0
if __name__ == '__main__':

    imgPath = 'datasets/PhC-C2DL-PSC/Sequence 1'
    imgList = getAllImgPath1(imgPath)

    pathDic = defaultdict(list)
    frame = cv2.imread("datasets/PhC-C2DL-PSC/Sequence 1/t001.tif")

    selectedBox = cv2.selectROI(frame, False)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

    rects = [(selectedBox[0], selectedBox[1], selectedBox[0] + selectedBox[2],
              selectedBox[1] + selectedBox[3])]
    ct = CenterPointTracking()
    ct.update(rects)

    for index, i in enumerate(imgList):

        img = cv2.imread(i)
        pathDic = task1(index, img, pathDic)

    imgPath1 = "cell3task1&2"
    imgList1 = getAllImgPath1(imgPath1)
    imgList1 = sorted(imgList1, key=functools.cmp_to_key(diySort))

    img = cv2.imread(imgList1[0])

    fps = 2
    size = (img.shape[1], img.shape[0])