Get the App
SLTechnology News&Howtos  ›  Development  › 

How to separate Picture from text with node.jS

Shulou Source: shulou.com Published: 2022-06-03 18:28:30 11月12日 Update

This article mainly explains the "node.jS how to achieve picture and text separation", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "node.jS how to achieve picture and text separation" bar!

This paper gives you an example to share the specific code of NodeJS to achieve image text segmentation, for your reference, the specific contents are as follows

Var fs = require ('fs'); var jpeg = require (' jpeg-js') function getSumRGB (data, I) {var cr = data.data [iLiu0] var cg = data.data [iTh1] var cb = data.data [iTh2] var srgb = (cr+cg+cb) return srgb} function getTopRGB (data, I) {var topIndex = (data.width * 4 *-1) I = I + topIndex Var cr = data.data [iTun0] var cg = data.data [iTun1] var cb = data.data [iTun2] return [cr,cg,cb]} function getHeightRGB (data, I, haveRGB) {var width = data.width var height = data.height var len = width * height * 4 var haveNum = 0 for

Tags: Object picture text minimum parameter style scale height content range learning address size container width size background control limit above Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Docker Shulou Technology macOS Redmi