// 第一帧处理
    if (is_first_frame || path == 1)
    {
      rockx_hand_landmark_t hand_landmark; // 移到循环内部，并去掉memset操作
      rockx_keypoints_array_t hand_array;  // 移到循环内部，并去掉memset操作

      // hand detection
      ret = rockx_hand_detect(hand_det_handle, &input_image, &hand_array);
      if (ret != ROCKX_RET_SUCCESS)
      {
        printf("rockx_hand_detect error %d\n", ret);
        continue;
      }

      for (int i = 0; i < hand_array.count; i++)
      {
        if (hand_array.keypoints[i].box_score > 0.7f && hand_array.keypoints[i].count > 0) // 添加关键点数量检查
        {
          int left = hand_array.keypoints[i].box.left;
          int top = hand_array.keypoints[i].box.top;
          int right = hand_array.keypoints[i].box.right;
          int bottom = hand_array.keypoints[i].box.bottom;

          inbox.count = hand_array.keypoints[i].count;

          for (int j = 0; j < hand_array.keypoints[i].count; j++)
          {
            inbox.points[j].x = hand_array.keypoints[i].points[j].x;
            inbox.points[j].y = hand_array.keypoints[i].points[j].y;
            inbox.points[j].z = hand_array.keypoints[i].points[j].z;

            cv::Scalar black_color(0, 0, 0);                                                                                            // 黑色
            cv::circle(frame, cv::Point(static_cast<int>(inbox.points[j].x), static_cast<int>(inbox.points[j].y)), 5, black_color, -1); // 绘制黑色圆圈
          }
          inbox.box = hand_array.keypoints[i].box;
          cv::Scalar black_color(0, 0, 0);                                                                                              // 黑色
          cv::rectangle(frame, cv::Point(inbox.box.left, inbox.box.top), cv::Point(inbox.box.right, inbox.box.bottom), black_color, 2); // 绘制黑色框

          // 调用手部关键点检测函数
          ret = rockx_hand_landmark(hand_landmark_handle, &input_image, &inbox, &hand_landmark);
          if (ret != ROCKX_RET_SUCCESS)
          {
            printf("rockx_hand_landmark error %d\n", ret);
            return -1;
          }

          std::cout << "hand_landmark.score1: " << hand_landmark.score << std::endl;

          all_hand_landmarks_map[i] = hand_landmark; // 使用索引 i 存储手部关键点信息

          if (hand_landmark.score > 0.5f)
          {
            cv::Scalar blue_color(255, 0, 0); // 蓝色

            for (int j = 0; j < inbox.count; j++)
            {
              int mapped_index = mapping_indices[j];
              float x_diff = hand_landmark.landmarks[mapped_index].x - inbox.points[j].x;
              float y_diff = hand_landmark.landmarks[mapped_index].y - inbox.points[j].y;
              offset_matrix(j, mapped_index) = x_diff;
              offset_matrix(j + 7, mapped_index) = y_diff;
            }

            for (int j = 0; j < hand_landmark.landmarks_count; j++)
            {
              float x_raw = hand_landmark.landmarks[j].x;
              float y_raw = hand_landmark.landmarks[j].y;
              cv::circle(frame, cv::Point(static_cast<int>(x_raw), static_cast<int>(y_raw)), 5, blue_color, -1);
            }
          }
          all_offset_matrices[i] = offset_matrix; // 存储对应的 offset_matrix
        }
      }

      is_first_frame = false;
      path = 2;
    }
    else
    {
      int index = 0;
      for (auto it = all_hand_landmarks_map.begin(); it != all_hand_landmarks_map.end(); ++it)
      {

        new_inbox.count = 7;        // 设置关键点数量为与上一帧相同
        int hand_index = it->first; // 获取当前手部的索引

        float min_x = std::numeric_limits<float>::max();
        float min_y = std::numeric_limits<float>::max();
        float max_x = std::numeric_limits<float>::min();
        float max_y = std::numeric_limits<float>::min();

        std::cout << "min_x: " << min_x << std::endl;
        std::cout << "min_y: " << min_y << std::endl;

        for (int j = 0; j < new_inbox.count; j++)
        {
          int mapped_index = mapping_indices[j];
          new_inbox.points[j].x = it->second.landmarks[mapped_index].x - all_offset_matrices[hand_index](j, mapped_index);
          new_inbox.points[j].y = it->second.landmarks[mapped_index].y - all_offset_matrices[hand_index](j + 7, mapped_index);

          min_x = std::min(min_x, new_inbox.points[j].x);
          min_y = std::min(min_y, new_inbox.points[j].y);
          max_x = std::max(max_x, new_inbox.points[j].x);
          max_y = std::max(max_y, new_inbox.points[j].y);
        }

        new_inbox.box.left = static_cast<int>(min_x);
        new_inbox.box.top = static_cast<int>(min_y);
        new_inbox.box.right = static_cast<int>(max_x);
        new_inbox.box.bottom = static_cast<int>(max_y);

        std::cout << "new_inbox.box.left: " << new_inbox.box.left << std::endl;
        std::cout << "new_inbox.box.top: " << new_inbox.box.top << std::endl;
        std::cout << "new_inbox.box.right: " << new_inbox.box.right << std::endl;
        std::cout << "new_inbox.box.bottom: " << new_inbox.box.bottom << std::endl;

        cv::Scalar green_color(0, 255, 0); // 绿色
        cv::rectangle(frame, cv::Point(new_inbox.box.left, new_inbox.box.top), cv::Point(new_inbox.box.right, new_inbox.box.bottom), green_color, 2);

        for (int j = 0; j < new_inbox.count; j++)
        {
          float x_raw = new_inbox.points[j].x;
          float y_raw = new_inbox.points[j].y;
          cv::circle(frame, cv::Point(static_cast<int>(x_raw), static_cast<int>(y_raw)), 5, green_color, -1);
        }

        rockx_hand_landmark_t hand_landmark_temp;
        memset(&hand_landmark_temp, 0, sizeof(rockx_hand_landmark_t));                                  // 创建局部变量
        ret = rockx_hand_landmark(hand_landmark_handle, &input_image, &new_inbox, &hand_landmark_temp); // 使用局部变量
        if (ret != ROCKX_RET_SUCCESS)
        {
          printf("rockx_hand_landmark error %d\n", ret);
          return -1;
        }

        for (int j = 0; j < new_inbox.count; j++)
        {
          int mapped_index = mapping_indices[j];

          offset_matrix(j, mapped_index) = hand_landmark_temp.landmarks[mapped_index].x - new_inbox.points[j].x;
          offset_matrix(j + 7, mapped_index) = hand_landmark_temp.landmarks[mapped_index].y - new_inbox.points[j].y;
        }
        all_offset_matrices[hand_index] = offset_matrix;

        if (hand_landmark_temp.score > 0.5f) // 使用局部变量的score
        {
          cv::Scalar red_color(0, 0, 255); // 红色

          for (int j = 0; j < hand_landmark_temp.landmarks_count; j++) // 使用局部变量的landmarks_count
          {
            float x_raw = hand_landmark_temp.landmarks[j].x; // 使用局部变量的landmarks
            float y_raw = hand_landmark_temp.landmarks[j].y;
            cv::circle(frame, cv::Point(static_cast<int>(x_raw), static_cast<int>(y_raw)), 5, red_color, -1);
          }
        }

        std::cout << "hand_landmark_temp.score3: " << hand_landmark_temp.score << std::endl;

        all_hand_landmarks_map[index] = hand_landmark_temp; // 更新map的值

        if (it->second.score < 0.5f)
        {
          is_first_frame = true;
        }
        index++;
      }
    }以上代码有什么问题