Near-infrared star counts as a test of a Galactic bar structure