-
1. Re: Filter factory limitation on clauses?
Noel Carboni Sep 19, 2010 8:23 AM (in response to George Austin)I'll start by saying I'm not a Filter Factory expert, but just thinking about basic logic for a moment, is it possible the "caution" indicator is telling you that you need to group your clauses?
A && B || C can be ambigious, and will depend on the order of execution.
(A && B) || C is unambiguous.
-Noel
-
2. Re: Filter factory limitation on clauses?
Mylenium Sep 19, 2010 10:38 AM (in response to George Austin)Without providing the code such questions are pretty pointless, but I tend to agree with Noel that you are creating an ambiguous state and there can be no logical branching...
Mylenium
-
3. Re: Filter factory limitation on clauses?
George Austin Sep 19, 2010 11:43 AM (in response to Mylenium)Here's the code in the R box:
x<128 && y<128 && r>g && g>b && (128*b) >(r*x) ||
x<128 && y<128 && r>b && b>g && (128*g) >(r*x) ||
x<128 && y<128 && r>b && b>g && (128*g) >(r*y) ||
x<128 && y<128 && g>r && r>b && (128*b) >(g*x) ||
x<128 && y<128 && g>r && r>b && (128*b) >(g*y) ||
x<128 && y<128 && g>b && b>r && (128*r) >(g*x) ||
x<128 && y<128 && g>b && b>r && (128*r) >(g*y) ||
x<128 && y<128 && b>r && r>g && (128*g) >(b*x) ||
x<128 && y<128 && b>r && r>g && (128*g) >(b*y) ||
x<128 && y<128 && b>g && g>r && (128*r) >(b*x) ||
x<128 && y<128 && b>g && g>r && (128*r) >(b*y) ? 255:rWorks until I add the last three lines keeping, of course, the If_Then_Else conclusion "?255:r"
If I add any one or two or all of the last three lines, the caution comes on.
The G and B boxes are identical except they end with g and b, respectively. They behave the same way as the R box, as you would expect.
-
4. Re: Filter factory limitation on clauses?
George Austin Sep 19, 2010 12:37 PM (in response to George Austin)The second line got cut out. Corrected code below:
x<128 && y<128 && r>g && g>b && (128*b) >(r*x) ||
x<128 && y<128 && r>g && g>b && (128*b) >(r*y) ||
x<128 && y<128 && r>b && b>g && (128*g) >(r*x) ||
x<128 && y<128 && r>b && b>g && (128*g) >(r*y) ||
x<128 && y<128 && g>r && r>b && (128*b) >(g*x) ||
x<128 && y<128 && g>r && r>b && (128*b) >(g*y) ||
x<128 && y<128 && g>b && b>r && (128*r) >(g*x) ||
x<128 && y<128 && g>b && b>r && (128*r) >(g*y) ||
x<128 && y<128 && b>r && r>g && (128*g) >(b*x) ||
x<128 && y<128 && b>r && r>g && (128*g) >(b*y) ||
x<128 && y<128 && b>g && g>r && (128*r) >(b*x) ||
x<128 && y<128 && b>g && g>r && (128*r) >(b*y) ? 255:r -
5. Re: Filter factory limitation on clauses?
Noel Carboni Sep 20, 2010 9:39 AM (in response to George Austin)How is this evaluated? Does && bind more tightly than ||?
If they're equal in precedence, and it's left to right, your expression makes little sense.
What I was saying is that maybe you want to use more ( and ) to group the subexpressions so that you can both ensure in which order they are evaluated, and to possibly help the parser deal with such a long expression.
-Noel
-
6. Re: Filter factory limitation on clauses?
George Austin Sep 20, 2010 5:33 PM (in response to Noel Carboni)The filter is applied to a pre-existing 255x255 pixel image with linear gradients left-to-right for red, top-to-bottom for green, and with blue constant at 128, after the image has been altered in LAB by rotating the LAB b channel curve CCW. It is supposed to color pixels white if their saturation has decreased, else leave them unchanged as part of addressing the question of what happens to saturation when the LAB curve is rotated CCW or CW. Each quadrant is treated separately because the initial saturation parameter varies with quadrant (and by half-quadrant in two of them).
The problem is NOT a limitation on the number of Filter Factory clauses as I too quickly assessed it. There is a logic glitch in the NW quadrant code which I am working to eliminate. The 12 lines represent 12 mutually exclusive conditions, only one of which can exist at a given pixel site but any of which might exist at different sites. Hence the sequence of "or" statements.
The SW quadrant is simpler and I took a different approach with it. The results for it (attached---with the LAB b channel rotared to +/- 64) illustrate the objective.




