Calculating Live-Values for Brightness and Intensity While Using the WebcamCapture Plugin

Hello everyone, I am planning to use ImageJ in an experiment on explosible dusts to detect whether there is an explosion inside a special experimental setup or not. Right now, students get to decide, if there was an explosion and this leads to variegating results.
The Plan is to install a webcam, which monitors the inside of the oven (using the WebcamCapture Plugin) and to decide via Image Analysis if an explosion occurred.
Is it possible to calculate the values for e.g. brightness or contrast change similar to the live-histogram?
Thanks, Fabian

@Fnab

Regarding the WebcamCapture plugin - the person to address those questions in particular is @jerome.mutterer.

Hi @Fnab & @etadobson.

Interesting question. Yes you can do that. I made a small macro that demonstrate how. First launch Webcamcapture IJ webcam plugin to get the live image view, then run this macro.

id = getImageID;
values = newArray(512);
index = Array.getSequence(512);
makeRectangle(10, 10, 100, 100);
while (true) {
  selectImage(id);
  values = Array.deleteIndex(values, 0); 
  values = Array.concat(values,getValue("Mean"));
  Plot.create("Live plot", "time", "value", index, values);
  Plot.setLimits(0, 512, 0, 255);
  Plot.update();
}

You can get an idea of what it does in the following video. Here I create a live plot of the average value inside the ROI, but you could just detect values above a certain threshold, and decide if the expected event occurred. Be extra careful with the explosions though :wink:

.

3 Likes