Socket
Book a DemoInstallSign in
Socket

se2-correlate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

se2-correlate

Correlation over the 2D rigid motion group for images

latest
Source
npmnpm
Version
0.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

se2-correlate

Computes the cross correlation for 2D images over the group of rigid motions.

Install

npm install se2-correlate

Example

"use strict"

var zeros = require("zeros")
var ops = require("ndarray-ops")
var getPixels = require("get-pixels")
var se2corr = require("se2-correlate")

getPixels("robot.png", function(err, robotPixels) {
  getPixels("maze.png", function(err, mazePixels) {
    var robot = ops.neqseq(robotPixels.pick(undefined, undefined, 3), 0)
    var maze = ops.ltseq(mazePixels.pick(undefined, undefined, 0), 128)

    var obstacle = zeros([64, 256, 256])
    ops.gtseq(se2corr(obstacle, robot, maze), 1.0)

    //Obstacle is now the configuration space obstacle fo the robot
  })
})

Here is an interactive visualization

require("se2-correlation")(out, a, b)

Computes the cross correlation of two 2D images over the group of rigid motions. The value of the output at a given pixel is determined by,

out(\theta, x, y) = \int \limits_{R^2} a( \cos(\theta) u, \sin(\theta) v) b(u, v) d u \: dv

In the discretized version, the rotations are sampled uniformly. The input bitmaps are centered and rotations are performed about the center point in each case. The output correlation is also centered

  • out is a 3D array with shape [n, p, q]
  • a is a 2D ndarray
  • b is also a 2D ndarray

Returns out

Credit

(c) 2013 Mikola Lysenko. MIT License

Keywords

se2

FAQs

Package last updated on 30 Nov 2013

Did you know?

Socket

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