Cognex reports 24% Q1 revenue growth and raises guidance