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

40
LINES

< > BotCompany Repo | #1031965 // One Color Theory [dev.]

Document

One Color Theory
----------------

Theory makeOneColorTheory(cell) {
  var color = cell.averageColor();

  var theory = postAssumption("Color of every pixel in $cell is $color.", +cell, +color,
    validity := "unknown");
  
  testOneColorTheory(cell, theory);
  return theory;
}

void noteCellColor(cell, theory) {
  var desc = "Pixel check at " + cell;
  if theory.hasExampleNamed(desc) return;
  var strength = cell.area/theory.cell.area; // how much do we have to say about the cell in the theory?
  var p = derivationToProbability(derivation);
  addExampleToTheory(theory, desc, +p, +strength);
}

void testOneColorTheory(cell, theory) {  
  noteCellColor(cell, theory);

  at shouldSplitCell(cell) do:
    for split, splitProbability in usefulSplits(cell):
      at splitProbability do:
        for cell in split:
          testOneColorTheory(cell, theory/*.branch(description := "recursion to " + cell)*/);

    /* I think the following is actually BS:
    for dimension in x/y:          
      var split = cell.equalSplit(dimension);
      var op = outlierProbabilities(split.colors());
      for idx, p in op:
        at p do:
          var sub = likelyNonOutlyingContingent(split, op);
          testOneColorTheory(sub, theory);*/
 
}

download  show line numbers   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031965
Snippet name: One Color Theory [dev.]
Eternal ID of this version: #1031965/1
Text MD5: 23e295fd14b92ecf914d9e34848bac05
Author: stefan
Category: javax / image recognition
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-06 01:36:09
Source code size: 1283 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 146 / 62
Referenced in: #1031966 - OneColorTheoryChecker [dev.]