{"id":18656539,"url":"https://github.com/uinika/raspberrypi-opencv-patch","last_synced_at":"2026-04-26T20:31:57.504Z","repository":{"id":115220364,"uuid":"247240868","full_name":"uinika/RaspberryPi-OpenCV-Patch","owner":"uinika","description":"Missing .i \u0026 .h file during installation of OpenCV on Raspberry Pi 4B.","archived":false,"fork":false,"pushed_at":"2020-03-14T19:57:55.000Z","size":1615,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T14:44:32.043Z","etag":null,"topics":["opencv","raspberry-pi-4"],"latest_commit_sha":null,"homepage":"https://uinika.gitee.io/embedded/RaspberryPi.html","language":"SWIG","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uinika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-14T08:38:49.000Z","updated_at":"2023-12-27T11:16:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3661fbea-fecd-4e35-b723-28fced065f59","html_url":"https://github.com/uinika/RaspberryPi-OpenCV-Patch","commit_stats":null,"previous_names":["uinika/raspberrypi-opencv-patch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinika%2FRaspberryPi-OpenCV-Patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinika%2FRaspberryPi-OpenCV-Patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinika%2FRaspberryPi-OpenCV-Patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinika%2FRaspberryPi-OpenCV-Patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uinika","download_url":"https://codeload.github.com/uinika/RaspberryPi-OpenCV-Patch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239472047,"owners_count":19644430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opencv","raspberry-pi-4"],"created_at":"2024-11-07T07:23:55.236Z","updated_at":"2025-11-05T21:30:21.684Z","avatar_url":"https://github.com/uinika.png","language":"SWIG","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raspberry-pi-opencv-patch\n\nMissing `.i` \u0026 `.h` file during installation of opencv on Raspberry Pi 4B.\n\n![](./logo.png)\n\n由于 Raspberry Pi 4B 上编译`opencv 3.4.9`以及`opencv_contrib-3.4.9`的依赖过程当中，由于国内网络屏蔽造成的部分`.i`文件无法正常下载，而在执行`sudo make install`命令时出现`~/opencv_contrib/modules/xfeatures2d/src/boostdesc.cpp:673:20: fatal error: boostdesc_bgm.i: No such file or directory`等一系列错误信息。\n\n## Problem\n\n通过打开`/home/pi/Downloads/opencv/build`目录（即源码编译后的二进制文件所在目录）下的`CMakeDownloadLog.txt`日志文件，搜索如下缺失的`.i`文件名称：\n\n```\nboostdesc_bgm.i\nboostdesc_lbgm.i\nboostdesc_bgm_bi.i\nboostdesc_bgm_hd.i\n\nboostdesc_binboost_064.i\nboostdesc_binboost_128.i\nboostdesc_binboost_256.i\n\nvgg_generated_48.i\nvgg_generated_64.i\nvgg_generated_80.i\nvgg_generated_120.i\n```\n\n## Solution\n\n找到对应的下载地址，完成下载后将其拷贝至`/home/pi/Downloads/opencv_contrib-3.4.9/modules/xfeatures2d/src`目录下面，重新执行`sudo make install`即可解决报错问题。\n\n\u003e **注意**：上述`.i`依赖文件已经全部放入本项目根目录下，适用于`opencv 3.4.9`和`opencv_contrib-3.4.9`版本的编译。\n\n## Appendix\n\n对于在执行`sudo make install`命令过程当中，出现的无法找到`cuda.hpp`、`xfeatures2d.hpp`、`nonfree.hpp`头文件的情况，只需要用文件查找命令，查询到该文件的所在位置：\n\n```\nfind -name \"xxx.hpp\"\n```\n\n然后将头文件所在的`/home/...`路径名，添加至报错的`.cpp`源代码文件的`#include`预包含指令里面，即可以解决问题。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuinika%2Fraspberrypi-opencv-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuinika%2Fraspberrypi-opencv-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuinika%2Fraspberrypi-opencv-patch/lists"}