gabrielarchanjo / marvinj Goto Github PK
View Code? Open in Web Editor NEWJavascript Image Processing Framework based on Marvin Framework
Home Page: https://www.marvinj.org
License: GNU Lesser General Public License v3.0
Javascript Image Processing Framework based on Marvin Framework
Home Page: https://www.marvinj.org
License: GNU Lesser General Public License v3.0
I have a picture with a logo. And I want to get logo from picture. What shuold I do
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
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.
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
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!
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;
...
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.