home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
AutoCropper plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jawbroken" data-source="post: 70885" data-attributes="member: 14372"><p>Okay, I have something that works well, I think. It will be easy enough to code as a lookup array once a number of sample points is decided upon.</p><p></p><p>I started with a cubic, but that was too flat around the mid point. So I used the inverse sin function, which is not too flat, but still clusters points in the centre of the screen.</p><p></p><p>For, say, number of samples = 21 (n=21):</p><p></p><p>f<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite25" alt="(n)" title="Thumbs Down (n)" loading="lazy" data-shortname="(n)" /> = arcsin((n-10)/10)*0.8/pi + 0.5</p><p></p><p>For n is from 0 to 21, f<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite25" alt="(n)" title="Thumbs Down (n)" loading="lazy" data-shortname="(n)" /> ranges from 0.1 to 0.9 (to avoid sampling out of frame or disinteresting areas).</p><p>To adapt for a different number of samples the (n-10)/10 part is changed to give a range from -1 to 1 for n from 0 to maxN.</p><p></p><p>For above:</p><p>f<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite25" alt="(n)" title="Thumbs Down (n)" loading="lazy" data-shortname="(n)" /> = [0.10000, 0.21485, 0.26387, 0.30255, 0.33613, 0.36667, 0.39521, 0.42241, 0.44872, 0.47449, 0.50000, 0.52551, 0.55128, 0.57759, 0.60479, 0.63333, 0.66387, 0.69745, 0.73613, 0.78515, 0.90000]</p><p></p><p>Then all you need to do is multiple by the width or height and truncate or round to an integer to get the sample pixel. For example, looking at a 720x576 frame, sample points along the row will mean multiplying by 720, giving points at:</p><p>sample points = [72, 155, 190, 218, 242, 264, 285, 304, 323, 342, 360, 378, 397, 416, 435, 456, 478, 502, 530, 565, 648]</p><p></p><p>or for columns, multiply by 576 giving:</p><p>sample points = [72, 155, 190, 218, 242, 264, 285, 304, 323, 342, 360, 378, 397, 416, 435, 456, 478, 502, 530, 565, 648]</p></blockquote><p></p>
[QUOTE="jawbroken, post: 70885, member: 14372"] Okay, I have something that works well, I think. It will be easy enough to code as a lookup array once a number of sample points is decided upon. I started with a cubic, but that was too flat around the mid point. So I used the inverse sin function, which is not too flat, but still clusters points in the centre of the screen. For, say, number of samples = 21 (n=21): f(n) = arcsin((n-10)/10)*0.8/pi + 0.5 For n is from 0 to 21, f(n) ranges from 0.1 to 0.9 (to avoid sampling out of frame or disinteresting areas). To adapt for a different number of samples the (n-10)/10 part is changed to give a range from -1 to 1 for n from 0 to maxN. For above: f(n) = [0.10000, 0.21485, 0.26387, 0.30255, 0.33613, 0.36667, 0.39521, 0.42241, 0.44872, 0.47449, 0.50000, 0.52551, 0.55128, 0.57759, 0.60479, 0.63333, 0.66387, 0.69745, 0.73613, 0.78515, 0.90000] Then all you need to do is multiple by the width or height and truncate or round to an integer to get the sample pixel. For example, looking at a 720x576 frame, sample points along the row will mean multiplying by 720, giving points at: sample points = [72, 155, 190, 218, 242, 264, 285, 304, 323, 342, 360, 378, 397, 416, 435, 456, 478, 502, 530, 565, 648] or for columns, multiply by 576 giving: sample points = [72, 155, 190, 218, 242, 264, 285, 304, 323, 342, 360, 378, 397, 416, 435, 456, 478, 502, 530, 565, 648] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
AutoCropper plugin
Contact us
RSS
Top
Bottom