<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Фильтрация пикселей]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=12984</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12984&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Фильтрация пикселей».]]></description>
		<lastBuildDate>Thu, 21 Sep 2017 10:27:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119459#p119459</link>
			<description><![CDATA[<p>Другой.<br /><a href="https://github.com/MasterFocus/AutoHotkey/tree/master/Functions/Gdip_ImageSearch">https://github.com/MasterFocus/AutoHotk … mageSearch</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 21 Sep 2017 10:27:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119459#p119459</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119453#p119453</link>
			<description><![CDATA[<p><strong>Malcev</strong> Можно использовать в этом варианте скрипта маленькие картинки вместо пикселей? Или же нужно кардинально другой подход?</p>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Thu, 21 Sep 2017 06:47:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119453#p119453</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119440#p119440</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Integer keys are stored using the native signed integer type. AutoHotkey 32-bit supports integer keys in the range -2147483648 to 2147483647. AutoHotkey supports 64-bit integers, but only AutoHotkey 64-bit supports the full range as keys in an object.</p></blockquote></div><p><a href="https://autohotkey.com/docs/Objects.htm">https://autohotkey.com/docs/Objects.htm</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 20 Sep 2017 17:43:02 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119440#p119440</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119429#p119429</link>
			<description><![CDATA[<p>Можно попроще:</p><div class="codebox"><pre><code>Пиксели_Список := [0xFF061779, 0xFFB67602, 0xFF880205, 0xFFCD4F66, 0xFF0958E5, 0xFF721E2B, 0xFF004337, 0xFF1B2849, 0xFF182443, 0xFF183966, 0xFF61222D, 0xFF052F67, 0xFF3B5A88, 0xFFBC944C, 0xFFE1E6A7, 0xFF054BAD, 0xFF003BA7, 0xFF27AF9B, 0xFFB02F2A, 0xFF005947, 0xFF8C4637, 0xFF379E80, 0xFF937726, 0xFF9C6006, 0xFF212876, 0xFF004236, 0xFF007268, 0xFF0A3B26, 0xFF0D372C, 0xFFA9444C, 0xFF335382, 0xFFC9A374, 0xFF466278, 0xFF376058, 0xFF275A47, 0xFF896515, 0xFF7A5202, 0xFF32425D, 0xFF9B3316, 0xFF002667, 0xFF590817, 0xFF31AE8E, 0xFFE63746, 0xFF07246A, 0xFF01185E, 0xFF041D45, 0xFF365243, 0xFF450915, 0xFF16215F, 0xFF521620, 0xFF527071, 0xFFAA8A85, 0xFF855907, 0xFF8C5814, 0xFF0272E1, 0xFFC68A91, 0xFF0758CA, 0xFF6C2132, 0xFF574405, 0xFF9D465F, 0xFF5E1416, 0xFF15433A, 0xFF3F4954, 0xFF71614A, 0xFF016759, 0xFFAB3B37, 0xFF032DBE, 0xFF014E3E, 0xFF4E8889, 0xFFF4F9D5, 0xFF1A4E41, 0xFF8B6915]

КоличествоНайденныхПикселей_Таблица:={} ; создаем таблицу
For k, v in Пиксели_Список
	КоличествоНайденныхПикселей_Таблица[v &quot;&quot;] := 0 ; заполняем столбец кол-во нулями

For k, v in КоличествоНайденныхПикселей_Таблица
	Msgbox % k &quot; &quot; v</code></pre></div><p><strong>Malcev</strong>, не в курсе почему асоциативный массив интерпетирует ключи-числа больше двух с чем-то миллиардов как отрицательные?</p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Wed, 20 Sep 2017 14:47:58 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119429#p119429</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119423#p119423</link>
			<description><![CDATA[<p>То что не вмещается перенесите на следующую строку:<br /></p><div class="codebox"><pre><code>a1:=a2:=a3:=0
b1:=b2:=b3:=0</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 20 Sep 2017 13:07:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119423#p119423</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119421#p119421</link>
			<description><![CDATA[<p><strong>Malcev</strong> Столкнулся с такой проблемой. Начал пользоваться скриптом и по мере работы добавлял в базу пиксели. И тут добавляю +1 пиксель - ошибка, удаляю 1 пиксель, скрипт работает. Не знал, что количество ограничено или я что-то не так делаю?</p><br /><div class="codebox"><pre><code>variation := 0x3
Arr:={}
Arr[&quot;&quot; 0xFF061779]:=Arr[&quot;&quot; 0xFFB67602]:=Arr[&quot;&quot; 0xFF880205]:=Arr[&quot;&quot; 0xFFCD4F66]:=Arr[&quot;&quot; 0xFF0958E5]:=Arr[&quot;&quot; 0xFF721E2B]:=Arr[&quot;&quot; 0xFF004337]:=Arr[&quot;&quot; 0xFF1B2849]:=Arr[&quot;&quot; 0xFF182443]:=Arr[&quot;&quot; 0xFF183966]:=Arr[&quot;&quot; 0xFF61222D]:=Arr[&quot;&quot; 0xFF052F67]:=Arr[&quot;&quot; 0xFF3B5A88]:=Arr[&quot;&quot; 0xFFBC944C]:=Arr[&quot;&quot; 0xFFE1E6A7]:=Arr[&quot;&quot; 0xFF054BAD]:=Arr[&quot;&quot; 0xFF003BA7]:=Arr[&quot;&quot; 0xFF27AF9B]:=Arr[&quot;&quot; 0xFFB02F2A]:=Arr[&quot;&quot; 0xFF005947]:=Arr[&quot;&quot; 0xFF8C4637]:=Arr[&quot;&quot; 0xFF379E80]:=Arr[&quot;&quot; 0xFF937726]:=Arr[&quot;&quot; 0xFF9C6006]:=Arr[&quot;&quot; 0xFF212876]:=Arr[&quot;&quot; 0xFF004236]:=Arr[&quot;&quot; 0xFF007268]:=Arr[&quot;&quot; 0xFF0A3B26]:=Arr[&quot;&quot; 0xFF0D372C]:=Arr[&quot;&quot; 0xFFA9444C]:=Arr[&quot;&quot; 0xFF335382]:=Arr[&quot;&quot; 0xFFC9A374]:=Arr[&quot;&quot; 0xFF466278]:=Arr[&quot;&quot; 0xFF376058]:=Arr[&quot;&quot; 0xFF275A47]:=Arr[&quot;&quot; 0xFF896515]:=Arr[&quot;&quot; 0xFF7A5202]:=Arr[&quot;&quot; 0xFF32425D]:=Arr[&quot;&quot; 0xFF9B3316]:=Arr[&quot;&quot; 0xFF002667]:=Arr[&quot;&quot; 0xFF590817]:=Arr[&quot;&quot; 0xFF31AE8E]:=Arr[&quot;&quot; 0xFFE63746]:=Arr[&quot;&quot; 0xFF07246A]:=Arr[&quot;&quot; 0xFF01185E]:=Arr[&quot;&quot; 0xFF041D45]:=Arr[&quot;&quot; 0xFF365243]:=Arr[&quot;&quot; 0xFF450915]:=Arr[&quot;&quot; 0xFF16215F]:=Arr[&quot;&quot; 0xFF521620]:=Arr[&quot;&quot; 0xFF527071]:=Arr[&quot;&quot; 0xFFAA8A85]:=Arr[&quot;&quot; 0xFF855907]:=Arr[&quot;&quot; 0xFF8C5814]:=Arr[&quot;&quot; 0xFF0272E1]:=Arr[&quot;&quot; 0xFFC68A91]:=Arr[&quot;&quot; 0xFF0758CA]:=Arr[&quot;&quot; 0xFF6C2132]:=Arr[&quot;&quot; 0xFF574405]:=Arr[&quot;&quot; 0xFF9D465F]:=Arr[&quot;&quot; 0xFF5E1416]:=Arr[&quot;&quot; 0xFF15433A]:=Arr[&quot;&quot; 0xFF3F4954]:=Arr[&quot;&quot; 0xFF71614A]:=Arr[&quot;&quot; 0xFF016759]:=Arr[&quot;&quot; 0xFFAB3B37]:=Arr[&quot;&quot; 0xFF032DBE]:=Arr[&quot;&quot; 0xFF014E3E]:=Arr[&quot;&quot; 0xFF4E8889]:=Arr[&quot;&quot; 0xFFF4F9D5]:=Arr[&quot;&quot; 0xFF1A4E41]:=Arr[&quot;&quot; 0xFF8B6915]:=0
SetBatchLines, -1
CoordMode, Pixel, screen
SetFormat, IntegerFast, hex
pToken := Gdip_Startup()
pBitmap := Gdip_CreateBitmapFromFile(&quot;payload.png&quot;)
width := Gdip_GetImageWidth(pBitmap)
height := Gdip_GetImageHeight(pBitmap)
Gdip_LockBits(pBitmap, 0, 0, width, height, Stride, Scan0, BitmapData)
loop % width
{
   A_Index_X := A_Index-1
   loop % height
   {
      CurrentPixel := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)
      For k in Arr
      {
      if !(abs((k &amp; 0xff) - (CurrentPixel &amp; 0xff)) &gt; variation2)
      &amp;&amp; !(abs(((k &gt;&gt; 8) &amp; 0xff) - ((CurrentPixel &gt;&gt; 8) &amp; 0xff)) &gt; variation)
      &amp;&amp; !(abs(((k &gt;&gt; 16) &amp; 0xff) - ((CurrentPixel &gt;&gt; 16) &amp; 0xff)) &gt; variation)
         {
            ++Arr[&quot;&quot; k] 
            break
         }
      } 
   }
}
SetFormat, IntegerFast, dec
For k, v in Arr
{
   If (v = 0)
      Continue
   Else
      res .= k &quot;`n&quot;
}
msgbox % res</code></pre></div><p>Можно было через создания файла, но думал, что базу можно и в сам скрипт вписать, чтоб без лишних файлов.</p>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Wed, 20 Sep 2017 11:53:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119421#p119421</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119414#p119414</link>
			<description><![CDATA[<p><strong>Malcev</strong> Понял и заметно быстрее выдается результат.</p>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Mon, 18 Sep 2017 17:26:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119414#p119414</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119413#p119413</link>
			<description><![CDATA[<p>Он может быть нужен не перед, а после, для того чтобы при нахождении соответствия пикселей прервать цикл перебирания оставшихся пикселей. <br /></p><div class="codebox"><pre><code>{
   ++Arr[&quot;&quot; k] 
   break
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 18 Sep 2017 17:23:40 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119413#p119413</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119412#p119412</link>
			<description><![CDATA[<p><strong>Malcev</strong> Работает. А для чего нужен Break перед ++Arr[&quot;&quot; k]? На что он влияет и почему необязателен?</p>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Mon, 18 Sep 2017 17:14:47 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119412#p119412</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119410#p119410</link>
			<description><![CDATA[<p>Это надо убрать:<br /></p><div class="codebox"><pre><code>      If Arr.HasKey(&quot;&quot; CurrentPixel)
         ++Arr[&quot;&quot; CurrentPixel]</code></pre></div><p>И убрать из цикла For k in Arr<br /></p><div class="codebox"><pre><code>      CurrentPixel := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)</code></pre></div><p>Можно еще после&nbsp; &nbsp;++Arr[&quot;&quot; k] добавить Break.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 18 Sep 2017 16:43:03 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119410#p119410</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119402#p119402</link>
			<description><![CDATA[<p>Этот код вроде работает, но доверять результатам не могу. Вариация срабатывает только при значении 100.</p><div class="codebox"><pre><code>variation := 0x5
Arr:={}
Arr[&quot;&quot; 0xFFFFC90E]:=Arr[&quot;&quot; 0xFFB5E61D]:=Arr[&quot;&quot; 0xFF00A2E8]:=0
SetBatchLines, -1
CoordMode, Pixel, screen
SetFormat, IntegerFast, hex
pToken := Gdip_Startup()
pBitmap := Gdip_CreateBitmapFromFile(&quot;payload.png&quot;)
width := Gdip_GetImageWidth(pBitmap)
height := Gdip_GetImageHeight(pBitmap)
Gdip_LockBits(pBitmap, 0, 0, width, height, Stride, Scan0, BitmapData)
loop % width
{
   A_Index_X := A_Index-1
   loop % height
   {
      CurrentPixel := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)
      If Arr.HasKey(&quot;&quot; CurrentPixel)
         ++Arr[&quot;&quot; CurrentPixel]
      For k in Arr
      {
      CurrentPixel := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)
      if !(abs((k &amp; 0xff) - (CurrentPixel &amp; 0xff)) &gt; variation)
      &amp;&amp; !(abs(((k &gt;&gt; 8) &amp; 0xff) - ((CurrentPixel &gt;&gt; 8) &amp; 0xff)) &gt; variation)
      &amp;&amp; !(abs(((k &gt;&gt; 16) &amp; 0xff) - ((CurrentPixel &gt;&gt; 16) &amp; 0xff)) &gt; variation)
        ++Arr[&quot;&quot; k] 
      } 
   }
}
Gdip_UnlockBits(pBitmap, BitmapData)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
SetFormat, IntegerFast, dec
For k, v in Arr
{
   If (v = 0)
      Continue
   Else
      res .= k &quot;`n&quot;
}
msgbox % res</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Mon, 18 Sep 2017 08:22:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119402#p119402</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119323#p119323</link>
			<description><![CDATA[<p><strong>Malcev</strong> Сделал и ничего не происходит. Скрипт зависает и результатов никаких не дает. Ошибок тоже не показывает.</p>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Wed, 13 Sep 2017 17:23:07 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119323#p119323</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119318#p119318</link>
			<description><![CDATA[<p>Сделать цикл: &quot;For k in Arr&quot;.<br />В него вставить ваш код с вариацией.<br />Заменить bgr2 на CurrentPixel, а bgr1 на k.<br />Если совпадение есть, то увеличить значение ++Arr[&quot;&quot; k] и выйти из цикла.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 13 Sep 2017 14:45:31 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119318#p119318</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119314#p119314</link>
			<description><![CDATA[<p><strong>Malcev</strong> И как адаптировать этот код? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>bgr2 := Gdip_GetLockBitPixel(Scan0, A_Index_X, A_Index-1, Stride)
if !(abs((bgr1 &amp; 0xff) - (bgr2 &amp; 0xff)) &gt; variation)
&amp;&amp; !(abs(((bgr1 &gt;&gt; 8) &amp; 0xff) - ((bgr2 &gt;&gt; 8) &amp; 0xff)) &gt; variation)
&amp;&amp; !(abs(((bgr1 &gt;&gt; 16) &amp; 0xff) - ((bgr2 &gt;&gt; 16) &amp; 0xff)) &gt; variation)</code></pre></div><p>Мозгов пока у меня на это не хватает. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Vicoriyan)]]></author>
			<pubDate>Wed, 13 Sep 2017 12:49:48 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119314#p119314</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Фильтрация пикселей]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=119313#p119313</link>
			<description><![CDATA[<p>Не вижу никаких препятствий.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 13 Sep 2017 12:42:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=119313#p119313</guid>
		</item>
	</channel>
</rss>
