cmisenas / canny-edge-detection Goto Github PK
View Code? Open in Web Editor NEWCanny Edge Detection implementation in Canvas
Home Page: http://canny-edge-detection.herokuapp.com/
Canny Edge Detection implementation in Canvas
Home Page: http://canny-edge-detection.herokuapp.com/
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 :)
Will you be releasing this under any particular license?
if this isn't something you're interested in having in your library, do you know of a JS library that does this?
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' }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.