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


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

Lua code - Image distinction (executor)

get("#485") -- containsColor

-- Job: Distinguish two classes of images
-- Two images are supplied at once, one of each class.
-- Task is to find out if the two images are swapped or not.
-- input variables: img1, img2
-- output: a function returning true or false (swapped or no)
-- variables set by learner: color, class2sampled

return function()
  flag1 = containsColor(img1, color)
  flag2 = containsColor(img2, color)
  if flag1 == flag2 then
    return false
  return flag1 == class2sampled

Author comment

Began life as a copy of #484

test run  test run with input  download  show line numbers   

Travelled to 8 computer(s): aoiabmzegqzx, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

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
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: 479 / 87
Referenced in: [show references]

Formerly at &