当前位置:首页>python>Python OpenCV鼠标事件全解析

Python OpenCV鼠标事件全解析

  • 2026-01-14 02:25:09
Python OpenCV鼠标事件全解析

Python自学手册

Python OpenCV图像处理与计算机视觉项目中,鼠标事件是实现交互式操作的核心技术之一,广泛应用于目标框选、像素信息获取、图像标注、自由绘图等场景。OpenCV通过绑定鼠标回调函数,可精准响应鼠标的点击、双击、拖动、滚轮滚动等操作,实现灵活的人机交互。本文档将系统讲解OpenCV鼠标事件的核心机制、常用事件类型、回调函数定义规范,搭配多场景实战代码示例,帮助开发者快速掌握Python OpenCV鼠标事件的使用方法。

一、基础准备:核心概念与环境搭建

在学习鼠标事件前,需先理解其核心工作机制,同时完成基础环境搭建,为后续实操奠定基础。

1.1 核心概念解析

鼠标事件:指鼠标的各类操作(如点击、拖动、滚轮滚动等),OpenCV预定义了多种标准鼠标事件,可通过指定事件标识响应对应操作;

回调函数:是响应鼠标事件的核心函数,当触发指定鼠标事件时,OpenCV会自动调用该函数,并传入事件类型、鼠标坐标、按键状态等参数;

事件绑定:通过cv2.setMouseCallback()函数将回调函数与指定窗口绑定,实现特定窗口触发鼠标事件执行回调函数的逻辑闭环。

1.2 环境搭建与库安装

实现OpenCV鼠标事件仅需依赖OpenCV库和NumPy库(用于图像数据处理),安装命令如下:

Plain Text# 安装OpenCV(核心库,支持鼠标事件与图像处理)pip install opencv-python# 安装NumPy(可选,用于图像数组处理)pip install numpy

二、核心机制:回调函数与事件绑定

OpenCV鼠标事件的核心是回调函数定义+窗口事件绑定,需严格遵循回调函数的参数规范,确保事件触发时能正确接收并处理相关信息。

2.1 回调函数定义规范

回调函数的参数列表由OpenCV固定定义,不可随意修改,参数含义如下:

Plain Textdef mouse_callback(event, x, y, flags, param):"""OpenCV鼠标事件回调函数:param event: 鼠标事件类型(如左键点击、双击等):param x: 鼠标在图像中的x坐标(水平方向,以图像左上角为原点):param y: 鼠标在图像中的y坐标(垂直方向,以图像左上角为原点):param flags: 鼠标按键状态辅助标识(如按键按下时是否同时移动鼠标):param param: 传入的额外参数(通过cv2.setMouseCallback()的param参数传递)"""# 函数体:根据event和flags实现具体逻辑pass

event:核心参数,标识触发的鼠标事件类型(如cv2.EVENT_LBUTTONDOWN表示左键按下);

x, y:鼠标在图像上的坐标,需注意OpenCV图像坐标体系以图像左上角为原点,与屏幕坐标一致;

flags:辅助参数,标识鼠标操作的附加状态(如cv2.EVENT_FLAG_SHIFTKEY表示触发事件时Shift键被按下);

param:自定义参数,可通过cv2.setMouseCallback()传递额外数据(如图像对象、绘制状态变量等)。

2.2 事件绑定函数:cv2.setMouseCallback()

该函数用于将回调函数与指定窗口绑定,使窗口具备响应鼠标事件的能力,函数格式如下:

Plain Textcv2.setMouseCallback(windowName, onMouse, param=None)""":param windowName: 窗口名称(需与cv2.imshow()创建的窗口名称一致):param onMouse: 自定义回调函数名称(无需加括号):param param: 传递给回调函数的额外参数(可选,默认None)"""

2.3 关键注意事项

窗口必须先通过cv2.namedWindow()cv2.imshow()创建,再绑定鼠标事件,否则绑定无效;

回调函数与窗口是一对一绑定关系,不同窗口需分别绑定回调函数(可绑定同一个或不同回调函数);

需通过cv2.waitKey()保持窗口显示并监听事件(无此函数窗口会闪退,无法触发鼠标事件);

若需在回调函数中修改外部变量(如绘制状态、坐标值),需将变量声明为全局变量,或通过param参数传递(推荐后者,避免全局变量冲突)。

三、常用鼠标事件类型与标识

OpenCV预定义了多种鼠标事件,通过特定标识(常量)区分,以下是最常用的事件类型及对应含义:

事件标识

事件含义

cv2.EVENT_LBUTTONDOWN

鼠标左键按下

cv2.EVENT_LBUTTONUP

鼠标左键抬起

cv2.EVENT_LBUTTONDBLCLK

鼠标左键双击

cv2.EVENT_RBUTTONDOWN

鼠标右键按下

cv2.EVENT_RBUTTONUP

鼠标右键抬起

cv2.EVENT_RBUTTONDBLCLK

鼠标右键双击

cv2.EVENT_MBUTTONDOWN

鼠标中键按下

cv2.EVENT_MBUTTONUP

鼠标中键抬起

cv2.EVENT_MOUSEMOVE

鼠标移动(只要鼠标在窗口内移动就会触发)

cv2.EVENT_MOUSEWHEEL

鼠标滚轮滚动(正数表示向前滚动,负数表示向后滚动)

常用辅助状态标识(flags参数):

cv2.EVENT_FLAG_SHIFTKEY:触发鼠标事件时,Shift键被按下(值为16);

cv2.EVENT_FLAG_CTRLKEY:触发鼠标事件时,Ctrl键被按下(值为32);

cv2.EVENT_FLAG_ALTKEY:触发鼠标事件时,Alt键被按下(值为64)。

四、实战代码示例:常用鼠标事件场景

以下通过4个核心场景的代码示例,详细说明鼠标事件的实现逻辑,所有示例均可直接运行,只需替换图像路径即可。

4.1 场景1:鼠标点击获取像素坐标与颜色

功能:鼠标左键点击图像任意位置,获取该点的坐标(x,y)及BGR颜色值(OpenCV默认色彩空间),并在控制台打印;右键点击退出程序。

Plain Textimport cv2import numpy as npdef get_pixel_info(event, x, y, flags, param):"""回调函数:获取像素坐标与颜色"""# 接收传入的图像参数(通过param传递)img = param# 鼠标左键按下事件if event == cv2.EVENT_LBUTTONDOWN:# 获取像素颜色值(BGR格式)b, g, r = img[y, x] # 注意:OpenCV图像数组索引为[行,列],对应(y,x)# 打印信息print(f"像素坐标:(x={x}, y={y})")print(f"像素颜色(BGR):B={b}, G={g}, R={r}")# 可选:在点击位置绘制一个红色小圆点标记cv2.circle(img, (x, y), 2, (0, 0, 255), -1) # 半径2px,红色填充cv2.imshow("Pixel Info Window", img)# 鼠标右键按下事件(退出程序)elif event == cv2.EVENT_RBUTTONDOWN:cv2.destroyAllWindows()exit()if __name__ == "__main__":# 读取图像(替换为自己的图像路径)img_path = "test_image.jpg"img = cv2.imread(img_path)if img is None:raise FileNotFoundError(f"未找到图像文件:{img_path}")# 创建窗口并绑定回调函数(将图像作为param参数传递)cv2.namedWindow("Pixel Info Window", cv2.WINDOW_NORMAL) # WINDOW_NORMAL支持窗口缩放cv2.setMouseCallback("Pixel Info Window", get_pixel_info, param=img)# 显示图像并监听事件(0表示无限等待按键)cv2.imshow("Pixel Info Window", img)cv2.waitKey(0)# 释放资源cv2.destroyAllWindows()

4.2 场景2:鼠标拖动绘制矩形(目标框选)

功能:鼠标左键按下确定矩形左上角顶点,拖动鼠标至目标位置后抬起,绘制矩形框;按下Shift键拖动可绘制正方形(宽高比1:1);按ESC键清除所有矩形。

Plain Textimport cv2import numpy as npclass DrawRectangle:"""封装矩形绘制逻辑,避免全局变量"""def __init__(self, img):self.img = img.copy() # 原始图像(用于重置)self.temp_img = img.copy() # 临时图像(用于绘制过程中的预览)self.is_drawing = False # 绘制状态:是否正在拖动鼠标self.start_x, self.start_y = -1, -1 # 矩形左上角坐标def mouse_callback(self, event, x, y, flags, param):# 鼠标左键按下:确定矩形左上角顶点if event == cv2.EVENT_LBUTTONDOWN:self.is_drawing = Trueself.start_x, self.start_y = x, y# 鼠标移动:绘制矩形预览(实时更新)elif event == cv2.EVENT_MOUSEMOVE and self.is_drawing:# 每次移动都重置临时图像为原始图像,避免残留多个矩形self.temp_img = self.img.copy()# 判断是否按下Shift键(绘制正方形)if flags & cv2.EVENT_FLAG_SHIFTKEY:# 正方形:宽高相等,取x、y方向偏移量的最小值side_len = max(abs(x - self.start_x), abs(y - self.start_y))end_x = self.start_x + side_len if x > self.start_x else self.start_x - side_lenend_y = self.start_y + side_len if y > self.start_y else self.start_y - side_lencv2.rectangle(self.temp_img, (self.start_x, self.start_y), (end_x, end_y), (0, 255, 0), 2)else:# 普通矩形:直接用当前坐标作为右下角顶点cv2.rectangle(self.temp_img, (self.start_x, self.start_y), (x, y), (0, 255, 0), 2)cv2.imshow("Draw Rectangle Window", self.temp_img)# 鼠标左键抬起:确定矩形右下角顶点,完成绘制elif event == cv2.EVENT_LBUTTONUP:self.is_drawing = False# 绘制最终矩形(绘制在原始图像上,永久保留)cv2.rectangle(self.img, (self.start_x, self.start_y), (x, y), (0, 255, 0), 2)self.temp_img = self.img.copy()cv2.imshow("Draw Rectangle Window", self.temp_img)if __name__ == "__main__":# 读取图像或创建空白图像img_path = "test_image.jpg"if cv2.os.path.exists(img_path):img = cv2.imread(img_path)else:# 无图像时创建800x600的白色空白图像img = np.ones((600, 800, 3), dtype=np.uint8) * 255# 初始化绘制类drawer = DrawRectangle(img)# 创建窗口并绑定回调函数cv2.namedWindow("Draw Rectangle Window", cv2.WINDOW_NORMAL)cv2.setMouseCallback("Draw Rectangle Window", drawer.mouse_callback)# 显示图像并监听按键(ESC键清除矩形)cv2.imshow("Draw Rectangle Window", img)while True:key = cv2.waitKey(1) & 0xFFif key == 27: # ESC键ASCII码为27# 重置图像(清除所有矩形)drawer.img = np.ones((600, 800, 3), dtype=np.uint8) * 255 if not cv2.os.path.exists(img_path) else cv2.imread(img_path)drawer.temp_img = drawer.img.copy()cv2.imshow("Draw Rectangle Window", drawer.img)elif key == ord('q'): # 按Q键退出break# 保存最终图像(可选)cv2.imwrite("drawn_rectangle.jpg", drawer.img)cv2.destroyAllWindows()

4.3 场景3:鼠标绘制自由曲线(涂鸦功能)

功能:鼠标左键按下并拖动时绘制自由曲线,右键点击切换曲线颜色(红绿蓝循环),按ESC键清空画布。

Plain Textimport cv2import numpy as npdef draw_free_curve(event, x, y, flags, param):"""回调函数:绘制自由曲线"""# 接收传入的状态参数(字典形式,包含图像、绘制状态、颜色)state = paramimg = state["img"]is_drawing = state["is_drawing"]color = state["color"]last_x, last_y = state["last_x"], state["last_y"]# 鼠标左键按下:开始绘制if event == cv2.EVENT_LBUTTONDOWN:state["is_drawing"] = Truestate["last_x"], state["last_y"] = x, y# 鼠标移动且左键按下:绘制曲线(连接上一个点和当前点)elif event == cv2.EVENT_MOUSEMOVE and is_drawing:cv2.line(img, (last_x, last_y), (x, y), color, 3) # 线宽3pxstate["last_x"], state["last_y"] = x, ycv2.imshow("Free Curve Window", img)# 鼠标左键抬起:结束绘制elif event == cv2.EVENT_LBUTTONUP:state["is_drawing"] = False# 鼠标右键按下:切换曲线颜色(红→绿→蓝)elif event == cv2.EVENT_RBUTTONDOWN:# 颜色切换逻辑if color == (0, 0, 255): # 当前红色,切换为绿色state["color"] = (0, 255, 0)elif color == (0, 255, 0): # 当前绿色,切换为蓝色state["color"] = (255, 0, 0)else: # 当前蓝色,切换为红色state["color"] = (0, 0, 255)print(f"曲线颜色已切换为:{state['color']}(BGR)")if __name__ == "__main__":# 创建800x600的白色空白画布img = np.ones((600, 800, 3), dtype=np.uint8) * 255# 定义状态参数(用字典传递,实现多变量共享)state = {"img": img,"is_drawing": False,"color": (0, 0, 255), # 初始颜色:红色(BGR)"last_x": -1,"last_y": -1}# 创建窗口并绑定回调函数cv2.namedWindow("Free Curve Window", cv2.WINDOW_NORMAL)cv2.setMouseCallback("Free Curve Window", draw_free_curve, param=state)# 显示画布并监听按键cv2.imshow("Free Curve Window", img)while True:key = cv2.waitKey(1) & 0xFFif key == 27: # ESC键清空画布state["img"] = np.ones((600, 800, 3), dtype=np.uint8) * 255cv2.imshow("Free Curve Window", state["img"])elif key == ord('s'): # 按S键保存画布cv2.imwrite("free_curve_drawing.jpg", state["img"])print("画布已保存为:free_curve_drawing.jpg")elif key == ord('q'): # 按Q键退出breakcv2.destroyAllWindows()

4.4 场景4:鼠标滚轮缩放图像

功能:鼠标滚轮向前滚动放大图像,向后滚动缩小图像,缩放中心为鼠标当前位置;按ESC键退出。

Plain Textimport cv2import numpy as npclass ImageZoom:"""封装图像缩放逻辑"""def __init__(self, img):self.img = img.copy() # 原始图像self.zoom_scale = 1.0 # 初始缩放比例(1.0为原尺寸)self.zoom_step = 0.1 # 每次滚轮滚动的缩放步长self.max_scale = 3.0 # 最大缩放比例self.min_scale = 0.5 # 最小缩放比例def mouse_callback(self, event, x, y, flags, param):# 鼠标滚轮滚动事件if event == cv2.EVENT_MOUSEWHEEL:# 获取滚轮滚动方向(delta>0向前滚动,放大;delta<0向后滚动,缩小)delta = cv2.getMouseWheelDelta(flags)if delta > 0:# 放大图像self.zoom_scale = min(self.zoom_scale + self.zoom_step, self.max_scale)else:# 缩小图像self.zoom_scale = max(self.zoom_scale - self.zoom_step, self.min_scale)# 计算缩放后的图像尺寸h, w = self.img.shape[:2]new_h = int(h * self.zoom_scale)new_w = int(w * self.zoom_scale)# 缩放图像(使用cv2.INTER_LINEAR插值,兼顾速度与质量)zoomed_img = cv2.resize(self.img, (new_w, new_h), interpolation=cv2.INTER_LINEAR)# 显示缩放后的图像cv2.imshow("Image Zoom Window", zoomed_img)print(f"当前缩放比例:{self.zoom_scale:.1f}x")if __name__ == "__main__":# 读取图像img_path = "test_image.jpg"img = cv2.imread(img_path)if img is None:raise FileNotFoundError(f"未找到图像文件:{img_path}")# 初始化缩放类zoomer = ImageZoom(img)# 创建窗口并绑定回调函数cv2.namedWindow("Image Zoom Window", cv2.WINDOW_NORMAL)cv2.setMouseCallback("Image Zoom Window", zoomer.mouse_callback)# 显示原始图像cv2.imshow("Image Zoom Window", img)print("提示:鼠标滚轮向前/向后滚动可放大/缩小图像,按Q键退出")# 监听按键(按Q键退出)while True:if cv2.waitKey(1) & 0xFF == ord('q'):breakcv2.destroyAllWindows()

五、进阶应用:鼠标事件与其他功能结合

鼠标事件常与色彩转换、目标检测、图像分割等功能结合,实现更复杂的交互式任务,以下是2个典型进阶场景的思路与简化代码。

5.1 场景:鼠标框选目标并进行色彩转换

功能:鼠标拖动框选目标区域,松开左键后将选区内的图像从BGR转为灰度图(其他区域保持彩色)。

Plain Textimport cv2import numpy as npdef select_and_convert(event, x, y, flags, param):state = paramimg = state["img"]temp_img = state["temp_img"]is_selecting = state["is_selecting"]start_x, start_y = state["start_x"], state["start_y"]if event == cv2.EVENT_LBUTTONDOWN:state["is_selecting"] = Truestate["start_x"], state["start_y"] = x, yelif event == cv2.EVENT_MOUSEMOVE and is_selecting:state["temp_img"] = img.copy()cv2.rectangle(temp_img, (start_x, start_y), (x, y), (0, 255, 0), 2)cv2.imshow("Select and Convert Window", temp_img)elif event == cv2.EVENT_LBUTTONUP:state["is_selecting"] = False# 确保坐标顺序正确(左上角<右下角)x1 = min(start_x, x)y1 = min(start_y, y)x2 = max(start_x, x)y2 = max(start_y, y)# 提取选区内的图像并转为灰度图roi = img[y1:y2, x1:x2] # 选区内的BGR图像roi_gray = cv2.cvtColor(roi, cv2.COLOR_BGR2GRAY)# 将灰度图转为3通道(与原始图像通道数一致),再替换回原始图像roi_gray_3ch = cv2.cvtColor(roi_gray, cv2.COLOR_GRAY2BGR)img[y1:y2, x1:x2] = roi_gray_3chstate["temp_img"] = img.copy()cv2.imshow("Select and Convert Window", temp_img)if __name__ == "__main__":img = cv2.imread("test_image.jpg")if img is None:raise FileNotFoundError("未找到图像文件")state = {"img": img.copy(),"temp_img": img.copy(),"is_selecting": False,"start_x": -1,"start_y": -1}cv2.namedWindow("Select and Convert Window", cv2.WINDOW_NORMAL)cv2.setMouseCallback("Select and Convert Window", select_and_convert, param=state)cv2.imshow("Select and Convert Window", img)cv2.waitKey(0)cv2.imwrite("selected_converted.jpg", state["img"])cv2.destroyAllWindows()

5.2 场景:鼠标点击标注目标并保存坐标

功能:鼠标左键点击图像中的目标(如人脸、物体),在点击位置绘制标记点,并记录目标坐标,最后将所有标注坐标保存到txt文件。

Plain Textimport cv2import numpy as npdef mark_target(event, x, y, flags, param):state = paramimg = state["img"]targets = state["targets"]if event == cv2.EVENT_LBUTTONDOWN:# 绘制红色标记点(圆形)cv2.circle(img, (x, y), 3, (0, 0, 255), -1)# 绘制目标编号cv2.putText(img, f"Target {len(targets)+1}", (x+5, y-5), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 1)# 记录坐标targets.append((x, y))print(f"标注目标{len(targets)}:(x={x}, y={y})")cv2.imshow("Mark Target Window", img)elif event == cv2.EVENT_RBUTTONDOWN:# 右键点击保存标注坐标with open("target_coordinates.txt", "w") as f:for i, (tx, ty) in enumerate(targets, 1):f.write(f"Target {i}: x={tx}, y={ty}\n")print("标注坐标已保存到:target_coordinates.txt")if __name__ == "__main__":img = cv2.imread("test_image.jpg")if img is None:raise FileNotFoundError("未找到图像文件")state = {"img": img.copy(),"targets": [] # 存储目标坐标的列表}cv2.namedWindow("Mark Target Window", cv2.WINDOW_NORMAL)cv2.setMouseCallback("Mark Target Window", mark_target, param=state)print("提示:左键点击标注目标,右键点击保存坐标,按Q键退出")cv2.imshow("Mark Target Window", img)while True:if cv2.waitKey(1) & 0xFF == ord('q'):breakcv2.destroyAllWindows()

六、常见问题与解决办法

鼠标事件无法触发

原因1:未调用cv2.waitKey()或调用位置错误(需在cv2.imshow()之后);

原因2:窗口名称与cv2.setMouseCallback()中的窗口名称不一致;

解决:确保cv2.waitKey()cv2.imshow()之后,且窗口名称完全匹配。

绘制图形出现残留/拖影

原因:直接在原始图像上绘制预览,未使用临时图像重置;

解决:创建原始图像的副本作为临时图像,每次绘制预览前先重置临时图像,最终绘制再作用于原始图像(参考鼠标拖动绘制矩形示例)。

坐标获取错误(图像显示与实际坐标不匹配)

原因1:混淆了图像数组索引([y,x])与鼠标坐标(x,y);

原因2:窗口被缩放后,鼠标坐标是缩放后的窗口坐标,而非原始图像坐标;

解决:1. 访问图像像素时使用img[y,x]2. 若窗口缩放,需根据缩放比例将窗口坐标转换为原始图像坐标。

回调函数中修改外部变量无效

原因:未将变量声明为全局变量,或未通过param参数传递;

解决:推荐使用param参数传递变量(如字典、类实例),避免全局变量冲突(参考自由曲线绘制示例)。

鼠标滚轮事件无响应

原因:OpenCV版本过低(部分旧版本不支持cv2.EVENT_MOUSEWHEEL);

解决:升级OpenCV版本(pip install --upgrade opencv-python)。

总结:Python OpenCV鼠标事件的核心是回调函数+窗口绑定,需熟练掌握常用事件类型、回调函数参数规范及绘制逻辑。实际开发中,可根据需求封装状态变量(避免全局变量),结合图像绘制、色彩转换、目标检测等功能实现交互式任务。通过本文档的理论讲解与多场景代码示例,可快速上手鼠标事件的开发,解决常见问题,为构建交互式图像处理应用奠定基础。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 19:44:58 HTTP/2.0 GET : https://f.mffb.com.cn/a/462505.html
  2. 运行时间 : 0.351858s [ 吞吐率:2.84req/s ] 内存消耗:4,678.73kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=ccda06040f8ffdb28fc56d129f917082
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000404s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000513s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.025725s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000888s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000600s ]
  6. SELECT * FROM `set` [ RunTime:0.000319s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000785s ]
  8. SELECT * FROM `article` WHERE `id` = 462505 LIMIT 1 [ RunTime:0.092907s ]
  9. UPDATE `article` SET `lasttime` = 1770551098 WHERE `id` = 462505 [ RunTime:0.015008s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.002037s ]
  11. SELECT * FROM `article` WHERE `id` < 462505 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.010828s ]
  12. SELECT * FROM `article` WHERE `id` > 462505 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.006327s ]
  13. SELECT * FROM `article` WHERE `id` < 462505 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.077509s ]
  14. SELECT * FROM `article` WHERE `id` < 462505 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.015911s ]
  15. SELECT * FROM `article` WHERE `id` < 462505 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.033996s ]
0.353534s