Giter VIP home page Giter VIP logo

Comments (2)

inspirit avatar inspirit commented on August 16, 2024

input should be single channel grayscale U8_t or S32_t or F32_t
output will be 2 channels S32_t if input U8 or S32 and F32

first channel is dx second is dy

to render it correctly the best way will be:

sobel_derivatives(src, dst);
var w = src.cols, h = src.rows;
var dstep = w<<1, dptr=0, sptr=0;
for(y=0; y < h; y++, dptr += dstep, sptr += w) {
    for(x=0; x < w; x++) {
        var dx = dst.data[x*2+dptr];
        var dy = dst.data[x*2+dptr+1];
        var gx = Math.sqrt(dx*dx + dy*dy);
        src.data[x+sptr] = gx&0xff;
    }
}

from jsfeat.

marklundin avatar marklundin commented on August 16, 2024

Awesome. That's perfect, thanks.

from jsfeat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.