Answers.Body: <p>Assuming all of the tables will be oriented in similar ways (label and value running horizontally) and that all writing will be printed rather than handwritten, one solution method would be to use an image segmentation method such as <a href="https://docs.opencv.org/trunk/da/d22/tutorial_py_canny.html" rel="nofollow noreferrer">edge detection</a> to segregate these horizontal (label, value) pairs and then use a library like <a href="https://guides.nyu.edu/c.php?g=884390&amp;p=6355021" rel="nofollow noreferrer">Tesseract</a> for OCR.</p>
  <p>There are <a href="https://missinglink.ai/guides/computer-vision/image-segmentation-deep-learning-methods-applications/" rel="nofollow noreferrer">many types</a> of image segmentation methods that may all have value, but if my assumption holds regarding the neat, structured nature of the tables, then I think simple edge detection methods could be sufficient.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-16T13:14:28.023Z
Answers.Text: Traditional edge detection may not be enough because the tables could have no lines between cells. The last link gave me a good idea about image segregation though. I might try to train a model to detect the various segments and use Tesseract to read the value.
Answers.UserDisplayName: kapuetze
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-17T12:40:10.653Z
Answers.Text: Ah, my mistake @kapuetze - I didn't see the examples of tables with no horizontal lines. Still, glad you found something useful.
Answers.UserDisplayName: soitgoes
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-16T12:30:07.797Z
Answers.LastActivityDate: 2020-07-16T12:30:07.797Z
Answers.UserDisplayName: soitgoes
Body: <p>I would like to train a model that serializes a table of nutrition facts into it's values.
  The tables can vary in form and colour, but always contain the same set of keys (e.g. carbs, fats).
  Examples for these tables can be found <a href="https://www.google.de/search?q=n%C3%A4hrwerttabelle&amp;tbm=isch&amp;tbs=rimg%3ACWwAb8YC7ysGYe8IH4zwI7P5&amp;hl=de&amp;ved=0CAIQrnZqFwoTCMDMpr2w0eoCFQAAAAAdAAAAABAG&amp;biw=1903&amp;bih=938" rel="nofollow noreferrer">here</a>.</p>
  <p><em>The end goal is to be able to take a picture of such a table and have it's values added to a database.</em></p>
  <p>My initial idea was to train a model on finding subpictures of the individual key/value pairs and then using OCR to find out which value it actually is.</p>
  <p>As I am relatively new to ML, I would love to have some ideas about how one could try to build this, so I can do further research on it.</p>
  <p>Thanks</p>
  
Tags: <image-recognition><object-detection><models><optical-character-recognition>
Title: Detect data in tables of roughly the same structure
UserDisplayName: kapuetze
ThreadText: # Detect data in tables of roughly the same structure
  
  (Asked by: username_0 on 2020-07-16)
  
  I would like to train a model that serializes a table of nutrition facts into it's values.
  The tables can vary in form and colour, but always contain the same set of keys (e.g. carbs, fats).
  Examples for these tables can be found [here](https://www.google.de/search?q=n%C3%A4hrwerttabelle&tbm=isch&tbs=rimg%3ACWwAb8YC7ysGYe8IH4zwI7P5&hl=de&ved=0CAIQrnZqFwoTCMDMpr2w0eoCFQAAAAAdAAAAABAG&biw=1903&bih=938).
  
  *The end goal is to be able to take a picture of such a table and have it's values added to a database.*
  
  My initial idea was to train a model on finding subpictures of the individual key/value pairs and then using OCR to find out which value it actually is.
  
  As I am relatively new to ML, I would love to have some ideas about how one could try to build this, so I can do further research on it.
  
  Thanks
  
  **Tags:** image-recognition, object-detection, models, optical-character-recognition
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-16. Score: 0 | Accepted answer
  
  Assuming all of the tables will be oriented in similar ways (label and value running horizontally) and that all writing will be printed rather than handwritten, one solution method would be to use an image segmentation method such as [edge detection](https://docs.opencv.org/trunk/da/d22/tutorial_py_canny.html) to segregate these horizontal (label, value) pairs and then use a library like [Tesseract](https://guides.nyu.edu/c.php?g=884390&p=6355021) for OCR.
  
  There are [many types](https://missinglink.ai/guides/computer-vision/image-segmentation-deep-learning-methods-applications/) of image segmentation methods that may all have value, but if my assumption holds regarding the neat, structured nature of the tables, then I think simple edge detection methods could be sufficient.
  
  > **Comments:**
  > **username_0**: Traditional edge detection may not be enough because the tables could have no lines between cells. The last link gave me a good idea about image segregation though. I might try to train a model to detect the various segments and use Tesseract to read the value.  
  > **username_1**: Ah, my mistake @username_0 - I didn't see the examples of tables with no horizontal lines. Still, glad you found something useful.  
  
  ---
  
  