# @8thwall/image-target-cli 中文文档

规范地址：https://npmcn.com/package/%408thwall/image-target-cli/

版本：1\.0\.0
npm 元数据更新时间：2026-04-07T22:49:11.850Z
中文译文更新时间：2026-11-06T02:31:21.328Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%408thwall/image-target-cli
原文对照：https://npmcn.com/package/%408thwall/image-target-cli/?lang=original
项目主页：https://8thwall.org/
源码仓库：https://github.com/8thwall/8thwall

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：45.6 kB，15 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- 运行依赖：1 个
- 首次发布：2026-03-03T22:54:28.318Z
- 最新版本发布：2026-03-03T23:40:26.868Z
- 近 30 天下载量：6301（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：5（近 12 个月 5 个）

## 中文简介

生成 第 8 个墙壁图像目标元数据

## 安装

```sh
npm install @8thwall/image-target-cli
```

也可以使用：`pnpm add @8thwall/image-target-cli`、`yarn add @8thwall/image-target-cli`、`bun add @8thwall/image-target-cli`

## README

# 图像目标CLI

此 CLI 工具允许创建图像目标 [离线引擎](https://8th.io/xrjs)。 。 。 .

## 使用量

```
npx @8thwall/image-target-cli@latest
```

将提示您输入图像路径, 选择裁剪, 并选择文件夹/ 图像目标名称 。 您可以使用默认的中心收成, 或者根据此图表选择收成尺寸 :

![Diagram showing an original image dimension of 2000x2000, then a crop being applied by offsetting the top left corner by the top and left parameters, and reducing the width and height of the crop using width and height parameters](https://npmcn.com/package/%408thwall/image-target-cli/docs/flat-diagram.jpg)

如果选择圆柱形几何,也会被激发出圆柱形和靶宽. 可见下图可视化. 单位的选择(mm vs 英寸)不会影响跟踪行为,因此测量也可以是无尺度的.

![3D Visualization showing two views of a cylinder with a label wrapped around the side. One view shows the entire top circle of the cylinder highlighted. The other view shows the top edge of the label highlighted, which is about one third of the full circumference](https://npmcn.com/package/%408thwall/image-target-cli/docs/cylinder-diagram.jpg)

对于圆锥形图像,更宽的上部和更宽的下部形状都得到了支持. 以下图像显示输入格式,标签会围绕一个大圆圈的形状曲折. 对于更宽的底部图像,标签的弧应该向相反的方向弯曲. 你会被催促到标签曲线的外半径和内半径。 您也会输入标签所覆盖的圆锥角. 如果选择自定义收成,则会以平地几何图像来收成,如下所示.

![Diagram showing a conical image target as it is processed. Initially the label is aligned to a section of a ring, with rounded top and bottom edges. The same label is shown flattened to a rectangle, with right angled sides. The flattened label displays a crop being applied by offsetting the top left corner by the top and left parameters, and reducing the width and height of the crop using width and height parameters.](https://npmcn.com/package/%408thwall/image-target-cli/docs/cone-diagram.jpg)

在生成时,将输出以下内容:

-   Json 文件内的元数据
-   原始图像
-   几何图像( 用于圆锥形)
-   已剪切图像
-   缩略图图像 (263x350)
-   光度图像(灰度,480x640)

生成的图像目标可以通过将此代码添加到您的工程中来加载到引擎中:

```
const onxrloaded = () => {
  XR8.XrController.configure({
    imageTargetData: [
      require('../image-targets/target1.json'),
      require('../image-targets/target2.json'),
    ],
  })
}
window.XR8 ? onxrloaded() : window.addEventListener('xrloaded', onxrloaded)
```

这个 `imagePath` json 数据的字段将告诉引擎装入跟踪图像的位置 它的特性将被提取出来,并与相机的种子进行比较.

## 常见问题

### @8thwall/image-target-cli 是什么？

生成 第 8 个墙壁图像目标元数据

### 如何安装 @8thwall/image-target-cli？

在项目目录运行 npm install @8thwall/image-target-cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 image-target-cli，可以用 npx image-target-cli 直接运行。

### @8thwall/image-target-cli 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/8thwall\_\_image-target-cli 是否存在。

### @8thwall/image-target-cli 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @8thwall/image-target-cli 可以商用吗？

@8thwall/image-target-cli 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @8thwall/image-target-cli 的下载量有多少？

根据 npm 官方下载统计，@8thwall/image-target-cli 在 2026/10/05 – 2026/11/03 这 30 天内被下载 6,301 次，日均约 210 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @8thwall/image-target-cli 还在维护吗？

最新版本 1\.0\.0 发布于 2026/03/04（8 个月前）；至今共发布 5 个版本，其中过去 12 个月发布了 5 个；首次发布于 2026/03/04。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

