From 358ca04f4434e1a9239b028ea2b43489a68147e4 Mon Sep 17 00:00:00 2001 From: cascade256 Date: Mon, 14 Dec 2015 17:41:47 -0800 Subject: [PATCH] Add a couple new methods, trying some different formatting. --- Matrix.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Matrix.md b/Matrix.md index 367e744..1abc5bb 100644 --- a/Matrix.md +++ b/Matrix.md @@ -49,6 +49,34 @@ Example: var zeroes = new Matrix.Zeroes(512, 512); var ones = new Matrix.Ones(512, 512); +##Image Operations + +###absDiff(image1, image2) + +Sets this matrix to a image with the absolute difference between image1 and image2. + +**image1: Matrix** + +**image2: Matrix** + +**output: none** + +###adaptiveThreshold(maxVal, adaptiveMethod, thresholdType, blockSize, C) + +Returns the thresholded image. This matrix needs to be a single channel image. + +**maxVal: number:** This is the value that pixels are set to if the conditions are satisfied. 255 for white should be fine for most cases. + +**adaptiveMethod: number:** This is how to set which method to use, 0 for ADAPTIVE_THRESH_MEAN_C, and 1 for ADAPTIVE_THRESH_GAUSSIAN_C. + +**thresholdType: number:** This is the type of threshold to do, 0 for THRESH_BINARY and 1 for THRESH_BINARY_INV. + +**blockSize: number:** This is the area around the pixel for comparing against. + +**C: number:** This is subtracted from the mean of every pixel. + +**output: Matrix** + ##Accessing Data For color images, be careful with get, row, and col. They return a number that represents the pixel by bit-shifting all the channels together.