Esempio n. 1
0
def run_depth_utils_example():
    """
        FUNC: examples of basic usage of depth utils
    """
    #     # load binary depth file
    #     depthFile = './depth_data/a01_s01_e01_sdepth.bin'
    #     depthSequence = loadDepthFile(depthFile, fType = 'bin')

    # load png depth files in a given path
    depthFilePath = './depth_data/d_a01_s01_e01_sdepth/'
    depthSequence = loadDepthFile(depthFilePath, fType='png')

    for depthData in depthSequence:

        # show depth data
        showDepthData(depthData)

        # show 3d points
        points = getWorldCoordinates(depthData)
        visualizePointCloud(points)

        projData = getFrontDepthProjections(points, projSize=depthData.shape)
        #         projImg = getDepthProjections(points)
        showDepthData(projData)

        r_alpha = math.pi / 2.  # angle around x-axis
        r_beta = 0  # angle around y-axis

        r_points = rotatePoints(points, r_alpha, r_beta)
        visualizePointCloud(r_points)

        projData = getDepthProjection(r_points)
        showDepthData(projData)
Esempio n. 2
0
def run_depth_utils_example():
    """
        FUNC: examples of basic usage of depth utils
    """
#     # load binary depth file
#     depthFile = './depth_data/a01_s01_e01_sdepth.bin'
#     depthSequence = loadDepthFile(depthFile, fType = 'bin')

    # load png depth files in a given path
    depthFilePath = './depth_data/d_a01_s01_e01_sdepth/'
    depthSequence = loadDepthFile(depthFilePath, fType = 'png')
    
    for depthData in depthSequence:
        
        # show depth data
        showDepthData(depthData)
        
        # show 3d points
        points = getWorldCoordinates(depthData)
        visualizePointCloud(points)
        
        projData = getFrontDepthProjections(points, projSize = depthData.shape)
#         projImg = getDepthProjections(points)
        showDepthData(projData)
        
        r_alpha = math.pi / 2.     # angle around x-axis
        r_beta = 0   # angle around y-axis
        
        r_points = rotatePoints(points, r_alpha, r_beta)
        visualizePointCloud(r_points)
        
        projData = getDepthProjection(r_points)
        showDepthData(projData)
Esempio n. 3
0
def run_feat_ext_example():
    """
        FUNC: examples of usage of feature extraction
    """
    # load binary depth file
    depthFile = './depth_data/a01_s01_e01_sdepth.bin'
    depthSequence = loadDepthFile(depthFile, fType='bin')

    dmhi = calDepthMHI(depthSequence)
    resizedDmhi = cv2.resize(dmhi, (128, 128))
    phog_vec = extractPHOGFeature(resizedDmhi)
Esempio n. 4
0
def run_feat_ext_example():
    """
        FUNC: examples of usage of feature extraction
    """
    # load binary depth file
    depthFile = './depth_data/a01_s01_e01_sdepth.bin'
    depthSequence = loadDepthFile(depthFile, fType = 'bin')
    
    dmhi = calDepthMHI(depthSequence)
    resizedDmhi = cv2.resize(dmhi, (128, 128))
    phog_vec = extractPHOGFeature(resizedDmhi)
Esempio n. 5
0
def run_seq_rep_example():
    """
        FUNC: examples of usage of sequence representation
    """
    # load binary depth file
    depthFile = './depth_data/a01_s01_e01_sdepth.bin'
    depthSequence = loadDepthFile(depthFile, fType='bin')

    dmht = calDepthMHT(depthSequence)

    # visualization
    cv2.imshow('front dmhi', dmht[0])
    cv2.imshow('top dmhi', dmht[1])
    cv2.imshow('side dmhi', dmht[2])
    cv2.waitKey()

    # any projections of frames in a sequence
    r_alpha = 0.
    r_beta = math.pi / 3.
    rProjSeq = rotateDepthSequence(depthSequence, r_alpha, r_beta)
    r_dmhi = calDepthMHI(rProjSeq)
    cv2.imshow('rotate projections', r_dmhi), cv2.waitKey()
Esempio n. 6
0
def run_seq_rep_example():
    """
        FUNC: examples of usage of sequence representation
    """
    # load binary depth file
    depthFile = './depth_data/a01_s01_e01_sdepth.bin'
    depthSequence = loadDepthFile(depthFile, fType = 'bin')
    
    dmht = calDepthMHT(depthSequence)
    
    # visualization
    cv2.imshow('front dmhi', dmht[0])
    cv2.imshow('top dmhi', dmht[1])
    cv2.imshow('side dmhi', dmht[2])
    cv2.waitKey()
        
    # any projections of frames in a sequence
    r_alpha = 0.
    r_beta = math.pi / 3.
    rProjSeq = rotateDepthSequence(depthSequence, r_alpha, r_beta)
    r_dmhi = calDepthMHI(rProjSeq)
    cv2.imshow('rotate projections', r_dmhi), cv2.waitKey()