Uses 108K of libraries. Click here for Pure Java version (16423L/116K).
1 | !7 |
2 | |
3 | module HorizontalAutoSplit > DynImageSurface { |
4 | float threshold = 0.99f; |
5 | transient ReliableSingleThread rst = dm_rst(this, r segmentIt); |
6 | |
7 | visualize { |
8 | JSlider slider = jLiveValueSlider(dm_fieldLiveValue('threshold)); |
9 | main.onChange(slider, rst); |
10 | ret withCenteredLineBelow(super.visualize(), |
11 | withLabel("Threshold:", slider)); |
12 | } |
13 | |
14 | start { |
15 | ownResource(vmBus_onMessage('newClipboardContents, voidfunc(fO o) { |
16 | if (o cast BufferedImage) { |
17 | temp enter(); |
18 | thread { |
19 | setImage(o); |
20 | rst.trigger(); |
21 | } |
22 | } |
23 | })); |
24 | } |
25 | |
26 | void segmentIt { |
27 | temp enter(); |
28 | if (!hasImage()) ret; |
29 | overlaySelectionsOnImageSurface(imageSurface, |
30 | horizontalAutoSplitThenAutoCrop(BWImage(getImage()), threshold)); |
31 | } |
32 | } |
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: | 315 / 438 |
Version history: | 3 change(s) |
Referenced in: | [show references] |