duchengyao / gpu-based-image-stitching

A simple version of "GPU based parallel optimization for real time panoramic video stitching".
73 stars 8 forks source link

Apply mask code #19

Open Orfeasfil opened 4 days ago

Orfeasfil commented 4 days ago

Helo there! Great job!

Is there any code avaible that applies the refined mask too? Or at least a guide on how to add one?

Thank you in advance!

duchengyao commented 4 days ago

This method is not very general. In my case, because the upper part of the camera is the sky, we assume that the brightness and color of the sky are the same.

  1. First, take a row of pixels in the sky and stretch it to the entire picture as a mask
  2. Normalize pixel values ​​to a maximum of 255 mask_refine = 255 - max(mask) + mask
  3. Apply mask final_stitching = origin_stitching + (255 - mask_refine)