Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #1019563 // Live Eyebrow Finder [Dyn Module, OK with the right lighting & trained recognizers]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 108K of libraries. Click here for Pure Java version (17069L/122K).

!7

module LiveEyebrowFinder > DynImageSurface {
  transient BufferedImage lastImage;
  EyebrowFinder1 finder;
  transient ReliableSingleThread rstUpdateImage = dm_rst(this, r updateImage);
  transient S eyebrowState;

  start {
    if (finder == null)
      finder = defaultEyebrowFinder();
    doEvery(100, rstUpdateImage);
  }
  
  visualize {
    JComponent c = super.visualize();
    imageSurface_pixelated(imageSurface);
    ret centerAndSouth(c, withMargin(setFontSize(30, makeBold(jCenteredLiveValueLabel(dm_fieldLiveValue('eyebrowState))))));
  }
  
  void updateImage enter {
    if (imageSurface == null) ret;
    final BufferedImage img = dm_webCamImage();
    temp tempAfterwards(r { lastImage = img });
    if (img == null || img == lastImage) ret;
    RectAndState found = finder.get(RGBImage(img));
    if (setField(eyebrowState := found == null ? null : found.state))
      vmBus_send('eyebrows, eyebrowState);
    setModuleName("Live Eyebrow Finder" + (found == null ? "" : " - " + found.state));
    setSelection(rectAndStateToRect(found));
    setImage(img);
  }
}

Author comment

Began life as a copy of #1019539

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019563
Snippet name: Live Eyebrow Finder [Dyn Module, OK with the right lighting & trained recognizers]
Eternal ID of this version: #1019563/7
Text MD5: 875cab6866364498fa073700f4aa4bc8
Transpilation MD5: 6bf08949d58b602c381a7dd736c0f8e6
Author: stefan
Category: javax / stefan's os / web cam
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-14 17:29:47
Source code size: 1116 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 348 / 612
Version history: 6 change(s)
Referenced in: [show references]