Detection technique for transition between deep penetration mode and shallow penetration mode in CO2 laser welding of metals