Probably this question is applicable to all dynamic processes. However I'm fighting DBE right now.
I'd like to detect some areas of an image comprised only of sky background; no nebulae, no stars, no anything. I thought that I could take advantage of the fact that DBE, when automatically generating samples, has some intelligence in place to avoid placing them over the photographed object. So I'd like to create a DBE instance and have it generate some samples after tweaking its parameters to make it reject almost everything except true background areas, then traverse them using the DBE.samples array.
Creating a DBE process icon (with some samples) and dragging it to a ProcessContainer in order to see the auto-generated javascript code doesn't help much, since the samples appear hardcoded in that snippet.
So, how to generate DBE samples from a script?
var dbe = new DynamicBackgroundExtraction;
dbe.modelId = "Image01";
dbe.samplesPerRow = 5;
dbe.... something!
for (s in dbe.samples) {
// do something with s
}