To work with specific regions of the screen, use aircv.crop_image() to create a partial screenshot. You can then use Template.match_in() to find an image within that specific cropped area.
Note: Coordinates returned by match_in() are relative to the cropped image. To get absolute screen coordinates, you must add the offset used during cropping.
from airtest.core.api import *
from airtest.aircv import *
auto_setup(__file__)
screen = G.DEVICE.snapshot()
# 1. Create a partial screenshot using coordinates (x, y, width, height)
local_screen = aircv.crop_image(screen, (0, 949, 1067, 1500))
# 2. Define target and find it in the partial screenshot
template = Template(r"png_code/settings.png")
pos = template.match_in(local_screen)
# 3. Convert relative pos to absolute screen coordinates
# (pos[0] + offset_x, pos[1] + offset_y)
print(pos[0] + 0, pos[1] + 949)
from airtest.core.api import *
from airtest.aircv import *
auto_setup(__file__)
screen = G.DEVICE.snapshot()
# Partial screenshot
local_screen = aircv.crop_image(screen,(0,949,1067,1500))
# Set our target screenshot as a Template object
tempalte = Template(r"png_code/settings.png")
# Find the specified image object in the partial screenshot
pos = tempalte.match_in(local_screen)
# Return the coordinates of the image object found (the coordinates are relative to the coordinates of the local screenshot)
print(pos)
# To return the coordinates of the target in the entire screen, both x and y need to be added with the minimum x and y set during the partial screenshot
print(pos[0]+0,pos[1]+949)