Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Manipulating region records using OpenScrape

Читайте также:
  1. B. Using Projection in Calculations
  2. Complete the sentences below by using one of the idioms above. Some of them can be used more than once.
  3. Complete the sentences using Past Continuous of the verbs in the box.
  4. Examples of Projection Using the Units and Products
  5. Exercise 2. Why Do You Look So? Explain the reason people look so using the Present Perfect Continuous Tense. Use the given situations.
  6. Exercise 6. Answer the following questions using active vocabulary.
  7. Exercise 65. In pairs, ask and answer questions using the prompts given, as in the example.

§ To create a new region record, select the “Regions” category in the record tree display on the Table Map Editor window, and click the “New” button. A window will be displayed that allows you to select the name of the region to create. After creating the record, you can use the controls on the right side of the Table Map Editor window, as described below, to change the settings for the new record.

§ To edit an existing region record, select the record in the record tree display on the Table Map Editor window. Immediately after selecting the record, the controls on the right side of the Table Map Editor window are updated with the settings for the selected region record. These can then be changed, as described below.

§ To delete an existing region record, select the record in the record tree display on the Table Map Editor window, and click the “Delete” button. A window will be displayed asking for verification of this action.

 

Note: The Insert and Delete keys can also be used as a shortcut for adding and deleting Region records.

 

Note: Regions can also be selected by left clicking within the region’s flashing red rectangle that is layered on top of the poker table image on the Main window. If multiple regions are layered on top of each other, clicking again on the same area will select the next region below the selected region. This only works for two regions. If three or more regions are layered on top of each other, the selection tree will need to be used.

 

The majority of the right side of the Table Map Editor window is used to manipulate the parameters of the region record.

 

Figure 4.5‑11 OpenScrape Rectangle Group Box

 

Starting at the top, there is a rectangle group box. This group box allows you to define the extents (left, right, top, bottom) of the region record’s bounding rectangle. The bounds are inclusive – in other words, a rectangle defined as left=0, right=5, top=0 and bottom=6 will be 6 pixels wide and 7 pixels high. The rectangle settings can be direct entered into the controls, you can use the spinners next to the controls, or you can use the rectangle drawing tool to quickly draw the rectangle on the poker table.

 

To use the rectangle drawing tool, click once on this control:

Figure 4.5‑12 OpenScrape Rectangle drawing tool

 

...then move your mouse cursor to the Main OpenScrape window where the image of the poker table is displayed. The mouse cursor will change to look like crosshairs with an arrow pointing right and down. Left click and hold the mouse button anywhere on the poker table image to define the left-top corner of the rectangle. Drag to the right and down, and when you reach the right-bottom corner of the rectangle, release the left mouse button.

 

A zoomed view of the region is displayed in the box at the bottom right of the Table Map Editor window. The Table Map Editor window can be enlarged, if needed, to show the entire region. Use the Zoom Level control to adjust the zoom level in this display.

 

Figure 4.5‑13 OpenScrape Nudge group box

 

To the right of the rectangle group box is the nudge group box. These controls allow you to adjust the size and position of the region record’s rectangle in a variety of ways. The group of six controls on the left, starting from top left and moving clockwise, allow you to make the rectangle taller, shorter, thinner, smaller, bigger and wider. The group of 8 controls on the right, starting from top left and moving clockwise, allow you to move the rectangle up-left, up, up-right, right, down-right, down, down-left, and left.

 

Note: Regions can also be moved by first selecting the region by left clicking within the region’s flashing red rectangle on the poker table image on the Main window, then by holding the Shift key and dragging and dropping the region to its new location.

 

Note: Keyboard shortcuts also exist to move and resize regions:

Arrow keys - Move the region 1 pixel

Numpad keys 1, 3, 7, and 9 – Move the region diagonally 1 pixel

Shift + Arrow keys - Move the region 5 pixels

Control + Arrow keys - Resize the region by 1 pixel

Control + Shift + Arrow keys – Resize the region by 5 pixels

 

Figure 4.5‑14 OpenScrape Region record parameters

 

The next set of controls allows you to set the remainder of the parameters on a region record. Here you can set the type of transform, the radius of the RGB color cube, and the center color of the RGB color cube. The use of RGB color cubes for transforms of type Color and Text is described in the technical reference below. Also in this group of controls is an eyedropper button that is used to populate the color parameters, as opposed to directly entering those values. To use the eyedropper, click once on the eyedropper button, then hover over the region’s image display at the bottom of the Table Map Editor window. When the color you want is present in the four color fields, click the left mouse button to lock them in.

 

As a helpful reference, the “Avg Color” fields are populated with the calculated average color of all pixels in the region. This is useful for finding RGB color cube centers and for text transform separations.

 

 

Figure 4.5‑15 OpenScrape Transform result preview

 

This field provides an instant preview of the results of combining the current pixels in the region with the current transform for that region. If this is a Text transform, the actual transformed ASCII text is displayed. If this is a Color transform, True or False is displayed, depending if the region’s average color is inside or outside of the defined RGB color cube. If this is a Hash transform, the value of the matching Hash record is displayed. If this is an Image transform, the value of the matching Image record is displayed.

 

 

Figure 4.5‑16 OpenScrape Pixel Separation display

 

If your region is defined to have a Text transform, then the Pixel Separation window will be populated with a preview of this separation. The key to good Text transformation is the separation of foreground pixel colors from background pixel colors. In this display, foreground pixels will be shown as an “X”, and background pixels as a blank space. The size of the font used in this display can be adjusted with the “+” and “-“ buttons to the right.

 

Note: Remember that the whole purpose of a region definition, with a given type of transformation, is to tell the screen scraper what the pixels mean that are displayed on the screen within that region. The return value of the transformation is provided to the OpenHoldem game state engine which then uses those values to establish the game state and to provide various information that your bot logic needs to make action decisions. A human can easily look at the balance for seat #2 and see that it is $950.12. For a computer it is harder – we need to specify the rectangle that bounds this balance region, define it as a text transform, choose a color that lets the screen scraper identify foreground from background pixels, and then collect each of the individual font characters (more on this below) so that the screen scraper engine can look up the actual ASCII text for these pixels.

 

The Edit menu of on the Main window contains a “Duplicate Region” entry, which is intended to allow the quick creation of related region records. First, select a region record from the tree display on the Table Map Editor window, then select Edit/Duplicate Region from the Main window. This action will display this window:

 

Figure 4.5‑17 OpenScrape Duplicate Region window

 

In this case, the p0balance region was selected. You are given the option to duplicate the selected region record to other region records of the same type. In this case, all of the unpopulated pXbalance and uXbalance region records are candidates. You can select one or more than one destination record here (using the standard Windows Ctrl and Shift multi-select capability) to copy the selected region to. When you click the OK button, the new region records will be created for you, and you can then move them where needed and adjust them appropriately.

 


Дата добавления: 2015-07-20; просмотров: 174 | Нарушение авторских прав


Читайте в этой же книге: ЗАГАЛЬНІ ПОЛОЖЕННЯ | ПОЯСНЮВАЛЬНА ЗАПИСКА | ПРОЕКТУВАННЯ ПРОГРАМНОЇ СИСТЕМИ | Table of Figures | WinHoldem heritage | References | Installing the software | Creating a Table Map | Familiarizing yourself with OpenScrape | Manipulating symbol records using OpenScrape |
<== предыдущая страница | следующая страница ==>
Technical Reference| Technical Reference

mybiblioteka.su - 2015-2024 год. (0.009 сек.)