from_labelme: Extract block coordinates from labelme files

Description Usage Arguments Value Examples

View source: R/process_output.R

Description

This is a specialized function for use in connection with text reordering. It takes the output from the image annotation tool 'Labelme' https://github.com/wkentaro/labelme and turns it into a one-row data frame compatible with other 'daiR' functions for text reordering such as reassign_tokens2(). See package vignette on text reconstruction for details.

Usage

1
from_labelme(json, page = 1)

Arguments

json

a json file generated by 'Labelme'

page

the number of the annotated page

Value

a data frame with location coordinates for the rectangle marked in 'Labelme'.

Examples

1
2
3
4
5
## Not run: 
new_block <- from_labelme("document1_blocks.json")
new_block <- from_labelme("document5_blocks.json", 5)

## End(Not run)

daiR documentation built on June 11, 2021, 5:16 p.m.