Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. General Questions
  3. libvoxl-cutils camera_image_metadata.h

libvoxl-cutils camera_image_metadata.h

Scheduled Pinned Locked Moved Unsolved General Questions
2 Posts 2 Posters 532 Views 1 Watching
  • 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 Offline
    K Offline
    KnightHawk
    wrote on last edited by
    #1

    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
    0
    • K KnightHawk

      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 Offline
      Alex KushleyevA Offline
      Alex Kushleyev
      ModalAI Team
      wrote on last edited by
      #2

      @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
      0

      Reading along? Create a free ModalAI Forum account to join in.

      With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.

      Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      ModalAI
      Categories Recent Tags ModalAI.com Docs
      © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups