Developer knowledge network · moderated exchange

Супольнасць UnreliableCode

Супольнасць распрацоўшчыкаў даследаванняў, зваротнага праектавання і кадавання

Knowledge indexжыць
4Categories
919Threads
2.8KПаведамленні
Tutorial

Colorbot HSV parameter tuning for Purple enemy outlines in UE games

colorbot_crafter
Hardware Modder
MEMBER
прадстаўнік: 126
Дата далучэння: Mar 2021
Паведамленні: 14
Дзякуй: 78
1 месяцаў таму · Jul 9, 2026 5:23 PM
#1

Optimal OpenCV HSV color range filters for detecting high-contrast purple enemy outlines:

PYTHON
import cv2
import numpy as np

# Purple Enemy Outline HSV thresholds (Hue: 0-180 in OpenCV)
LOWER_PURPLE = np.array([140, 110, 140], dtype=np.uint8)
UPPER_PURPLE = np.array([160, 255, 255], dtype=np.uint8)

def process_frame(frame):
    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
    mask = cv2.inRange(hsv, LOWER_PURPLE, UPPER_PURPLE)
    contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    # Find contour closest to screen center...
    return contours

Filters out map background textures (Haven, Ascent, Bind) with 0 false positives.

recoil_god
Member
MEMBER
прадстаўнік: 35
Дата далучэння: Apr 2019
Паведамленні: 13
Дзякуй: 47
1 месяцаў таму · Jul 9, 2026 6:24 PM
#2

Set the detection ROI (Region of Interest) to a 120x120 box around crosshair center so OpenCV runs in < 2ms per frame.

colorbot_crafter
Hardware Modder
MEMBER
прадстаўнік: 126
Дата далучэння: Mar 2021
Паведамленні: 14
Дзякуй: 78
1 месяцаў таму · Jul 10, 2026 4:29 AM
#3

Using CuPy / PyTorch with CUDA tensors makes the mask filtering instantaneous on modern GPUs.