Git Product home page Git Product logo

Comments (3)

jinoantony avatar jinoantony commented on September 27, 2024

just get the image data using canvas

var image = new Image();
image.src = "image.jpg";

var c = document.getElementById("myCanvas");
var ctxx = c.getContext("2d");
c.width = image.width;
 c.height = image.height;
ctxx.drawImage(image, 0, 0, image.width, image.height);
var imgData = ctxx.getImageData(0, 0, c.width, c.height);

var imgg = new jsfeat.matrix_t(image.width, image.height, jsfeat.U8_t | jsfeat.C1_t);
jsfeat.imgproc.grayscale(imgData.data, image.width, image.height, imgg);

//Finally change this line in train_pattern()
jsfeat.imgproc.resample(img_u8, lev0_img, new_width, new_height);
//to this
jsfeat.imgproc.resample(imgg, lev0_img, new_width, new_height);

from jsfeat.

jinoantony avatar jinoantony commented on September 27, 2024

@rohitkshirsagar here is the html file

https://drive.google.com/file/d/19uFc0k3vkntF8YjXjRJwvXeHfJvEy07M/view?usp=sharing

from jsfeat.

rohitkshirsagar avatar rohitkshirsagar commented on September 27, 2024

@jinoantony Thank yo so much for your help !!

from jsfeat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.