Warning: session_start(): open(/var/lib/php/sessions/sess_3evhgqc826p5u3g0194g05qbmd, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cm LetterboxOnScreen2 > DynPrintLogAndEnabled {
switchable double frequency = 5.0; // 5 fps
transient S shootingTime, conversionTime, recognitionTime;
transient Map alwaysOnTopWindows = syncMap();
void cleanMeUp_windows {
disposeWindows(getValuesAndClear(alwaysOnTopWindows));
}
JComponent wrapControlArea() {
ret northAndCenterWithMargin(
hgridWithSpacing(
dm_fieldLabelWithLabel shootingTime(),
dm_fieldLabelWithLabel conversionTime(),
dm_fieldLabelWithLabel recognitionTime()),
super.wrapControlArea());
}
start {
dm_reloadOnFieldChange interval();
dm_doEvery(doubleRatio(1, frequency), r doIt);
}
void doIt {
if (!enabled) ret;
var rect = screenBounds(1);
if (rect == null) ret;
new TimeTaker tt;
tt.start();
var img = shootScreen2(rect);
setField(shootingTime := tt.renderMicroseconds());
tt.start();
var ii = IntegralImage(img);
setField(conversionTime := tt.renderMicroseconds());
tt.start();
new Var theBox;
stepAllWithStats(new ULetterbox1().run(img, setVarWithConversion toRect(theBox)));
setField(recognitionTime := tt.renderMicroseconds());
print(imageBounds(img) + " - " + theBox!);
//showImageWithSelection(img, theBox!);
var box1 = rect(rect.x, rect.y, rect.w, theBox->y);
var box2 = rectFromPoints(rect.x, rect.y+theBox->y2(), rect.x2(), rect.y2());
printVars(+box1, +box2);
positionMarkerWindow(0, box1, withAlpha(.2, Color.green));
positionMarkerWindow(1, box2, withAlpha(.2, Color.green));
}
JWindow getOrCreateMarkerWindow(O key) {
ret swing(() ->
syncMapGetOrCreate(alwaysOnTopWindows, key,
() -> makeAlwaysOnTopTranslucentWindow()));
}
void positionMarkerWindow(int iWindow, Rect box, Color color) {
awt {
JWindow w = getOrCreateMarkerWindow(iWindow);
setBounds(w, box);
w.setBackground(color);
w.setVisible(true);
}
}
}