fh2019ustc / DocGeoNet

The official code for “Geometric Representation Learning for Document Image Rectification”, ECCV, 2022.
Other
72 stars 2 forks source link

Questions about data normalization #6

Open Soongja opened 1 year ago

Soongja commented 1 year ago
  1. For training, is wc(3D coordinate map) normalized in the same way as wc in DewarpNet?(reference)
  2. After network inference, why is bm being multiplied by 0.99 as below? https://github.com/fh2019ustc/DocGeoNet/blob/5a56ab427af6748f96908ce089c5ceea0b6dfeed/inference.py#L29
fh2019ustc commented 1 year ago

I am sorry for the late reply.

  1. Yes

    msk = ((wc[:, :, 0] != 0) & (wc[:, :, 1] != 0) & (wc[:, :, 2] != 0)).astype(np.uint8)
    
    xmx, xmn, ymx, ymn, zmx, zmn = 1.2485291, -1.2410645, 1.2387834, -1.2280148, 0.63452387, -0.67187124
    wc[:, :, 0] = (wc[:, :, 0] - zmn) / (zmx - zmn)
    wc[:, :, 1] = (wc[:, :, 1] - ymn) / (ymx - ymn)
    wc[:, :, 2] = (wc[:, :, 2] - xmn) / (xmx - xmn)
    wc = cv2.bitwise_and(wc, wc, mask=msk)
  2. Please refer to this issue in DocTr.

Hope this helps! Good luck~