eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.43k stars 1.44k forks source link

Sobel returns a Float32Array #216

Open hydrococcous opened 7 years ago

hydrococcous commented 7 years ago

i try to find edges in a image.

`

        var doFindFeatures = function() {

               tracking.Fast.THRESHOLD = window.fastThreshold;
               context.drawImage(source, 0, 0, width, height);

               var imageData = context.getImageData(0, 0, width, height);
               var gray = tracking.Image.grayscale(imageData.data, width, height, true);
               var sobel = tracking.Image.sobel(gray, width, height);

               var grayImgData = graycontext.getImageData(0,0,width,height);
               grayImgData.data.set(new Uint8ClampedArray(gray));
               graycontext.putImageData(grayImgData,0,0);

               console.log('imageData: ', imageData);
               console.log('imageData.data: ', imageData.data);
               console.log('GrayScala: ', gray);
               console.log('sobel: ', sobel);

    };

` The soble-Functions returns an Float32Array. What i must do with that to generate a image shows the edges?

murat-aka commented 6 years ago

@sandrobirke

Look at

259