Python code for creation of an average image from the multiple facial heat maps
收藏资源简介:
- File "dr_nauber_mean_heat_map_add_on.py" : a Python script (add-on) specifically designed to run within Blender's environment. Python is Blender's scripting language, enabling custom functionalities like this one, which processes heat map images, calculates their average, and integrates the result into Blender's 3D interface. - File "step_by_step_add-on.mp4": screen-recorded video tutorial demonstrating the installation and usage of the add-on (from Step 4 in the instructions below). Instructions: Step 1: Download and Install Blender 2.9. It´s advisable to use the OrtogOnBlender installer, since it contains all the libraries necessary to run the add-on. Windows: https://www.ciceromoraes.com.br/doc/pt_br/OrtogOnBlender/Instalacao_Windows.html Mac OS: https://www.ciceromoraes.com.br/doc/pt_br/OrtogOnBlender/Instalacao_MacOSX.html Linux: https://www.ciceromoraes.com.br/doc/pt_br/OrtogOnBlender/Instalacao_Linux.html Step 2: Obtain the Add-on File 1. Download the file "dr_nauber_mean_heat_map_add_on.py" provided by in this repository. 2. Save this file in a known location, such as your Desktop or Downloads folder. Step 3: Install the Add-on in Blender 1. Open Blender . 2. Go to Edit > Preferences from the top menu. 3. In the Preferences window, click on Add-ons in the left sidebar. 4. Click Install… in the top-right corner. 5. Navigate to the location where you saved the "dr_nauber_mean_heat_map_add_on.py" file. Select the file and click Install Add-on . 6. After installation, find the add-on in the list (search for "Mean Heat Map" if needed). 7. Check the box next to the add-on name to enable it. If necessary, click Save Preferences to make it permanent. Step 4: Set Up Your Images Directory 1. Prepare a folder containing all the heat map images you want to process. - Ensure the images are in a supported format (e.g., `.png` or `.jpg`). - Keep all images in the same resolution for the best results (or the add-on will resize them automatically). Step 5: Use the Add-on 1. In Blender, ensure you're in the 3D Viewport workspace. 2. Locate the "Mean Heat Map" panel: - Press `N` to open the right-hand toolbar in the 3D Viewport. - Click on the Image Processor tab. 3. In the panel: - Paste the folder path from Step 4 into the Directory Path field. - Click the Process Images button. Step 6: Generate the Mean Image 1. The add-on will: - Calculate the average of all the images in the folder. - Save the result as `average_image.png` in the same folder. 2. A message box will confirm the success and the location of the saved image. Step 7: View the Average Image in Blender 1. The add-on automatically creates a plane in the Blender scene, applying the average image as a texture. 2. Press `1` on the numpad to view the plane from the front. 3. Use the mouse scroll wheel to zoom in or out as needed. The resulting image is saved as "average_image.png" in the same folder.
### 文件说明 - `dr_nauber_mean_heat_map_add_on.py`:一款专为Blender运行环境开发的Python脚本附加组件。Python作为Blender的原生脚本语言,支持实现各类自定义功能,本插件可对热图图像进行处理、计算其平均值,并将计算结果集成至Blender的3D界面中。 - `step_by_step_add-on.mp4`:一段屏幕录制视频教程,演示了该附加组件的安装与使用方法(对应下述操作指南的第4步及后续流程)。 ### 操作指南 步骤1:下载并安装Blender 2.9。推荐使用OrtogOnBlender安装程序,该程序包含运行本附加组件所需的全部依赖库。 - Windows系统:https://www.ciceromoraes.com.br/doc/pt_br/OrtogOnBlender/Instalacao_Windows.html - Mac OS系统:https://www.ciceromoraes.com.br/doc/pt_br/OrtogOnBlender/Instalacao_MacOSX.html - Linux系统:https://www.ciceromoraes.com.br/doc/pt_br/OrtogOnBlender/Instalacao_Linux.html 步骤2:获取附加组件文件 1. 下载本仓库中提供的`dr_nauber_mean_heat_map_add_on.py`文件。 2. 将该文件保存至易查找的位置,例如桌面或下载文件夹。 步骤3:在Blender中安装附加组件 1. 打开Blender软件。 2. 从顶部菜单栏进入「编辑 > 偏好设置」。 3. 在偏好设置窗口中,点击左侧侧边栏的「附加组件」选项。 4. 点击右上角的「安装…」按钮。 5. 导航至此前保存`dr_nauber_mean_heat_map_add_on.py`文件的路径,选中该文件后点击「安装附加组件」。 6. 安装完成后,在组件列表中找到本附加组件(如需可搜索“Mean Heat Map”)。 7. 勾选附加组件名称旁的复选框以启用它,若需永久保留设置,可点击「保存偏好设置」。 步骤4:设置图像目录 1. 准备一个包含所有待处理热图图像的文件夹。 - 确保图像采用支持的格式(例如`.png`或`.jpg`)。 - 为获得最佳效果,请将所有图像保持相同分辨率(若分辨率不一致,插件将自动调整图像尺寸)。 步骤5:使用附加组件 1. 在Blender中确保处于「3D视图」工作区。 2. 找到「Mean Heat Map」面板: - 按下`N`键以打开3D视图的右侧工具栏。 - 点击「图像处理器」选项卡。 3. 在该面板中: - 将步骤4中准备的文件夹路径粘贴至「目录路径」输入框中。 - 点击「处理图像」按钮。 步骤6:生成平均图像 1. 本附加组件将执行以下操作: - 计算文件夹内所有图像的平均值。 - 将计算结果保存为`average_image.png`,存储至该文件夹中。 2. 系统将弹出消息框,提示处理成功以及保存文件的具体路径。 步骤7:在Blender中查看平均图像 1. 本附加组件将自动在Blender场景中创建一个平面,并将平均图像作为纹理应用至该平面上。 2. 按下数字小键盘的`1`键,以从正前方视角查看该平面。 3. 根据需要使用鼠标滚轮进行缩放。 最终结果将以`average_image.png`为名保存至该文件夹中。



