All Projects → xiaoyu258 → Docproj

xiaoyu258 / Docproj

Licence: mit
Document Rectification and Illumination Correction using a Patch-based CNN

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Docproj

uptasticsearch
An Elasticsearch client tailored to data science workflows.
Stars: ✭ 47 (-74.18%)
Mutual labels:  document-database
Mongodb Interview Questions
MongoDB Interview Questions
Stars: ✭ 31 (-82.97%)
Mutual labels:  document-database
Kubernetes Elasticsearch Cluster
Elasticsearch cluster on top of Kubernetes made easy.
Stars: ✭ 1,505 (+726.92%)
Mutual labels:  document-database
minidb
A minimal in-memory distributed master-less document database
Stars: ✭ 29 (-84.07%)
Mutual labels:  document-database
Jsonlite
A simple, self-contained, serverless, zero-configuration, json document store.
Stars: ✭ 819 (+350%)
Mutual labels:  document-database
Ftserver Cs
Lightweight iBoxDB Full Text Search Server for C#
Stars: ✭ 81 (-55.49%)
Mutual labels:  document-database
Orleans.CosmosDB
Orleans providers for Azure Cosmos DB
Stars: ✭ 36 (-80.22%)
Mutual labels:  document-database
Fdb Document Layer
A document data model on FoundationDB, implementing MongoDB® wire protocol
Stars: ✭ 165 (-9.34%)
Mutual labels:  document-database
Apiauto
☔ 敏捷开发最强大易用的 HTTP 接口工具,机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释。☔ The most advanced tool for HTTP API. Testing with machine learning, generating codes, static analysising, generating documents, generating annotations and floating hints.
Stars: ✭ 820 (+350.55%)
Mutual labels:  document-database
Marten
.NET Transactional Document DB and Event Store on PostgreSQL
Stars: ✭ 1,654 (+808.79%)
Mutual labels:  document-database
skytable
Skytable is an extremely fast, secure and reliable real-time NoSQL database with automated snapshots and TLS
Stars: ✭ 696 (+282.42%)
Mutual labels:  document-database
Orientdb
OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries. OrientDB Community Edition is Open Source using a liberal Apache 2 license.
Stars: ✭ 4,394 (+2314.29%)
Mutual labels:  document-database
Crux
General purpose bitemporal database for SQL, Datalog & graph queries
Stars: ✭ 1,296 (+612.09%)
Mutual labels:  document-database
database
Key-Value/Document store database library with btree and ARTree indexing methods, SSN-MVCC concurrency
Stars: ✭ 67 (-63.19%)
Mutual labels:  document-database
Arangodb
🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
Stars: ✭ 11,880 (+6427.47%)
Mutual labels:  document-database
azure-event-driven-data-pipeline
Building event-driven data ingestion pipelines in Azure
Stars: ✭ 13 (-92.86%)
Mutual labels:  document-database
Marten.fsharp
A set of FSharp wrappers around Marten
Stars: ✭ 40 (-78.02%)
Mutual labels:  document-database
Rekord
A javascript REST ORM that is offline and real-time capable
Stars: ✭ 171 (-6.04%)
Mutual labels:  document-database
Lokidb
blazing fast, feature-rich in-memory database written in TypeScript
Stars: ✭ 145 (-20.33%)
Mutual labels:  document-database
Badger
Fast key-value DB in Go.
Stars: ✭ 10,127 (+5464.29%)
Mutual labels:  document-database

DocProj

Project page | Paper

The source code of Document Rectification and Illumination Correction using a Patch-based CNN by Xiaoyu Li, Bo Zhang, Jing Liao, Pedro V. Sander, to appear at SIGGRAPH Asia 2019, Brisbane, Australia.

Prerequisites

  • Linux or Windows
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Geometric Rectification

Dataset Generation

We use Blender to automatically generate synthetic distorted document image and the corresponding flow.

You can download a small dataset with 20 samples (438MB) from here for fun and the full dataset with 2450 samples (65GB) from BitTorrent or from OneDrive.

The dataset includes three folders:

  • img (the distorted images, with the shape of [2400, 1800, 3])
  • img_mask (the mask of background, with the shape of [2400, 1800])
  • flow (the forward flow of the distorted images, with the shape of [2, 2400, 1800])

The first thing you need to do is to crop the dataset to patches for training. Change arguments to your own and run the following commands. For help message about optional arguments, run python xxx.py --h

python local_patch.py   # crop images and flows to local patches and local patch flows
python global_patch.py  # crop images to global patches

Training

Run the following command for training and change the optional arguments like dataset directory, etc.

python train.py

Use a Pre-trained Model

You can download the pre-trained model here.

Run the following command for resizing and cropping the test document image to local and global patches and estimating the patch flows:

python eval.py [--imgPath [PATH]] [--modelPath [PATH]]
               [--saveImgPath [PATH]] [--saveFlowPath [PATH]]
               
--imgPath             Path to input image
--modelPath           Path to pre-trained model
--saveImgPath         Path to saved cropped image
--saveFlowPath        Path to saved estimated flows

Stitch flow

Download the Windows executable program here to stitch the patch flows to get the image flow.

Run the following command:

Graphcut.exe [Input Path] [Output Path]

[Input Path] is the path to input patch flows with the shape of [yNum, xNum, 2, patchH, patchW], where yNum and xNum are the number of patch in y and x direction, patchH and patchW are the height and width of a local patch.

[Output Path] is the path to the output stitched flow with the shape of [2, H, W].

Notes: The path should be absolute path with "//" due to the path parse function in the program. e.g. "H://Release//test data//2_patchFlows.npy"

Resampling

Import resampling.rectification function to resample the distorted image by the stitched flow.

The distorted image should be a Numpy array with the shape of [H, W, 3] for a color image or [H, W] for a greyscale image, the stitched flow should be an array with the shape of [2, H, W].

The function will return the resulting image and a mask to indicate whether each pixel will converge within the maximum iteration.

To help you follow all these steps, we also give an example with all the intermediate results here in the test data folder.

Illumination Correction

Training

Run the following command and change the optional arguments for training.

python train_illumination.py

Use a Pre-trained Model

You can download the pre-trained illNet model here and pre-trained vgg model here.

Run the following command for testing:

python eval_illumination.py [--imgPath [PATH]] [--savPath [PATH]] [--modelPath [PATH]]
                            
--imgPath             Path to input image
--savPath             Path to saved output
--modelPath           Path to pre-trained model
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].