I would recommend using G4P , a graphics library for processing, which has some functionality built-in to handle multiple windows. I used this before with a webcam and it worked well. It comes with a GWindow object that will easily open a window. The basics website has a short tutorial .
I have included some old code that I have that will show you the main idea. What happens in the code is that I make two GWindows and send them each displayed PImage: one receives a webcam image and the other receives an image. The way you do this is to increment the GWinData object to also include the data that you would like to pass to the windows. Instead of creating one specific object for each window, I just created one object with two PImages. Each GWindow gets its own drawing cycle (at the bottom of the example), where it loads a PImage from an overridden GWinData object and displays it. In the basic drawing scheme, I read the webcam and then processed it to create two images and then save them to a GWinData object.
Hope this gives you enough to get started.
import guicomponents.*; import processing.video.*; private GWindow window; private GWindow window2; Capture video; PImage sorted; PImage imgdif; // image with pixel thresholding MyWinData data; void setup(){ size(640, 480,P2D); // Change size to 320 x 240 if too slow at 640 x 480 // Uses the default video input, see the reference if this causes an error video = new Capture(this, 640, 480, 24); numPixels = video.width * video.height; data = new MyWinData(); window = new GWindow(this, "TEST", 0,0, 640,480, true, P2D); window.isAlwaysOnTop(); window.addData(data); window.addDrawHandler(this, "Window1draw"); window2 = new GWindow(this, "TEST", 640,0 , 640,480, true, P2D); window2.isAlwaysOnTop(); window2.addData(data); window2.addDrawHandler(this, "Window2draw"); loadColors("64rev.csv"); colorlength = mycolors.length; distances = new float[colorlength]; noCursor(); } void draw() { if (video.available()) { background(0); video.read(); image(video,0,0); loadPixels(); imgdif = get(); // clones the last image drawn to the screen v1.1 sorted = get(); /// Removed a lot of code here that did the processing // hand data to our data class to pass to other windows data.sortedimage = sorted; data.difimage = imgdif; } } class MyWinData extends GWinData { public PImage sortedimage; public PImage difimage; MyWinData(){ sortedimage = createImage(640,480,RGB); difimage = createImage(640,480,RGB); } } public void Window1draw(GWinApplet a, GWinData d){ MyWinData data = (MyWinData) d; a.image(data.sortedimage, 0,0); } public void Window2draw(GWinApplet a, GWinData d){ MyWinData data = (MyWinData) d; a.image(data.difimage,0,0); }