Sure! Here is the function rewritten so it uses OpenCV's resize function instead:

```
import cv2
import numpy as np

def resize_images(images, res_x, res_y):
    resized_images = np.zeros((images.shape[0], res_x, res_y))
    for n in range(len(images)):
        resized_image = cv2.resize(images[n], (res_y, res_x), cv2.INTER_NEAREST)
        resized_images[n] = resized_image
    return resized_images

```
แน่นอน! นี่คือฟังก์ชันที่เขียนใหม่เพื่อให้ใช้ฟังก์ชันปรับขนาดของ OpenCV แทน: ``` import cv2 import numpy as np def resize_images(images, res_x, res_y): resize_images = np.zeros((images.shape[0], res_x, res_y) ) สำหรับ n อยู่ในช่วง (len (ภาพ)): resize_image = cv2.resize(images[n], (res_y, res_x), cv2.INTER_NEAREST) resize_images[n] = resize_image return resize_images ```
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence