EV74 시각적 프런트엔드 노드
Neat은 EV74 시각적 프런트엔드 그래프를 일반 Graph 노드로 노출합니다. 공개 노드 팩토리와 옵션 구조체를 사용하고, 애플리케이션 코드에서 processcvu, ConfigManager 또는 디스패처 API를 직접 호출하지 마십시오.
| 노드 팩토리 | 그래프 이름 | 그래프 ID | 목적 |
|---|---|---|---|
nodes::FeatureHistogram / pyneat.nodes.feature_histogram | feature_histogram | 235 | 흑백 이미지 히스토그램 |
nodes::GriderFast / pyneat.nodes.grider_fast | grider_fast | 236 | 그리드 방식으로 분산된 FAST 특징 |
nodes::TrackDescriptor / pyneat.nodes.track_descriptor | track_descriptor | 237 | FAST 특징과 디스크립터 |
nodes::TrackKLT / pyneat.nodes.track_klt | track_klt | 238 | 피라미드 KLT 추적, 선택적으로 감지된 대체 특징 포함 |
nodes::MetoakDepth | simor_depth_map | 20 | I420 및 시차에서 RGB, 미터법 깊이, XYZ 생성 |
그래프 ID는 문제 진단 및 펌웨어/패키지 일치 확인에 유용합니다. 애플리케이션 코드에서는 필수가 아닙니다.
텐서 계약
특징 및 추적 텐서는 논리적 배치 형태를 사용합니다. batch_size == B인 경우, 흑백 이미지는 [B,H,W]이고, [B*H,W]는 아닙니다. 런타임은 모든 EV74 전송 패킹을 내부적으로 처리합니다.
| 노드 | 입력 | 공개 출력 |
|---|---|---|
FeatureHistogram | input_image: UInt8 [B,H,W] | output_hist: Int32 [B,256] |
GriderFast | input_image: UInt8 [B,H,W] | output_features: Int32 [B,1 + max_features*3] |
TrackDescriptor | input_image: UInt8 [B,H,W] | output_features: Int32 [B,1 + max_features*3]; output_descriptors: Int32 [B,max_features,8] |
TrackKLT | prev_image: UInt8 [B,H,W]; cur_image: UInt8 [B,H,W]; input_points: Int32 [B,num_points,2] | output_points: Float32 [B,num_points,2]; output_status: Int32 [B,num_points,1]; 그리고 output_features: Int32 [B,1 + max_features*3] (단, detect_new_features != 0인 경우에만) |
특성 목록 텐서는 이 배치별 레이아웃을 사용합니다.
[count, x0, y0, score0, x1, y1, score1, ...]
현재 디스크립터 그래프는 descriptor_words == 8을 필요로 합니다. 이를 변경하는 것은 EV74 ABI 변경 사항이며, 배포 전에 거부됩니다.
C++ 빠른 시작
#include <neat.h>
#include <cstdint>
#include <vector>
using namespace simaai::neat;
Tensor make_gray_batch(int width, int height, int batch) {
std::vector<std::uint8_t> pixels(static_cast<std::size_t>(width) * height * batch);
// Fill pixels in batch-major order: b*height*width + y*width + x.
auto tensor = Tensor::from_vector(pixels, {batch, height, width}, TensorMemory::EV74);
tensor.layout = TensorLayout::HW;
tensor.axis_semantics = {TensorAxisSemantic::N, TensorAxisSemantic::H, TensorAxisSemantic::W};
tensor.route.name = "input_image";
tensor.route.segment_name = "input_image";
return tensor;
}
int main() {
constexpr int width = 320;
constexpr int height = 240;
constexpr int batch = 2;
Graph graph;
InputOptions input;
input.payload_type = PayloadType::Tensor;
input.format = FormatTag::UINT8;
input.width = width;
input.height = height;
input.depth = 1;
input.max_width = width;
input.max_height = height * batch; // transport capacity; public tensor remains [B,H,W]
input.max_depth = 1;
input.memory_policy = InputMemoryPolicy::Ev74;
input.buffer_name = "input_image";
graph.add(nodes::Input(input));
GriderFastOptions fast;
fast.width = width;
fast.height = height;
fast.batch_size = batch;
fast.max_features = 64;
fast.threshold = 30;
graph.add(nodes::GriderFast(fast));
graph.add(nodes::Output());
RunOptions run_opt;
run_opt.output_memory = OutputMemory::Owned;
Tensor image = make_gray_batch(width, height, batch);
Run run = graph.build({image}, run_opt);
TensorList outputs = run.run({image}, /*timeout_ms=*/30000);
run.close();
}
세 개의 입력값을 받는 KLT
TrackKLT는 텐서 세트(이전 이미지, 현재 이미지 및 입력 포인트)를 사용합니다. 옵션 필드와 일치하도록 경로 이름을 지정하십시오.
TrackKLTOptions klt;
klt.width = 320;
klt.height = 240;
klt.batch_size = 2;
klt.num_points = 32;
klt.max_features = 64;
klt.detect_new_features = 1; // publish output_features as the third output
graph.add(nodes::TrackKLT(klt));
detect_new_features == 1 실행 시 예상되는 공개 출력:
output_points Float32 [2,32,2]
output_status Int32 [2,32,1]
output_features Int32 [2,193]
detect_new_features == 0가 활성화되면, Neat은 output_points와 output_status만 게시하며, EV에서 보이는 기능 버퍼는 내부 런타임 할당 상태로 유지됩니다.