valeoai / carrada_dataset

GNU General Public License v3.0
85 stars 22 forks source link

_proc vs _raw #7

Closed yadonskov closed 2 years ago

yadonskov commented 2 years ago

I tried to get proc from raw, but it's not same as your _proc (rd_data_proc != rd_data_proc_alt ). Could you tell me exact transform of _raw -> _proc

    data_root = 'F:/radar_datasets/Carrada/2019-09-16-12-52-12'
    rd_data_raw = np.load('{}/range_doppler_raw/{:06d}.npy'.format(data_root, 0))
    rd_data_proc = np.load('{}/range_doppler_processed/{:06d}.npy'.format(data_root, 0))
    rd_data_proc_alt = 10 * np.log10(1 + rd_data_raw ** 2)

    plt.figure()
    plt.subplot(131)
    plt.imshow(rd_data_raw)
    plt.colorbar()
    plt.subplot(132)
    plt.imshow(rd_data_proc_alt)
    plt.colorbar()
    plt.subplot(133)
    plt.imshow(rd_data_proc)
    plt.colorbar()
    plt.show()
ArthurOuaknine commented 2 years ago

Hello.

I think you should apply the following transformation to rd_data_raw: rd_data_proc_alt = 10 * np.log10(1 + rd_data_raw) As far as I remember, the aggregation of the RAD tensor already included the square. If you are not sure about the _raw files, you can directly use the RAD tensor and implement the aggregation and the log transform to recover the _processed views.

I hope it will help.

0w1Gr3y commented 1 year ago

I tried to get proc from raw, but it's not same as your _proc (rd_data_proc != rd_data_proc_alt ). Could you tell me exact transform of _raw -> _proc

    data_root = 'F:/radar_datasets/Carrada/2019-09-16-12-52-12'
    rd_data_raw = np.load('{}/range_doppler_raw/{:06d}.npy'.format(data_root, 0))
    rd_data_proc = np.load('{}/range_doppler_processed/{:06d}.npy'.format(data_root, 0))
    rd_data_proc_alt = 10 * np.log10(1 + rd_data_raw ** 2)

    plt.figure()
    plt.subplot(131)
    plt.imshow(rd_data_raw)
    plt.colorbar()
    plt.subplot(132)
    plt.imshow(rd_data_proc_alt)
    plt.colorbar()
    plt.subplot(133)
    plt.imshow(rd_data_proc)
    plt.colorbar()
    plt.show()

@yadonskov did you successfully reconstruct _raw - _proc transform? I'm working on the same issue now

0w1Gr3y commented 1 year ago

In case anyone needs it in the future I'll provide my code that reproduces 7 out of 8 slices. RD_numpy still is not the same though. RD_numpy !=RD_processed in the provided carrada dataset, and so far I could not find the correct transformation for this last radar image.

def get_slices_carrada(rad_cube):
    rad_cube = np.abs(rad_cube) # don't need this for carrada RAD_tensors. But need this if you give it your own RAD tensors with complex dtype
    # RA
    RA_raw = np.sum(rad_cube, axis=2)
    RA_numpy = np.max(rad_cube, axis=2)
    RA_processed = 10 * np.log10(np.sum(rad_cube**2, axis=2)+1)
    # RD
    RD_raw = np.sum(rad_cube, axis=1)
    RD_raw = np.flip(RD_raw, axis=0)
    RD_processed = 10 * np.log10(np.sum(rad_cube** 2, axis=1)+1)
    RD_processed = np.flip(RD_processed, axis=0)
    RD_numpy = RD_processed
    # AD
    AD_raw = np.sum(rad_cube, axis=0)
    AD_raw = np.flip(AD_raw, axis=0)
    AD_processed = 10 * np.log10(np.sum(rad_cube**2, axis=0)+1)
    AD_processed = np.flip(AD_processed, axis=0)
    return RA_raw, RA_numpy, RA_processed, RD_raw, RD_numpy, RD_processed, AD_raw, AD_processed