Socket
Socket
Sign inDemoInstall

glcm

Package Overview
Dependencies
270
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    glcm

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


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 03 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc