Code Monkey home page Code Monkey logo

marvinj's People

Contributors

gabrielarchanjo avatar jayquest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marvinj's Issues

Using on nodejs

Hi! Is it possible to use this tool in a nodejs environment? I want to batch process images with the text recognition functions but I wasn't able to make it work. Thanks a lot

Installation with Angular CLI Project

I would like to use MarvinJ in my Angular application.
But the installation documentation from http://marvinj.org/en/tutorials/getting_started_ionic.html doesnt work, or is not 100% understandable.

  1. I downloaded the marvinj-1.0.js raw file as .js file and put it into my app directory "my-app/marvin.js"
  2. Then I ran the command "npm install marvin --save"
  3. Then I imported MarvinImage in the service which should use the library import
    '..services/my-service.service.ts'
import { MarvinImage } from "marvin.js";
import { Marvin } from "marvin.js";
....
myFunction(canvas, previewImg){
    var image = new MarvinImage();
    image.load("https://i.imgur.com/4O8VFQY.jpg", function(){
      var imageOut = new MarvinImage(image.getWidth(), image.getHeight());
      Marvin.blackAndWhite(image, imageOut, 10);
      imageOut.draw(canvas);
      previewImg.src = canvas.toDataURL();
      previewImg.onload = () => {
        console.log('IMage FIlter applied')
      }
    });
  }

In the Chrome Developer Console the following statement gets printed:
core.js:4352 ERROR TypeError: marvin_js__WEBPACK_IMPORTED_MODULE_1__.MarvinImage is not a constructor

Could you please explain what I did wrong or how to install and use MarvinJ in an Angular CLI project?

Thank you

Is it possible to detect outer background of an image using MARVINJ?

Hi! I'm wondering if it is possible to detect outer background of an image using MARVINJ and then make it transparent?
Please take a look on screenshot https://i.imgur.com/qmZ21Ug.png (desired area is marked by border line).

Example posted in Tutorial section on your website (https://www.marvinj.org/en/releases/marvinj_1.0.html) is good, but it works fine only with white background. In my case, images will be uploaded by users, so background can be any color.

I would appreciate any suggestion. Thanks in advance!

FloodFillSegmentation doesn't work on marvinj-1.0.js due to MarvinSegment x1, y1, x2, y2 not initialized -1

I noticed MarvinSegment on marvinj-1.0 has the following code:

function MarvinSegment(x1, y1, x2, y2) {
  this.x1 = x1;
  this.x2 = x2;
  this.y1 = y1;
  this.y2 = y2;
...

This causes floodFillSegmentation function to not work as it relies on the segment's x1, x2, y1, and y2 initialized to -1

if (seg == null) {
  seg = new MarvinSegment();
  segments[color - 1] = seg;
}

// x and width
if (seg.x1 == -1 || x < seg.x1) {
  seg.x1 = x;
}
if (seg.x2 == -1 || x > seg.x2) {
  seg.x2 = x;
}
seg.width = seg.x2 - seg.x1 + 1;

Notice here seg.x1, seg.x2 is never set as the condition fails (seg.x1 is undefined at start).

You can try the Robocup segmentation demo and change the marvinj version from marvinj-0.9 to marvinj-1.0 and the demo will not work.
https://jsfiddle.net/leirbag_arc/sk7dehz5/

To fix this, the MarvinSegment needs to be initialized with -1 if x1, y1, x2, y2 parameters are not passed.

function MarvinSegment(x1, y1, x2, y2) {
  this.x1 = x1 || -1;
  this.x2 = x2 || -1;
  this.y1 = y1 || -1;
  this.y2 = y2 || -1;
...

Gaussian Blur implementation is very slow

On a simple 1080x800px image, with kernel of size 10, it takes well over 15s. Not sure if there's more efficient ways to implement it, is it the same method used as the Java version?

I wonder if it's possible to use the browser's CSS filter for guassian blur, then transfer that back to a canvas.

TypeScript modules

Please update the package for typescript support of importing MarvinImage and Marvin modules as documented here:

(http://marvinj.org/en/tutorials/getting_started_ionic.html

import { MarvinImage } from "marvinj";
import { Marvin, MarvinImage } from 'marvinj';

The example Ionic project at http://www.marvinj.org/files/marvin-ionic.zip has the needed typescript support in its marvin directory but the actual marvinj repo does not. This is a problem for cloud build services like Ionic AppFlow (previously "Pro").

PR with v1.0.1 fix: #6

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.