Compare commits

..

5 Commits

Author SHA1 Message Date
Jeffrey Warren
38915d021c combine grunt browserify of tests and the run of those tests 2020-07-06 23:52:17 -04:00
Jeffrey Warren
845a4db44f Merge branch 'main' into test-jobs 2020-07-06 11:51:34 -04:00
Jeffrey Warren
dba69eb908 more descriptive labels 2020-07-06 09:29:36 -04:00
Jeffrey Warren
7210b03dad format test browserification 2020-07-06 09:25:56 -04:00
Jeffrey Warren
798956c7ce Split tests into separate Travis jobs with better labeling 2020-07-06 09:24:56 -04:00
18 changed files with 19 additions and 105 deletions

View File

@@ -1,2 +1 @@
dist/*
examples/orb.core.min.js
dist/*

View File

@@ -1,7 +0,0 @@
FROM gitpod/workspace-full
USER root
RUN sudo apt-get update && apt-get install -y apt-transport-https \
&& sudo apt-get install -y \
xserver-xorg-dev libxext-dev libxi-dev build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config libglu1-mesa-dev freeglut3-dev mesa-common-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*

View File

@@ -1,5 +1,3 @@
image:
file: .gitpod.dockerfile
tasks:
- init: npm run setup
command: npm start

View File

@@ -2,7 +2,6 @@ Image Sequencer
====
[![Code of Conduct](https://img.shields.io/badge/code-of%20conduct-green.svg)](https://publiclab.org/conduct)
[![npm version](https://badge.fury.io/js/image-sequencer.svg)](https://badge.fury.io/js/image-sequencer)
[![Build Status](https://travis-ci.org/publiclab/image-sequencer.svg?branch=master)](https://travis-ci.org/publiclab/image-sequencer) [![Maintainability](https://api.codeclimate.com/v1/badges/5906996dd2e90aca6398/maintainability)](https://codeclimate.com/github/publiclab/image-sequencer/maintainability) [![Codecov](https://img.shields.io/codecov/c/github/publiclab/image-sequencer.svg?logo=codecov)](https://codecov.io/gh/publiclab/image-sequencer)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
@@ -620,4 +619,4 @@ Modules that do not work:
5. Text Overlay (Almost fixed)
6. Blend
7. Histogram
8. WebGL Distort
8. WebGL Distort

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

View File

@@ -28,10 +28,6 @@
<script src="../dist/image-sequencer.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>
<!-- for matcher module -->
<script src="orb.core.min.js"></script>
<!-- for crop module: -->
<script src="../node_modules/imgareaselect/jquery.imgareaselect.dev.js"></script>
<script src="../node_modules/gifshot/dist/gifshot.min.js" type="text/javascript"></script>

File diff suppressed because one or more lines are too long

6
package-lock.json generated
View File

@@ -17068,9 +17068,9 @@
}
},
"websocket-extensions": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
"integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
"dev": true
},
"whatwg-encoding": {

View File

@@ -31,7 +31,6 @@ module.exports = {
'gradient': require('./modules/Gradient'),
'grid-overlay': require('./modules/GridOverlay'),
'import-image': require('./modules/ImportImage'),
'matcher': require('./modules/Matcher'),
'minify-image': require('./modules/MinifyImage'),
// 'invert': require('image-sequencer-invert'),
'invert': require('./modules/Invert'),

View File

@@ -13,9 +13,11 @@ const kernelx = [
[ 0, 0, 0],
[ 1, 2, 1]
];
let pixelsToBeSupressed = [];
module.exports = function(pixels, highThresholdRatio, lowThresholdRatio, useHysteresis) {
let angles = [], grads = [], strongEdgePixels = [], weakEdgePixels = [], pixelsToBeSupressed = [];
let angles = [], grads = [], strongEdgePixels = [], weakEdgePixels = [];
for (var x = 0; x < pixels.shape[0]; x++) {
grads.push([]);
@@ -32,8 +34,8 @@ module.exports = function(pixels, highThresholdRatio, lowThresholdRatio, useHyst
angles.slice(-1)[0].push(result.angle);
}
}
nonMaxSupress(pixels, grads, angles, pixelsToBeSupressed); // Non Maximum Suppression: Filter fine edges.
doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, grads, strongEdgePixels, weakEdgePixels, pixelsToBeSupressed); // Double Threshold: Categorizes edges into strong and weak edges based on two thresholds.
nonMaxSupress(pixels, grads, angles); // Non Maximum Suppression: Filter fine edges.
doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, grads, strongEdgePixels, weakEdgePixels); // Double Threshold: Categorizes edges into strong and weak edges based on two thresholds.
if(useHysteresis.toLowerCase() == 'true') hysteresis(strongEdgePixels, weakEdgePixels); // Optional Hysteresis (very slow) to minimize edges generated due to noise.
strongEdgePixels.forEach(pixel => preserve(pixels, pixel)); // Makes the strong edges White.
@@ -142,7 +144,7 @@ const removeElem = (arr = [], elem) => { // Removes the specified element from t
};
// Non Maximum Supression without interpolation.
function nonMaxSupress(pixels, grads, angles, pixelsToBeSupressed) {
function nonMaxSupress(pixels, grads, angles) {
angles = angles.map((arr) => arr.map(convertToDegrees));
for (let x = 0; x < pixels.shape[0]; x++) {
@@ -194,7 +196,7 @@ var convertToDegrees = radians => (radians * 180) / Math.PI;
var findMaxInMatrix = arr => Math.max(...arr.map(el => el.map(val => val ? val : 0)).map(el => Math.max(...el)));
// Applies the double threshold to the image.
function doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, grads, strongEdgePixels, weakEdgePixels, pixelsToBeSupressed) {
function doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, grads, strongEdgePixels, weakEdgePixels) {
const highThreshold = findMaxInMatrix(grads) * highThresholdRatio, // High Threshold relative to the strongest edge
lowThreshold = highThreshold * lowThresholdRatio; // Low threshold relative to high threshold

View File

@@ -16,6 +16,7 @@ module.exports = function edgeDetect(options, UI) {
// The function which is called on every draw.
function draw(input, callback, progressObj) {
progressObj.stop(true);
progressObj.overrideFlag = true;

View File

@@ -1,54 +0,0 @@
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;

View File

@@ -1,4 +0,0 @@
module.exports = [
require('./Module'),
require('./info.json')
];

View File

@@ -1,15 +0,0 @@
{
"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": ""
}
}
}

View File

@@ -73,3 +73,4 @@ function LoadImage(ref, name, src, main_callback) {
}
module.exports = LoadImage;

File diff suppressed because one or more lines are too long

View File

@@ -10369,9 +10369,9 @@ websocket-driver@>=0.5.1:
websocket-extensions ">=0.1.1"
websocket-extensions@>=0.1.1:
version "0.1.4"
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
version "0.1.3"
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==
whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5:
version "1.0.5"