I am using OpenCV to prepare images for OCR from an iPhone camera, and I have been having trouble getting the results I need for an accurate OCR scan. Here is the code I am
As the light is almost in uniform, and the foreground is easily distinguished with the background. So I think just directly threshold (using OTSU) is ok for OCR. (Almost the same with @Andrey's answer in text regions).
OpenCV 3 Code in Python:
#!/usr/bin/python3
# 2018.01.17 16:41:20 CST
import cv2
import numpy as np
img = cv2.imread("ocr.jpg")
gray = cv2.cvtColor(median, cv2.COLOR_BGR2GRAY)
th, threshed = cv2.threshold(gray,127,255, cv2.THRESH_BINARY|cv2.THRESH_OTSU)
print(th)
cv2.imwrite("res.png", threshed)