RealSense SR300采集手势图片区域

本文介绍了使用RealSense SR300摄像头采集手势图像的过程,包括初始化、数据提取和opencv处理。在数据采集时,通过AcquireFrame(true)获取lock数据,然后使用release操作解锁。通过将数据转换为Mat对象,可以进一步保存和转换图像。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

=======================

  1. RealSense重要的头文件和类列表:
#include<pxcsensemanager.h>
#include<pxchandconfiguration.h>
#include<pxchandmodule.h>
#include<pxchanddata.h>
#include<iostream>
#include<fstream>
#include<string>
#include<Windows.h>
#include"opencvHeader.h"
#include"imageLoad.h"
#include"clipImage.h"
using namespace Intel::RealSense;
using namespace Intel::RealSense::Hand;

PXCSession *g_session;
PXCSenseManager *g_senseManager;
PXCHandModule *g_handModule;
PXCHandConfiguration *g_handConfiguration;
PXCHandData *g_handOutput;

2.生成各种类对象,并测试返回值是否正常。

pxcStatus InitRealSense()
{
    std::printf("Tip: Run HandsConsole.exe -help for additional parameters\n");
    g_session = PXCSession::CreateInstance();

    if (!g_session)
    {
        std::printf("Failed Creating PXCSession");

    }

    g_senseManager = g_session->CreateSenseManager();
    if (!g_senseManager)
    {
        releaseAll();
        std::printf("Failed creating senseManager\n");
        //return 1;

    }


    if (g_senseManager->EnableHand(0) != pxcStatus::STATUS_NO_ERROR)
    {
        releaseAll();
        std::printf("Failed Enabling the hand Module");
        //return;
    }

    g_handModule = g_senseManager->QueryHand();
    if (!g_handModule)
    {
        releaseAll();
        std::printf("Failed Creating PXCHandModule\n");
        //return;
    }

    g_handOutput = g_handModule->CreateOutput();
    if (!g_handOutput)
    {
        release
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值