From 4844c7dae30eef6ee8e21455f9870794091e3dea Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 28 Jan 2019 20:15:27 -0800 Subject: [PATCH] figured out the spacing problem --- src/App.vue | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/App.vue b/src/App.vue index e67dddb..8ed69fd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,7 +19,18 @@
- +
@@ -151,6 +162,14 @@
{{ settings.amplitude }}
+ +
+ + Sampling + + +
{{ settings.spacing }}
+
@@ -160,7 +179,6 @@ Download:
- @@ -168,8 +186,8 @@
-
- +
+
@@ -234,6 +252,9 @@ 'settings.frequency': function(){ this.processImage(); }, + 'settings.spacing': function(){ + this.processImage(); + }, 'settings.lineCount': function(){ this.processImage(); }, @@ -280,8 +301,6 @@ let canvas = document.createElement("canvas"); canvas.width = this.settings.width; canvas.height = this.settings.height; - // const ctx = canvas.getContext("2d"); - // this.canvasData = ctx.getImageData(0, 0, 500, 500); const ctx = canvas.getContext('2d'); let img = new Image(); @@ -336,7 +355,7 @@ //console.log(config.spacing, width); for (let x = spacing; x < width; x += spacing ) { - currentHorizontalPixelIndex = x + currentVerticalPixelIndex; // Get array position of current pixel + currentHorizontalPixelIndex = Math.floor(x + currentVerticalPixelIndex); // Get array position of current pixel // When there is contrast adjustment, the calculations of brightness values are a bit different if (contrast !== 0) { @@ -383,11 +402,9 @@ }, onStarted(stream) { this.webcam.streaming = true; - //console.log("On Started Event", stream); }, onStopped(stream) { this.webcam.streaming = false; - //console.log("On Stopped Event", stream); }, onStop() { this.$refs.webcam.stop();