mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-20 07:10:03 +01:00
async bug
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
dist/*
|
dist/*
|
||||||
|
examples/orb.core.min.js
|
||||||
|
|||||||
BIN
examples/images/big.jpg
Normal file
BIN
examples/images/big.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 235 KiB |
BIN
examples/images/small.jpg
Normal file
BIN
examples/images/small.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 220 KiB |
@@ -28,6 +28,10 @@
|
|||||||
<script src="../dist/image-sequencer.js" charset="utf-8"></script>
|
<script src="../dist/image-sequencer.js" charset="utf-8"></script>
|
||||||
<script src="../dist/image-sequencer-ui.js" charset="utf-8"></script>
|
<script src="../dist/image-sequencer-ui.js" charset="utf-8"></script>
|
||||||
<script src="../node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js"></script>
|
<script src="../node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js"></script>
|
||||||
|
|
||||||
|
<!-- for matcher module -->
|
||||||
|
<script src="orb.core.min.js"></script>
|
||||||
|
|
||||||
<!-- for crop module: -->
|
<!-- for crop module: -->
|
||||||
<script src="../node_modules/imgareaselect/jquery.imgareaselect.dev.js"></script>
|
<script src="../node_modules/imgareaselect/jquery.imgareaselect.dev.js"></script>
|
||||||
<script src="../node_modules/gifshot/dist/gifshot.min.js" type="text/javascript"></script>
|
<script src="../node_modules/gifshot/dist/gifshot.min.js" type="text/javascript"></script>
|
||||||
|
|||||||
1
examples/orb.core.min.js
vendored
Normal file
1
examples/orb.core.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -29,6 +29,7 @@ module.exports = {
|
|||||||
'gradient': require('./modules/Gradient'),
|
'gradient': require('./modules/Gradient'),
|
||||||
'grid-overlay': require('./modules/GridOverlay'),
|
'grid-overlay': require('./modules/GridOverlay'),
|
||||||
'import-image': require('./modules/ImportImage'),
|
'import-image': require('./modules/ImportImage'),
|
||||||
|
'matcher': require('./modules/Matcher'),
|
||||||
'minify-image': require('./modules/MinifyImage'),
|
'minify-image': require('./modules/MinifyImage'),
|
||||||
'invert': require('image-sequencer-invert'),
|
'invert': require('image-sequencer-invert'),
|
||||||
'ndvi': require('./modules/Ndvi'),
|
'ndvi': require('./modules/Ndvi'),
|
||||||
|
|||||||
54
src/modules/Matcher/Module.js
Normal file
54
src/modules/Matcher/Module.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
function Match(options, UI) {
|
||||||
|
var output;
|
||||||
|
|
||||||
|
new Matcher(
|
||||||
|
'examples/images/big.jpg',
|
||||||
|
'examples/images/small.jpg',
|
||||||
|
async function(q) {
|
||||||
|
var res = await q;
|
||||||
|
window.r = res;
|
||||||
|
console.log('Matcher loaded.');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
var points = window.r.points;
|
||||||
|
|
||||||
|
function draw(input, callback, progressObj) {
|
||||||
|
progressObj.stop(true);
|
||||||
|
progressObj.overrideFlag = true;
|
||||||
|
|
||||||
|
var step = this;
|
||||||
|
|
||||||
|
function changePixel(r, g, b, a, x, y) {
|
||||||
|
for (var i = 0; i < points.length; i++) {
|
||||||
|
if (Math.abs(points[i].x - x) <= 3 && Math.abs(points[i].y - y) <= 3) {
|
||||||
|
return [0, 255, 0, a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [r, g, b, a];
|
||||||
|
}
|
||||||
|
|
||||||
|
function output(image, datauri, mimetype) {
|
||||||
|
step.output = { src: datauri, format: mimetype };
|
||||||
|
}
|
||||||
|
|
||||||
|
return input.pixelManipulation({
|
||||||
|
output: output,
|
||||||
|
changePixel: changePixel,
|
||||||
|
format: input.format,
|
||||||
|
image: options.image,
|
||||||
|
inBrowser: options.inBrowser,
|
||||||
|
callback: callback,
|
||||||
|
useWasm: options.useWasm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
options: options,
|
||||||
|
draw: draw,
|
||||||
|
output: output,
|
||||||
|
UI: UI
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Match;
|
||||||
4
src/modules/Matcher/index.js
Normal file
4
src/modules/Matcher/index.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = [
|
||||||
|
require('./Module'),
|
||||||
|
require('./info.json')
|
||||||
|
];
|
||||||
15
src/modules/Matcher/info.json
Normal file
15
src/modules/Matcher/info.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "matcher",
|
||||||
|
"description": "Pattern-mining module for detecting key-points in images.",
|
||||||
|
"url": "https://github.com/publiclab/matcher-core.git",
|
||||||
|
"inputs": {
|
||||||
|
"imageX": {
|
||||||
|
"type": "text",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
"imageY": {
|
||||||
|
"type": "text",
|
||||||
|
"default": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -73,4 +73,3 @@ function LoadImage(ref, name, src, main_callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = LoadImage;
|
module.exports = LoadImage;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user