0.5.8 • Published 12 months ago

glcm v0.5.8

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

glcm

Gray-Level Co-Occurrence Matrix image analyzer with WebGL.

A great explanation of what this does: https://towardsdatascience.com/glcms-a-great-tool-for-your-ml-arsenal-7a59f1e45b65

screenshot.png

Installation

This package requires twgl.js to be added via script tag to the html:

<script src="https://twgljs.org/dist/twgl-full.min.js"></script>

Install with yarn or npm:

npm install glcm

Usage

import GLCM from 'glcm'

const gl = document.getElementById('my-canvas').getContext('webgl')
const glcm = new GLCM(gl)

glcm.loadImage(imageSrc).then(async ({ image }) => {
  document.appendChild(image)

  await glcm.init()

  const neighborsBi = glcm.findNeighbors({
    angle: Math.PI / 4,
    distance: 7,
  })

  const mfbi = glcm.buildMatrices(neighborsBi, {
    reach: 8,
    step: 4,
    levels: 16,
  })

  const correlationFbi = glcm.correlation(mfbi)

  glcm.display(correlationFbi)
})
0.5.8

12 months ago

0.5.6

12 months ago

0.5.5

12 months ago

0.5.4

12 months ago

0.5.3

12 months ago

0.5.1

12 months ago

0.5.0

12 months ago

0.4.0

12 months ago

0.3.0

12 months ago

0.0.21

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago