0.5.8 • Published 2 years ago

glcm v0.5.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.0.21

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago