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

40
LINES

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

Document

1  
One Color Theory
2  
----------------
3  
4  
Theory makeOneColorTheory(cell) {
5  
  var color = cell.averageColor();
6  
7  
  var theory = postAssumption("Color of every pixel in $cell is $color.", +cell, +color,
8  
    validity := "unknown");
9  
  
10  
  testOneColorTheory(cell, theory);
11  
  return theory;
12  
}
13  
14  
void noteCellColor(cell, theory) {
15  
  var desc = "Pixel check at " + cell;
16  
  if theory.hasExampleNamed(desc) return;
17  
  var strength = cell.area/theory.cell.area; // how much do we have to say about the cell in the theory?
18  
  var p = derivationToProbability(derivation);
19  
  addExampleToTheory(theory, desc, +p, +strength);
20  
}
21  
22  
void testOneColorTheory(cell, theory) {  
23  
  noteCellColor(cell, theory);
24  
25  
  at shouldSplitCell(cell) do:
26  
    for split, splitProbability in usefulSplits(cell):
27  
      at splitProbability do:
28  
        for cell in split:
29  
          testOneColorTheory(cell, theory/*.branch(description := "recursion to " + cell)*/);
30  
31  
    /* I think the following is actually BS:
32  
    for dimension in x/y:          
33  
      var split = cell.equalSplit(dimension);
34  
      var op = outlierProbabilities(split.colors());
35  
      for idx, p in op:
36  
        at p do:
37  
          var sub = likelyNonOutlyingContingent(split, op);
38  
          testOneColorTheory(sub, theory);*/
39  
 
40  
}

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