Commented the code where jpeg image was taken and converted to binary image. Included the code where we take a tiff image and then pass the image file to the tesseract API to get data. Works good