def obb_text2listxy(text):
    """
    Purpose: parse x, y coordinates from text of obb(rotbox) annotation in xml
    Args: 
        text: text of obb(rotbox) annotation in xml, "[[x0,y0], [x1,y1], [x2,y2], [x3,y3]]"
    Returns:  lists of storing x y coordinates, 
        x: [x0, x1, x2, x3]
        y: [y0, y1, y2, y3]
    """
    strList = list(text)[1:-1] # 去掉首尾的'[', ']'
    # list of storing x y coordinates
    x = []
    y = []
    # double pointers
    i = 0
    j = 0
    while i != len(strList):
        if strList[i] == '[':
            x_ = ''
            j = i+1
            while strList[j] != ',':
                x_ += strList[j]
                j += 1
            x.append(int(x_))
            i = j
        if strList[i] == ' ' and strList[i+1] != '[':
            y_ = ''
            j = i+1
            while strList[j] != ']':
                y_ += strList[j]
                j += 1
            y.append(int(y_))
            i = j
        i += 1
    return x, y