AutoCV Functions

class autocv.autocv.AutoCV(hwnd: int = -1)[source]

Bases: Input

Provides an interface for interacting with windows and images on a computer screen.

AutoCV uses OpenCV and Tesseract OCR to capture and process images, perform color picking, and simulate user input. It offers methods for window manipulation, screen capture, and image analysis.

get_hwnd() int[source]

Returns the current window handle.

Returns:

The window handle.

Return type:

int

get_window_size() tuple[int, int][source]

Retrieves the width and height of the current window.

Returns:

A tuple (width, height) in pixels.

Return type:

tuple[int, int]

antigcp() bool[source]

Patches the target process by replacing its GetCursorPos function.

Returns:

True if successfully patched; otherwise, False.

Return type:

bool

image_picker() tuple[npt.NDArray[np.uint8] | None, tuple[int, int, int, int] | None][source]

Launches the image picker interface for region selection.

Returns:

A tuple containing the selected image as a NumPy array and its rectangle (x, y, width, height), or (None, None) if no image was selected.

Return type:

tuple[npt.NDArray[np.uint8] | None, tuple[int, int, int, int] | None]

color_picker() tuple[tuple[int, int, int], tuple[int, int]] | None[source]

Launches the color picker interface for pixel color selection.

Returns:

A tuple containing the selected color (R, G, B) and its screen coordinates, or None if no color was selected.

Return type:

tuple[tuple[int, int, int], tuple[int, int]] | None

image_filter() FilterSettings[source]

Applies image filtering operations to the current backbuffer and returns the filter settings.

Returns:

The current filter settings after applying the image filter.

Return type:

FilterSettings

show_backbuffer(*, live: bool = False) None[source]

Displays the current backbuffer image in a window.

Parameters:

live (bool, optional) – If True, shows a live refreshing view. Defaults to False.