Gas trapping is an important mechanism in both Water or Surfactant Alternating Gas (WAG/SAG) and foam injection processes in porous media. Foams for enhanced oil recovery (EOR) can increase sweep efficiency as they decrease the gas relative permeability, and this is mainly due to gas trapping. However, gas trapping mechanisms are poorly understood. Some studies have been performed during corefloods, but little work has been carried out to describe the bubble trapping behaviour at the pore scale. We have carried out foam flow tests in a micromodel etched with an irregular hexagonal pattern. Image analysis of the foam flow allowed the bubble centres to be tracked and local velocities to be obtained. It was found that the flow in the micromodel is dominated by intermittency and localized zones of trapped gas. The quantity of trapped gas was measured both by considering the fraction of bubbles that were trapped (via velocity thresholding) and by measuring the area fraction containing immobile gas (via image analysis). A decrease in the quantity of trapped gas was observed for both increasing total velocity and increasing foam quality. Calculations of the gas relative permeability were made with the Brooks Corey equation, using the measured trapped gas saturations. The results showed a decrease in gas relative permeabilities, and gas mobility, for increasing fractions of trapped gas. It is suggested that the shear thinning behaviour of foam could be coupled to the saturation of trapped gas.