Warning: session_start(): open(/var/lib/php/sessions/sess_c7ar06j48ntpn9qos9pcqkqm9l, 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
// uses only one prototype image
// goes through different granularities at once
cmodule ImageRecogSpike {
S prototypeImageID = #1102884;
S inputImageID = #1102883;
// how big do we think the prototype is in the whole image
// (percentage by height)
transient double assumedPrototypeHeightPercentage = 50;
transient L widths = ll(32, 64, 128);
transient new L integralImages;
transient BWIntegralImage baseImage;
transient JTabbedPane tabs = jTabbedPane();
transient BWImage prototypeImage;
transient new L levels; // recognizers for each granularity
class OneLevel extends SteppableAndBest {
IBWIntegralImage ii;
BWImage prototype; // scaled prototype
*(IBWIntegralImage *ii) {
// get assumed height of prototype in scaled-down image
int ph = iround(ii.getHeight()*assumedPrototypeHeightPercentage/100.0);
// resize prototype
prototype = bwResizeToHeightSmooth(prototypeImage, ph);
addTab(tabs, "proto " + ii.getWidth(),
jFullCenterScroll(jPixelatedZoomedImageSurface(4.0, prototype)));
}
public bool step() {
false; // done
}
}
start-thread {
if (baseImage == null)
baseImage = BWIntegralImage(loadImage2(inputImageID));
if (prototypeImage == null)
prototypeImage = loadBWImage(prototypeImageID);
for (int w : widths) {
IBWIntegralImage ii = scaledIBWIntegralImage(baseImage, w);
integralImages.add(ii);
addTab(tabs, "w=" + w, jFullCenterScroll(jPixelatedZoomedImageSurface(
doubleRatio(baseImage.getWidth(), w), iBWIntegralImageToBWImage(ii))));
levels.add(new OneLevel(ii));
}
addTab(tabs, "Prototype", jFullCenterScroll(jPixelatedZoomedImageSurface(4, prototypeImage)));
}
visual tabs;
}