Automate Mobile camera

Hi there, anyone can advise me how to do automation test when the apk have camera feature such as to scan id card, scan bar code and etc… thank you