Ejemplo n.º 1
0
def gnrt_user(train_data, one_img, gnrt_num, user, bldshps, all_data):
    for ci in range(gnrt_num):
        train_data.append(base.TrainOnePoint(one_img, user))
        train_data[-1].dis = one_img.dis.copy()

        first = random.randrange(len(all_data))
        train_data[-1].user = all_data[first].user.copy()

        util.recal_dis(train_data[-1], bldshps)
        util.get_slt_land_cor_init(train_data[-1], bldshps, user)
Ejemplo n.º 2
0
def gnrt_rot(train_data, one_img, gnrt_num, user, bldshps):
    for ci in range(gnrt_num):
        train_data.append(base.TrainOnePoint(one_img, user))
        train_data[-1].dis = one_img.dis.copy()

        #here, after rand the dif of angle, we should update slt
        for i in range(3):
            train_data[-1].init_angle[i] \
            +=2*rand_angle_range[i]*np.random.random((1,))-rand_angle_range[i]

        util.get_slt_land_cor_init(train_data[-1], bldshps, user)
Ejemplo n.º 3
0
def gnrt_tslt(train_data, one_img, gnrt_num, user):
    print('gnrt_tslt')
    for ci in range(gnrt_num):

        train_data.append(base.TrainOnePoint(one_img, user))

        for i in range(2):
            train_data[-1].init_tslt[i]\
            +=2*rand_tslt_range[i]*np.random.random((1,))-rand_tslt_range[i]

        train_data[-1].init_tslt[2]\
            +=2*rand_tslt_range[2]*train_data[-1].tslt[2]*np.random.random((1,))-rand_tslt_range[2]*train_data[-1].tslt[2]
Ejemplo n.º 4
0
def gnrt_fcs(train_data, one_img, gnrt_num, user, bldshps):
    for ci in range(gnrt_num):
        train_data.append(base.TrainOnePoint(one_img, user))
        # =============================================================================
        #         print('one_img land cor------------------one_img:\n',one_img.land_cor)
        #         print('land cor------------------',train_data[-1].land_cor)
        # =============================================================================

        train_data[-1].dis = one_img.dis.copy()

        train_data[-1].fcs += (np.random.random(
            (1, ))[0]) * range_rand_fcs * 2 - range_rand_fcs

        util.recal_dis(train_data[-1], bldshps)
Ejemplo n.º 5
0
def gnrt_exp(train_data, one_img, gnrt_num, user, all_data, bldshps):
    for ci in range(gnrt_num):
        train_data.append(base.TrainOnePoint(one_img, user))

        if (rand_pick_exp == 1):
            first = random.randrange(len(all_data))
            second = random.randrange(len(all_data[first].data))
            train_data[-1].init_exp = all_data[first].data[second].exp.copy()
        else:
            for i in range(1, train_data[-1].init_exp.shape[0]):
                train_data[-1].init_exp[i]\
                    +=2*rand_exp_range*np.random.random((1,))-rand_exp_range

        util.get_slt_land_cor_init(train_data[-1], bldshps, user)