GithubHelp home page GithubHelp logo

cmisenas / canny-edge-detection Goto Github PK

View Code? Open in Web Editor NEW
145.0 145.0 33.0 910 KB

Canny Edge Detection implementation in Canvas

Home Page: http://canny-edge-detection.herokuapp.com/

JavaScript 92.84% HTML 7.16%

canny-edge-detection's People

Contributors

cmisenas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canny-edge-detection's Issues

Issue with Pixel in Canvas

Offending lines-

Canny calls _traverseEdge.

  Canny.prototype._traverseEdge = function(current, imgData, threshold, traversed) {
    
    ...

    var neighbors = getEdgeNeighbors(current, imgData, threshold, traversed);

    ...

  };

Which called getEdgeNeighbors in the helpers.

  exports.getEdgeNeighbors = function(i, imgData, threshold, includedEdges) {
    var neighbors = [],
        pixel = new Pixel(i, imgData.width, imgData.height);
    for(var j = 0; j < pixel.neighbors.length; j++)
      if(imgData.data[pixel.neighbors[j]] >= threshold && (includedEdges === undefined || includedEdges.indexOf(pixel.neighbors[j]) === -1))
        neighbors.push(pixel.neighbors[j]);

    return neighbors;
  };

Which constructs a new pixel with the pixel index, and the x/y coords. This is defined in cabbage.min.js (which is minified! why??)

And blows up on e.shift

    function b(a,b,e){var f=this;this.x=a,this.y=b,this.neighbors={},e&&d.forEach(function(a){f[a]=e.shift()}),

b is the Pixel constructor. a is the pixel index, b is the x coord, and e is the y coord.

Foreach item in d ('r', 'g', 'b', 'a') it calls e.shift- which is a number and does not have a shift method.

Could you tell me where the source to this stuff is? Minified code makes it difficult to debug :)

License?

Will you be releasing this under any particular license?

Memory Leak Detected

Found some issue after running this project

(node) warning: possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at WriteStream.addListener (events.js:239:17)
    at IncomingMessage.<anonymous> (D:\tmp\canny-edge-detection-master\canny-edge-detection-master\js\server.js:130:12)
    at emitOne (events.js:77:13)
    at IncomingMessage.emit (events.js:169:7)
    at IncomingMessage.Readable.read (_stream_readable.js:360:10)
    at flow (_stream_readable.js:733:26)
    at resume_ (_stream_readable.js:713:3)
    at doNTCallback2 (node.js:429:9)
    at process._tickCallback (node.js:343:17)
Boundary:  ---------------------------26289275811299
Headers:  { name: '"image-upload"',
  filename: '"Untitled.png"',
  'content-type': 'filename' }

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.