How to save ip_surf image data?

You can refer the example from other user on this topic: Use nvds_obj_enc_process to save image is much slower than opencv