# glcm

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

Latest version **0.5.8** (published 2023-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install glcm
pnpm add glcm
yarn add glcm
bun add glcm
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.8 |
| Published | 2023-06-03 |
| First published | 2023-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 917.4 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | Joseph Beuckman |
| Maintainers | jbeuckm |
| Keywords | webgl, glcm, texture analysis, computer vision |

## Links

- npm: https://www.npmjs.com/package/glcm
- Repository: https://github.com/jbeuckm/glcm
- Homepage: https://github.com/jbeuckm/glcm#readme
- Issues: https://github.com/jbeuckm/glcm/issues
- npm.io page: https://npm.io/package/glcm

## Dependencies (5)

- [twgl.js](https://npm.io/package/twgl.js.md) ^5.3.1
- [webpack](https://npm.io/package/webpack.md) ^5.84.1
- [ts-loader](https://npm.io/package/ts-loader.md) ^9.4.3
- [typescript](https://npm.io/package/typescript.md) ^5.0.4
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^4.15.0

## Recent versions

- 0.5.8 (latest) — 2023-06-03
- 0.5.6 — 2023-05-27
- 0.5.5 — 2023-05-27
- 0.5.4 — 2023-05-27
- 0.5.3 — 2023-05-27
- 0.5.1 — 2023-05-27
- 0.5.0 — 2023-05-27
- 0.4.0 — 2023-05-27
- 0.3.0 — 2023-05-26
- 0.0.21 — 2023-05-26
- 0.0.2 — 2023-05-26
- 0.0.1 — 2023-05-26

## README

# 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](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

```javascript
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)
})
```

---
_Source: https://npm.io/package/glcm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
