processing

How to create more than one window of a single sketch in Processing?

柔情痞子 提交于 2019-11-29 16:23:58
I want to create two windows by using just one single sketch in Processing. What I'm trying to do is that if I click a button in one window, then some image appear in another window. I've searched Google and found some examples. Actually, I found the same question in this 'stack overflow web'. Here are the links. Create more than one window of a single sketch in Processing http://forum.processing.org/one/topic/multiple-windows-2-4-2011.html Here is the codes of second links. import java.awt.Frame; PFrame f; secondApplet s; //f = new PFrame(); void setup() { size(320, 240); f = new PFrame(); }

RGB to Philips Hue (HSB)

一世执手 提交于 2019-11-29 12:30:59
问题 I'm making a musicplayer in Processing for an assignment for school. The Philips Hue lights will make some corresponding visual effects. I wanted to make the visuals kinda unique for each song. So I fetched the cover art (using LastFM API) of the playing track to get the most frequent color and use this as a base for creating the other colors. The Philips Hue has a different way of showing colors namely (HSB). So I converted it via Color.RGBtoHSB(); For ex. it gives me for R= 127, G=190, B

OpenCV pyrMeanShiftFilter in Processing--problems with matrix

会有一股神秘感。 提交于 2019-11-29 12:23:02
I'm trying to use the Mean Shift Function from OpenCV inside a program called Processing, which is a language based on Java. So far, I know that the function requires two mat and two double, [ pyrMeanShiftFiltering( Mat, Mat, Double, Double) ] and the mat needs to be 8 bits and 3 channels. But, when I run it, it only seems to work for the upper 3/4 th of the image and cuts out the rest. Does anyone know how to get this function to run on the whole image? sample image: cat.jpg import gab.opencv.*; import java.nio.*; import org.opencv.imgproc.Imgproc; import org.opencv.core.Mat; import org

vboxdrv.sh failed modprobe vboxdrv failed. Please use 'dmesg' to find out why

我们两清 提交于 2019-11-29 11:45:50
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use ‘dmesg’ to find out why. There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. Processing triggers for systemd (229-4ubuntu21.2) … Processing triggers for ureadahead (0.100.0-19) … Processing triggers for shared-mime-info (1.5-2ubuntu0.1) … Processing triggers for mime-support (3.59ubuntu1) … ubuntu@VM-0-7-ubuntu:~/jerry$ vboxdrv.sh: failed: modprobe vboxdrv failed. Please use ‘dmesg’ to find out why. vboxdrv: version magic '4.4.0-130-generic SMP mod_unload modversions ’ should be '4.4.0

Javascript \\x escaping

纵饮孤独 提交于 2019-11-29 10:56:48
I've seen a few other programs that have something like this: var string = '\x32\x20\x60\x78\x6e\x7a\x9c\x89'; And I had to try to fiddle with the numbers and letters, to find the text I wanted to display. I'm wondering if there is a function to find the \x escape of a string, like string.toUpperCase() in JS. I'm using processing JS, but it will be okay for me to use other programming languages to find the ASCII for \x . arcyqwerty If you have a string that you want escaped, you can use String.prototype.charCodeAt() If you have the code with escapes, you can just evaluate them to get the

Exporting a Processing sketch with audio to JavaScript

狂风中的少年 提交于 2019-11-29 08:56:57
How could I implement sound in my Processing sketch that works when I export the sketch to JavaScript? I've written a sketch in Processing that includes two audio (.wav) loops. These loops are played through the Movie class upon mousePressed() and mouseDragged() . The sketch works in normal/Java mode, but does not load when changed to JavaScript mode. The sketch only works in JavaScript mode when I remove the sound. I've noticed that other sketches that use the Movie class as well as sketch examples of libraries such as Minim fail to load when I export them to JavaScript, so I think it's a

How to export an Eclipse Project with External Jar dependencies?

拈花ヽ惹草 提交于 2019-11-29 06:32:27
In Processing, I'd like to import a library I've written in Java which wraps around an external library (a .jar file). Processing appears to import my own library, but when I call the constructor (which references some classes in the external library), I get a java.lang.NoClassDefFoundError in the Processing GUI console. If instead of including the External .jar in my Eclipse buildpath, I use the library's actual source code and export all of that, Processing does not complain. How might I be able to package up this project so that I don't have to include all of the library's source code (and

What is it that stops processings libraries from being used to processing.js

旧城冷巷雨未停 提交于 2019-11-29 05:16:01
For those that don't know, processing is a language/ Java library primarily used for displaying data nice and pretty. Processing.js is its javascript port made by John Resiq. Everything that guy makes is a treasure. As per a previous question I learned that Processing's many libraries would not work in processing.js. Why is this? Processing provides a makeshift compiler that turns the processing code into its javascript equivalent. For context to this question, I'm building a game for a final year project and am looking into using processing.js as the base. Whats holding the processing.js back

Image Processing for Embedded Devices <8>

不问归期 提交于 2019-11-29 01:44:55
2.4 像元尺寸减小 2.20 CMOS图像传感器的发展:ITRS曲线:CMOS尺寸效应蓝图。工艺节点曲线:构造CMOS图像传感器的工艺尺寸。像素尺寸曲线:CMOS图像传感器的像素间距 40年前,Intel联合创始人,Gordon Moore,预测处理器的处理速度没18个月会翻一番。虽然这一说法在计算机科学家间广泛争论,但已经被证明是正确的,因此被命名为“Moore’s Law”。随着技术的发展,成本显著下降。对于数码相机,数数每美元有多少像素可作为价值的基本衡量,每美元可以买到的像素个数在新出品相机上持续稳定增长,这和摩尔定律保持一致。1998年澳大利亚PMA DIMA大会上Barry Hendy第一次提出相机价格的预测,称作“Hendy’s Law”。图2.20为IEDM和ISSCC公布的CMOS 图像传感器发展数据概述。最下面那条曲线说明这几年的CMOS尺寸效应,通过ITRS蓝图表示。第二条曲线构造所述CMOS图像传感器的工艺节点,第三掉曲线展示同一器件的像素尺寸。详述如下: l CMOS图像传感器的工业节点落后与ITRS的工业节点,理由非常简单:先进的CMOS工序,用于构造数字电路,往往对图像处理不友好(严重泄电问题,低光照灵敏度,噪声性能,等); l CMOS图像传感器技术程度基本和标准数字CMOS工序保持同步; l 像素尺寸随着所用工艺节点升级。

How to read serial port data from JavaScript

╄→尐↘猪︶ㄣ 提交于 2019-11-28 21:27:02
问题 I connected an Arduino to my laptop using USB, and I can read the serial data using Processing. Is there any way to get this data in real time into a local webbrowser? For example, a text field that shows the value from the serial port? It does not have to be connected to the internet. The JavaScript version of Processing does not support the following code, which would have been the ideal solution. The Processing code is: myPort = new Serial(this, Serial.list()[0], 9600); // read a byte from