Closed ewwll closed 3 years ago
set like this:
StartFragment-->NativeKinectDevice = k4a::device::open(DeviceId);
// Start the Camera and make sure the Depth Camera is Enabled
k4a_device_configuration_t deviceConfig = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL; deviceConfig.depth_mode = DepthMode;
deviceConfig.color_resolution = K4A_COLOR_RESOLUTION_1080P;
deviceConfig.color_format = K4A_IMAGE_FORMAT_COLOR_BGRA32;
deviceConfig.wired_sync_mode = k4a_wired_sync_mode_t::K4A_WIRED_SYNC_MODE_STANDALONE; deviceConfig.synchronized_images_only = true;
//Read Image like this:
//Color
AzureColorImage = sensorCapture.get_color_image();
//Depth
AzureDepthImgae = sensorCapture.get_depth_image();
Hello, when I use Azure kinect, I can’t open the depth camera but I can open the normal rgb camera. Why is this? and my code error: [ error ] : find_libusb_device(). Unable to find Container ID: {27425d48-b481-4111-a593-a89e9f44d4ca} [ error ] : usb_cmd_create(USB_DEVICE_COLOR_IMU_PROCESSOR, NULL_INDEX, container_id, &colormcu->usb_cmd) returned failure in colormcu_create() [ error ] : colormcu_create(container_id, &device->colormcu) returned failure in k4a_device_open() and my code: //#pragma comment(lib, "k4a.lib")
include
include <k4a/k4a.h>
include <k4arecord/record.h>
include <k4arecord/playback.h>
include < iostream>
include
include <opencv2/core/core.hpp>
include <opencv2\opencv.hpp>
include <opencv2/highgui/highgui.hpp>
include <k4a/k4a.hpp>
include < cstdlib>
include<opencv2/highgui.hpp>
include<opencv2/imgproc/imgproc.hpp>
include<core/core.hpp>
include
include
using namespace cv; using namespace std; int n = 0; string cname = "./rgb/color"; string dname = "./depth/depth";
cv::Mat color_frame; cv::Mat depth_frame;
void on_mouse(int event, int x, int y, int flags, void* ustc) { if (event == EVENT_LBUTTONDOWN) { cout <<"111"<< endl; Mat img1, img2; resize(color_frame, img1, Size(512, 512)); resize(depth_frame, img2, Size(512, 512)); imwrite(cname + to_string(n) + ".jpg", img1); imwrite(dname + to_string(n) + ".jpg", img2); n++; } }
int main() { k4a::capture capture; const uint32_t device_count = k4a::device::get_installed_count(); if (device_count == 0) { printf("No K4A devices found\n"); return 0; }
} But I use Azure Kinect ordinary rgb camera to read the video but there is no problem my code:
include <opencv2\opencv.hpp>
using namespace cv; int main() {
}