W3C home > Mailing lists > Public > public-media-capture@w3.org > August 2014

Re: Follow-up questions for details on the "min distance" algorithm

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Fri, 08 Aug 2014 14:24:17 -0400
Message-ID: <53E515D1.7060407@mozilla.com>
To: Harald Alvestrand <harald@alvestrand.no>, public-media-capture@w3.org
On 8/8/14 8:38 AM, Harald Alvestrand wrote:
> I actually don't see much use for the "weak match" - there seems no 
> strong argument for keeping facingMode to a value of 1 while groupId 
> has a value of 1000, but there seems to be good arguments for both 
> being regarded as "more important" than a minor discrepancy in framesize.
>
> I suggest having MATCH be the only defined mode, and the "not-match" 
> distance be 10, not 1.

I like fewer modes, but hate arbitrary values. FWIW with a non-match 
value of 1, facingMode already is "more important than any 'minor' 
discrepancy" in dimensions.

But I see a problem in the CLOSE (|ideal-actual|/ideal) distance 
algorithm: The distance is asymmetrical for A over B versus B over A.

For example:

If I want { width: 1600, facingMode: "user" } and the user-facing camera 
can only handle 640, then its distance is (1600-640)/1600 = 0.6 which 
still beats a perfect environment-facing camera (provided you don't 
specify ideal height or aspect).

But the reverse is untrue: if I want { width: 640, facingMode: "user" } 
and the user-facing camera can only handle 1600, then its distance is 
(1600-640)/640 = 1.5 which would NOT beat a perfect environment-facing 
camera.

This seems unbalanced, not just because intuitively the two examples 
seem "equally wrong" (off by same amount of pixels), but because:

  * when undershooting, the distance approaches but never exceeds 1
    (unless you go negative)
  * when overshooting, the distance is unlimited.


Just to throw out an idea: What if we always divided by the larger 
number? I can't articulate a rationale except it seems to work better.

Ideal is inherently about comparing apples to oranges, but if distances 
at least always approached 1 then adding them seems more likely to 
produce equal consideration for each constraint.

If we do that, that leaves the problem of interrelated constraints, like 
width, height and aspectRatio, which, if you specify ideals for all 
three, makes dimension effectively count three times.

Maybe that's intuitive since you specified three wishes, except what if 
we had had dimension as a datatype: e.g. { dimension: { ideal: { w: 
1600, h: 1200, aspect: 4/3 } } } ?

.: Jan-Ivar :.
Received on Friday, 8 August 2014 18:24:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:29 UTC