# Roujack/mathAI

一个拍照做题程序。输入一张包含数学计算题的图片，输出识别出的数学计算式以及计算结果。This is a mathematic expression recognition project.

Repository: https://github.com/Roujack/mathAI
Canonical: https://ross.abutalabs.com/products/mathai
Language: Python
License: MIT
License Family: permissive
Topics: pattern-recognition, expression-recognition, compiler-principles, opencv, tensorflow
Last push: 2020-12-13T02:14:38+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2881, "days_push": 2090, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2370, forks 562 (observed 2026-08-28T04:06:41.753212+00:00)

## What it is
mathAI is a photo-based math problem solver written in Python: it takes an image containing a handwritten or printed arithmetic expression, recognizes the characters with a TensorFlow CNN, and outputs the parsed expression and its computed result. It combines OpenCV preprocessing, LeNet-5 character recognition, and compiler-principles techniques (operator precedence and recursive descent parsing) to understand math formulas.

## Use cases
- solve math problems by taking a photo
- recognize handwritten math expressions from images
- extract arithmetic expressions from a picture and compute the answer
- build a photo-to-answer homework solver
- study an end-to-end OCR plus formula parsing pipeline
- segment and classify math characters in images

## When to choose
- you want a complete reference framework for photo-based math expression recognition
- you need to recognize simple one-dimensional arithmetic expressions (addition, subtraction, multiplication, division) from images
- you want to learn how compiler techniques like operator precedence and recursive descent apply to formula parsing
- you need a starting point to extend toward more complex mathematical formula recognition

## When to avoid
- you need to recognize complex or multi-line mathematical formulas, as the released version only handles simple one-dimensional arithmetic
- you need production-grade robustness, since image preprocessing and spatial-relation heuristics are acknowledged as weak
- you expect active maintenance, as the last release dates from December 2020
- you need a ready-to-use consumer app rather than a semi-open research/learning project

## Facets
- artifact type: application
- maturity: maintenance
- function: computer-vision, ocr, image-processing, machine-learning, parser, math
- domain: computer-vision, image-processing, education
- platform: python, cross-platform
- tags: math-expression-recognition, photo-solving, opencv, tensorflow, lenet5, compiler-principles, chinese, natural-language-processing, algorithms

## Member repositories
- Roujack/mathAI (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:41.753212+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:35:24.377206+00:00, confidence not recorded.
  - readme: https://github.com/Roujack/mathAI (fetched 2026-08-28T04:06:41.753212+00:00, sha 01ce3f65f778)
- Data as of 2026-08-30T08:39:29.467469+00:00.
