image-decoder
v1.0.2
Published
Analyzes objects within an image and returns relevant keywords and text
Downloads
10
Maintainers
Readme
Image-to-Text Module
This module performs simple object detection and can also read text, numbers, characters, and barcodes from images. It identifies objects in a given image file and provides a textual description using an internet-based API.
Features:
- Supports text and barcode recognition.
- Promise-based API for asynchronous handling.
Usage Instructions:
var imageToTextDecoder = require('image-to-text');
var file = {
name: 'iphone.jpeg',
path: './image/'
};
var key = '<KEY>; // Your API key from Cloudsight API (https://cloudsightapi.com)
imageToTextDecoder.setAuth(key);
imageToTextDecoder.getKeywordsForImage(file).then(function(keywords) {
console.log(keywords);
}, function(error) {
console.log(error);
});
Example Output
space gray iPhone
Input File
- Location:
./image/iphone.jpeg
Barcode and Character Recognition Example:
Output:
Barcode: 0 36000 29145 2
Nike Just Do It logo
File Specifications
- Object Format: Specify name and path.
var file = { name: 'iphone.jpeg', path: './image/' };
- Root Path: If only the name is provided, the path is assumed to be the root directory.
var file = { name: 'iphone.jpeg' };
- Buffer Content: Include file content as a buffer.
fs.readFile('./iphone.jpeg', function(err, content) { var file = { name: 'iphone.jpeg', path: './', content: content }; });
- String Format: A simple string indicating the file name; path is treated as root.
var file = 'iphone.jpeg';