ported over vision code to java and added qr code detection