Rammohan0504 commited on
Commit
631ce43
·
verified ·
1 Parent(s): b272a68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,12 +7,12 @@ import cv2
7
  from ocr_engine import extract_weight_from_image
8
 
9
  def preprocess_image(img):
10
- # Enhance sharpness and contrast (PIL)
11
  img = img.filter(ImageFilter.SHARPEN)
12
  enhancer = ImageEnhance.Contrast(img)
13
  img = enhancer.enhance(2.0)
14
 
15
- # Convert PIL image to OpenCV format
16
  img_cv = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
17
  return img_cv
18
 
 
7
  from ocr_engine import extract_weight_from_image
8
 
9
  def preprocess_image(img):
10
+ # Enhance sharpness & contrast (PIL)
11
  img = img.filter(ImageFilter.SHARPEN)
12
  enhancer = ImageEnhance.Contrast(img)
13
  img = enhancer.enhance(2.0)
14
 
15
+ # Convert to OpenCV image
16
  img_cv = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
17
  return img_cv
18