mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 19:00:00 +01:00
Complete Edge Detect Module (#771)
* update dist Signed-off-by: tech4GT <varun.gupta1798@gmail.com> dist update Revert "dist update" This reverts commit 9ee2a987e8f978961656ae8f71f6e6702bbbd30d. * fix insert step button * add icon * add dist * use normal functions * use normal functions * add new function * add dist * remove console logs * changes * refactor * add dist * Bump looks-same from 5.0.2 to 6.0.0 (#729) Bumps [looks-same](https://github.com/gemini-testing/looks-same) from 5.0.2 to 6.0.0. - [Release notes](https://github.com/gemini-testing/looks-same/releases) - [Changelog](https://github.com/gemini-testing/looks-same/blob/master/CHANGELOG.md) - [Commits](https://github.com/gemini-testing/looks-same/compare/v5.0.2...v6.0.0) Signed-off-by: dependabot[bot] <support@dependabot.com> * Setup UI testing (#720) * default sequencer ui test * default step ui test suite * intermediate step ui test * preview ui test suite * url methods test suite * add set url params method test suite * argument call tests * test directory refactor * travis fix * CLI code refactor (#665) * CLI refactor * es6 rollback * Travis fix * syntax fix * clustered require statements * travis debug * travis debug * Added line that selects the "More modules..." after adding a step. (#713) * Added line making module selection correct after adding a step * Added line with appropriate module selection * Add: Module tests (#748) * WIP * module testing harness * adjustments * Fix choose file option and insert step functionality (#712) * Fix choose file option * changes * Parse info.json to set module defaults (#650) * changes * changes * changes * changes * changes * changes * Update package-lock.json * Bump jsqr from 1.1.1 to 1.2.0 (#749) Bumps [jsqr](https://github.com/cozmo/jsQR) from 1.1.1 to 1.2.0. - [Release notes](https://github.com/cozmo/jsQR/releases) - [Commits](https://github.com/cozmo/jsQR/commits) Signed-off-by: dependabot[bot] <support@dependabot.com> * Bump jsqr from 1.1.1 to 1.2.0 (#749) Bumps [jsqr](https://github.com/cozmo/jsQR) from 1.1.1 to 1.2.0. - [Release notes](https://github.com/cozmo/jsQR/releases) - [Commits](https://github.com/cozmo/jsQR/commits) Signed-off-by: dependabot[bot] <support@dependabot.com> * dist * changes * working * final touches * revert mapTypes * proper revert * Fix arctangent * working hysteresis * hysteresis optional
This commit is contained in:
committed by
Jeffrey Warren
parent
e1a113cde1
commit
c6457323cc
@@ -7,6 +7,7 @@ module.exports = function edgeDetect(options, UI) {
|
||||
options.blur = options.blur || defaults.blur;
|
||||
options.highThresholdRatio = options.highThresholdRatio || defaults.highThresholdRatio;
|
||||
options.lowThresholdRatio = options.lowThresholdRatio || defaults.lowThresholdRatio;
|
||||
options.hystereis = options.hysteresis || defaults.hysteresis;
|
||||
|
||||
var output;
|
||||
|
||||
@@ -19,22 +20,19 @@ module.exports = function edgeDetect(options, UI) {
|
||||
var step = this;
|
||||
|
||||
|
||||
// Extra Manipulation function used as an enveloper for applying gaussian blur and Convolution
|
||||
function extraManipulation(pixels) {
|
||||
pixels = require('ndarray-gaussian-filter')(pixels, options.blur);
|
||||
pixels = require('./EdgeUtils')(pixels, options.highThresholdRatio, options.lowThresholdRatio, options.inBrowser);
|
||||
return pixels;
|
||||
}
|
||||
|
||||
// Extra Manipulation function used as an enveloper for applying gaussian blur and Convolution
|
||||
function changePixel(r, g, b, a) {
|
||||
return [(r + g + b) / 3, (r + g + b) / 3, (r + g + b) / 3, a];
|
||||
}
|
||||
|
||||
function extraManipulation(pixels) {
|
||||
pixels = require('ndarray-gaussian-filter')(pixels, options.blur);
|
||||
pixels = require('./EdgeUtils')(pixels, options.highThresholdRatio, options.lowThresholdRatio, options.hystereis);
|
||||
return pixels;
|
||||
}
|
||||
|
||||
function output(image, datauri, mimetype) {
|
||||
|
||||
// This output is accessible by Image Sequencer
|
||||
step.output = { src: datauri, format: mimetype };
|
||||
|
||||
}
|
||||
|
||||
return require('../_nomodule/PixelManipulation.js')(input, {
|
||||
@@ -46,7 +44,6 @@ module.exports = function edgeDetect(options, UI) {
|
||||
inBrowser: options.inBrowser,
|
||||
callback: callback
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user