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

32
LINES

< > BotCompany Repo | #1018881 // Horizontal Auto Split [Dyn Module]

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

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

!7

module HorizontalAutoSplit > DynImageSurface {
  float threshold = 0.99f;
  transient ReliableSingleThread rst = dm_rst(this, r segmentIt);
  
  visualize {
    JSlider slider = jLiveValueSlider(dm_fieldLiveValue('threshold));
    main.onChange(slider, rst);
    ret withCenteredLineBelow(super.visualize(),
      withLabel("Threshold:", slider));
  }
  
  start {
    ownResource(vmBus_onMessage('newClipboardContents, voidfunc(fO o) {
      if (o cast BufferedImage) {
        temp enter();
        thread {
          setImage(o);
          rst.trigger();
        }
      }
    }));
  }
  
  void segmentIt {
    temp enter();
    if (!hasImage()) ret;
    overlaySelectionsOnImageSurface(imageSurface,
      horizontalAutoSplitThenAutoCrop(BWImage(getImage()), threshold));
  }
}

Author comment

Began life as a copy of #1018876

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018881
Snippet name: Horizontal Auto Split [Dyn Module]
Eternal ID of this version: #1018881/4
Text MD5: 0b761f059a5a4b70d00c560f65749f84
Transpilation MD5: 6a8839f307291c38c3207f2d07d33c19
Author: stefan
Category: javax / image analysis
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-14 23:57:25
Source code size: 817 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 249 / 351
Version history: 3 change(s)
Referenced in: [show references]