ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    libvoxl-cutils camera_image_metadata.h

    Ask your questions right here!
    2
    2
    18
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      KnightHawk
      last edited by

      Hello,

      I'm looking for a specific header so that I can access the camera data in my custom driver but I do not see it in https://gitlab.com/voxl-public/voxl-sdk/core-libs/libvoxl-cutils. Where can I find camera_image_metadata.h? Thanks.

      // ---------------- Save Camera Feed (if enabled) -----------------
      if (camera_pipe_fd != -1 && FD_ISSET(camera_pipe_fd, &rfds)) {
          camera_image_metadata_t meta;
          ssize_t ret = read(camera_pipe_fd, &meta, sizeof(meta));
          if (ret == sizeof(meta)) {
              if (img_buffer.size() < meta.size) {
                  img_buffer.resize(meta.size);
              }
              ret = read(camera_pipe_fd, img_buffer.data(), meta.size);
              if (ret == (ssize_t)meta.size) {
                  cv::Mat image(meta.height * 3 / 2, meta.width, CV_8UC1, img_buffer.data());
      
                  char filename[128];
                  snprintf(filename, sizeof(filename), "/data/img_%s_%lld.jpg", TARGET_CAMERA_NAME.c_str(), (long long)meta.timestamp_ns);
                  cv::imwrite(filename, image);
              }
          }
      }
      
      Alex KushleyevA 1 Reply Last reply Reply Quote 0
      • Alex KushleyevA
        Alex Kushleyev ModalAI Team @KnightHawk
        last edited by

        @KnightHawk , the definition is in libmodal-pipe library.

        https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/blob/master/library/include/modal_pipe_interfaces.h?ref_type=heads#L202

        Alex

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB | Contributors