1 | crop = otherresults["#324"] |
2 | if crop == nil then error("need output of #324, please recalc") end
|
3 | |
4 | local _, _, x1, y1, x2, y2 = string.find(crop, "(%d+),%s*(%d+),%s*(%d+),%s*(%d+)") |
5 | if x1 == nil then error("output of #324 malformed") end
|
6 | print("x1", x1, "y1", y1, "x2", x2, "y2", y2)
|
7 | |
8 | -- crop the image |
9 | |
10 | local orig = img |
11 | img = {
|
12 | width = x2-x1, |
13 | height = y2-y1, |
14 | getInt = function(x, y) |
15 | return orig.getInt(x+x1, y+y1) |
16 | end |
17 | } |
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
| ID | Author/Program | Comment | Date | |
|---|---|---|---|---|
| 393 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { crop = otherresults["#324"] if crop == nil then error("need output of #324, please recalc") end local _, _, x1, y1, x2, y2 = string.find(crop, "(%d+),%s*(%d+),%s*(%d+),%s*(%d+)") if x1 == nil then error("output of #324 malformed") end print("x1", x1, "y1", y1, "x2", x2, "y2", y2) -- crop the image local orig = img img = { width = x2-x1, height = y2-y1, getInt = function(x, y) return orig.getInt(x+x1, y+y1) end } }} | 2015-08-18 10:17:43 | delete |
| 391 | #1000604 (pitcher) | 2015-08-18 00:07:22 |
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | javax.imageio.IIOException: Can't get input stream from URL! | [visualize] |
| Snippet ID: | #325 |
| Snippet name: | Standard crop include |
| Eternal ID of this version: | #325/1 |
| Text MD5: | 40cef2243264037ad2956092fa6077c6 |
| Author: | stefan |
| Category: | |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-01-23 01:23:00 |
| Source code size: | 446 bytes / 17 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1696 / 262 |
| Referenced in: | [show references] |