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

19
LINES

< > BotCompany Repo | #486 // Image distinguisher by randomly selected color [execution part]

Lua code - Image distinction (executor)

1  
get("#485") -- containsColor
2  
3  
-- Job: Distinguish two classes of images
4  
-- Two images are supplied at once, one of each class.
5  
-- Task is to find out if the two images are swapped or not.
6  
--
7  
-- input variables: img1, img2
8  
-- output: a function returning true or false (swapped or no)
9  
--
10  
-- variables set by learner: color, class2sampled
11  
12  
return function()
13  
  flag1 = containsColor(img1, color)
14  
  flag2 = containsColor(img2, color)
15  
  if flag1 == flag2 then
16  
    return false
17  
  end
18  
  return flag1 == class2sampled
19  
end

Author comment

Began life as a copy of #484

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

No comments. add comment

Snippet ID: #486
Snippet name: Image distinguisher by randomly selected color [execution part]
Eternal ID of this version: #486/1
Text MD5: c2f18e5a4437107d6b05a43cc64e5ec7
Author: stefan
Category:
Type: Lua code - Image distinction (executor)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-03-03 18:27:38
Source code size: 531 bytes / 19 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 680 / 145
Referenced in: [show references]