openfoodfacts-ai icon indicating copy to clipboard operation
openfoodfacts-ai copied to clipboard

Add system to flatten curved images

Open teolemon opened this issue 8 years ago • 2 comments

What

  • On bottles and tins, the image will be curved.
  • Other a way to flatten the image, as if it had been removed from the bottle.
  • http://dsp.stackexchange.com/questions/2406/how-to-flatten-the-image-of-a-label-on-a-food-jar

Part of

  • #8

teolemon avatar Jul 09 '16 17:07 teolemon

More details about this project by @HARSH-nith:

Problem

We are currently using Google Vision OCR in robotoff for extracting nutrition table data from images. The performance of google vision OCR is good, But the main drawback with google OCR is that it performs very badly with the images having non-aligned curvature. Due to this problem, we are unable to extract nutrition tables from packages like bottles and jars.

Proposed solution

Curvature Correction is a smart approach that we can employ to solve the issue of nonaligned curvature. I think that we can use curvature correction as an image pre-processing technique. Through this technique, the image will be pre-processed before being given to Google Vision OCR for extraction of nutrition table data from it. I am planning to integrate the curvature correction feature into robotoff.

raphael0202 avatar Sep 22 '22 09:09 raphael0202

Hii ! I started working on the image curvature correction , and i am following the Mathematica solution which involve finding the Contours , but i am getting some miscellaneous result. my solution is able to find nutrition-table in some images and failing in others

It would be great if you can guide me here (@raphael0202 @teolemon )

My solution involve following steps:

  • blurring image with 9x9 filter
  • Getting binary image with adaptive threshold
  • Then finding contours and choosing the largest one as nutrition-table contour

RESULTS results image 1,3,4,5,7 and 9 have correct contours

ashish-2005 avatar Feb 07 '23 03:02 ashish-2005