当前位置: 首页 > news >正文

FreiHAND (handposeX-json 格式)数据集-release >> DataBall

FreiHAND (handposeX-json 格式)数据集-release

注意:

1)为了方便使用,按照 handposeX json 自定义格式存储

2)使用常见依赖库进行调用,降低数据集使用难度。

3)部分数据集获取请加入:DataBall-X数据球(free)

4)完整数据集获取请加入:DataBall-X数据球(vip)

FreiHAND 数据集官方项目地址:https://github.com/lmb-freiburg/freihand

handposeX-json 格式 项目地址:GitHub - XIAN-HHappy/handpose_x_plus

---------------

一、handposeX json 格式示例

cx,cy,fx,fy为相机内参。

label:左右手标签

joint3d:三维手部21关键点

vertex3d:三维手mesh网格点

{"author": "XIAN","img_name:": "","cx": 112.0,"cy": 112.0,"fx": 388.9018310596544,"fy": 388.71231836584275,"hands": [{"label": "right","joint3d": [[29.402047395706177,-27.920207008719444,587.0807766914368],······],"vertex3d": [[10.056010007858276,29.915300235152245,-626.9440693855286],······]}]}

---------------

二、脚本运行

cd script/FreiHANDpython read_handposex_json.py

read_handposex_json.py具体实现如下,简洁明了:

#-*-coding:utf-8-*-
# date:2024-02-23
# Author: XIAN
# function: handposeX json 格式读取数据标签
import sys
sys.path.append("./")
import os
import cv2
import json
import numpy as np
import random
'''
function: 绘制二维关键点连线
'''
def draw_joints(img_,hand_,x,y):thick = 2colors = [(0,215,255),(255,115,55),(5,255,55),(25,15,255),(225,15,55)]#cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['1']['x']+x), int(hand_['1']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['1']['x']+x), int(hand_['1']['y']+y)),(int(hand_['2']['x']+x), int(hand_['2']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['2']['x']+x), int(hand_['2']['y']+y)),(int(hand_['3']['x']+x), int(hand_['3']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['3']['x']+x), int(hand_['3']['y']+y)),(int(hand_['4']['x']+x), int(hand_['4']['y']+y)), colors[0], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['5']['x']+x), int(hand_['5']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['5']['x']+x), int(hand_['5']['y']+y)),(int(hand_['6']['x']+x), int(hand_['6']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['6']['x']+x), int(hand_['6']['y']+y)),(int(hand_['7']['x']+x), int(hand_['7']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['7']['x']+x), int(hand_['7']['y']+y)),(int(hand_['8']['x']+x), int(hand_['8']['y']+y)), colors[1], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['9']['x']+x), int(hand_['9']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['9']['x']+x), int(hand_['9']['y']+y)),(int(hand_['10']['x']+x), int(hand_['10']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['10']['x']+x), int(hand_['10']['y']+y)),(int(hand_['11']['x']+x), int(hand_['11']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['11']['x']+x), int(hand_['11']['y']+y)),(int(hand_['12']['x']+x), int(hand_['12']['y']+y)), colors[2], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['13']['x']+x), int(hand_['13']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['13']['x']+x), int(hand_['13']['y']+y)),(int(hand_['14']['x']+x), int(hand_['14']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['14']['x']+x), int(hand_['14']['y']+y)),(int(hand_['15']['x']+x), int(hand_['15']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['15']['x']+x), int(hand_['15']['y']+y)),(int(hand_['16']['x']+x), int(hand_['16']['y']+y)), colors[3], thick)cv2.line(img_, (int(hand_['0']['x']+x), int(hand_['0']['y']+y)),(int(hand_['17']['x']+x), int(hand_['17']['y']+y)), colors[4], thick)cv2.line(img_, (int(hand_['17']['x']+x), int(hand_['17']['y']+y)),(int(hand_['18']['x']+x), int(hand_['18']['y']+y)), colors[4], thick)cv2.line(img_, (int(hand_['18']['x']+x), int(hand_['18']['y']+y)),(int(hand_['19']['x']+x), int(hand_['19']['y']+y)), colors[4], thick)cv2.line(img_, (int(hand_['19']['x']+x), int(hand_['19']['y']+y)),(int(hand_['20']['x']+x), int(hand_['20']['y']+y)), colors[4], thick)
'''
function: 21个三维关键点转为二维点,并进行绘制
'''
def Draw_KeyPoints3D(img,Joints_,fx,fy,cx,cy):#----------------------------------- 计算 3D到 2D相机的投影X = Joints_[:,0]Y = Joints_[:,1]Z = Joints_[:,2]x_p = X / Zy_p = Y / Z#三维点转为二维点x_2d = fx* x_p + cxy_2d = fy* y_p + cypts2d_list = {}pts2d_ss = []for ii in range(x_2d.shape[0]):x_,y_ = x_2d[ii],y_2d[ii]pts2d_list[str(ii)]={"x":x_,"y":y_}cv2.circle(img, (int(x_),int(y_)), 4, (25,155,255), -1)cv2.circle(img, (int(x_),int(y_)), 2, (255,0,55), -1)pts2d_ss.append((x_,y_))draw_joints(img,pts2d_list,0,0)pts2d_ss = np.array(pts2d_ss)return pts2d_ssdef Draw_Vertex_KeyPoints(img,img_mesh,Vertex,fx_d,fy_d,cx_d,cy_d,triangles_index,RGB_ = (245, 125, 35)):#----------------------------------- 计算 Mano 到 相机的投影Xdc = -Vertex[:,0].reshape(-1)Ydc = -Vertex[:,1].reshape(-1)Zdc = -Vertex[:,2].reshape(-1)x_mano_p = Xdc / Zdcy_mano_p = Ydc / Zdc#点云转为二维图x_mano = fx_d* x_mano_p + cx_dy_mano = fy_d* y_mano_p + cy_dmanopts_list = []mesh_list = []color_rr = (random.randint(100,230),random.randint(120,250),random.randint(100,240))for ii in range(triangles_index.shape[0]):a,b,c = triangles_index[ii]x1_,y1_ = x_mano[a].astype(np.int32),y_mano[a].astype(np.int32)x2_,y2_ = x_mano[b].astype(np.int32),y_mano[b].astype(np.int32)x3_,y3_ = x_mano[c].astype(np.int32),y_mano[c].astype(np.int32)area_ = np.array([[int(x1_), int(y1_)], [int(x2_), int(y2_)], [int(x3_),int(y3_)]])color_ = (255, 0, 0)# cv2.fillPoly(mask_v, [area_], (255))cv2.fillPoly(img_mesh, [area_], color_rr)mesh_list.append(area_)cv2.fillPoly(img, mesh_list, RGB_)
if __name__ == '__main__':path_root = "datasets/"path_s_image = "{}/image/".format(path_root)path_s_label = "{}/label/".format(path_root)triangles_index = np.load("../../config/triangles_index.npy").reshape(-1,3)out_cnt = 0hand_cnt = 0for f_ in os.listdir(path_s_image):path_img = path_s_image + f_path_json = path_s_label + f_.replace(".jpg",".json")with open(path_json, 'r', encoding='utf-8') as file:data_json = json.load(file)hands_json = data_json["hands"]cx,cy,fx,fy = data_json["cx"],data_json["cy"],data_json["fx"],data_json["fy"]img_ = cv2.imread(path_img)img_joint = img_.copy()img_mesh = img_.copy()img_mask = np.zeros(img_.shape).astype(np.uint8)img_mask[:,:,:]=255for msg_ in hands_json:RGB_ = (245, 55, 133)if msg_["label"] == "left":RGB_ = (25, 255, 133)Joints3D = np.array(msg_["joint3d"])Vertex3D = np.array(msg_["vertex3d"])pts2d_ss = Draw_KeyPoints3D(img_joint,Joints3D,fx,fy,cx,cy)Draw_Vertex_KeyPoints(img_mesh,img_mask,Vertex3D,fx,fy,cx,cy,triangles_index,RGB_ = RGB_)hand_cnt += 1stk_1 = np.hstack((img_,img_joint))stk_2 = np.hstack((img_mesh,img_mask))stk_ = np.vstack((stk_1,stk_2))cv2.namedWindow("img_stk",0)cv2.imshow("img_stk",stk_)out_cnt += 1print("--------->>>imgs_num : [{}] , hands_num: [{}]".format(out_cnt,hand_cnt))key_id = cv2.waitKey(0)cv2.imwrite("f1.jpg",stk_)if key_id == 27:break

助力快速掌握数据集的信息和使用方式。

数据可以如此美好!

相关文章:

FreiHAND (handposeX-json 格式)数据集-release >> DataBall

FreiHAND (handposeX-json 格式)数据集-release 注意: 1)为了方便使用,按照 handposeX json 自定义格式存储 2)使用常见依赖库进行调用,降低数据集使用难度。 3)部分数据集获取请加入:DataBall-X数据球(free) 4)完…...

【Rust中级教程】2.8. API设计原则之灵活性(flexible) Pt.4:显式析构函数的问题及3种解决方案

喜欢的话别忘了点赞、收藏加关注哦(加关注即可阅读全文),对接下来的教程有兴趣的可以关注专栏。谢谢喵!(・ω・) 说句题外话,这篇文章一共5721个字,是我截至目前写的最长的一篇文章&a…...

LabVIEW Browser.vi 库说明

browser.llb 库位于C:\Program Files (x86)\National Instruments\LabVIEW 2019\vi.lib\Platform目录,它是 LabVIEW 平台下用于与网络浏览器相关操作的重要库。该库为 LabVIEW 开发者提供了一系列工具,用于实现网页浏览控制、网页数据获取与交互等功能&a…...

promise的方法有哪些?【JavaScript】

Promise对象在JavaScript中是一种处理异步操作的方式,它提供了一组方法来管理和控制异步操作的结果。以下是一些常用的Promise方法: 以下是对 constructor(executor)‌、then(onFulfilled, onRejected)、catch(onRejected)‌、 finally(onFin…...

基于模仿学习(IL)的端到端自动驾驶发展路径

基于模仿学习(IL)的端到端自动驾驶发展路径 1. 核心论文解析 (1) UniAD:感知-规划一体化 核心思想:首次提出将感知任务(如目标检测、车道线识别、轨迹预测)与规划任务集成到统一的端到端框架中&#xff…...

第1篇:SOLR 简介与源码环境搭建

第1篇:SOLR 简介与源码环境搭建 1.1 SOLR 是什么? Apache SOLR 是一个基于 Apache Lucene 的高性能开源搜索平台。它不仅继承了 Lucene 强大的全文搜索能力,还通过封装和扩展,提供了企业级的功能,比如分布式搜索(SolrCloud)、RESTful API、动态 Schema 管理等。自 200…...

Docker 搭建 Redis 数据库

Docker 搭建 Redis 数据库 前言一、准备工作二、创建 Redis 容器的目录结构三、启动 Redis 容器1. 通过 redis.conf 配置文件设置密码2. 通过 Docker 命令中的 requirepass 参数设置密码 四、Host 网络模式与 Port 映射模式五、检查 Redis 容器状态六、访问 Redis 服务总结 前言…...

MySQL 连表查询:原理、语法与优化

目录 引言 什么是连表查询? 连表查询的类型 1. 内连接(INNER JOIN) 2. 左连接(LEFT JOIN) 3. 右连接(RIGHT JOIN) 4. 全连接(FULL JOIN) 5. 交叉连接(…...

实战技巧:如何快速提高网站收录的权威性?

快速提高网站收录的权威性是一个系统性的工作,涉及内容质量、网站结构、外部链接、用户体验等多个方面。以下是一些实战技巧,可以帮助你快速提升网站收录的权威性: 一、提升内容质量 原创性: 确保网站内容具备高质量与原创性&a…...

vue语法v-model例子单选题和多选题

<template><!-- 单选框 --><input type"radio" v-model"danxuan" value"a"><label for"a">a</label><input type"radio" v-model"danxuan" value"b"><label fo…...

计算机网络面试知识点总结

目录 1. 计算机网络的基本知识点2. OSI 七层模型3. TCP/IP 四层模型4. TCP 和 UDP4.1 TCP 协议4.2 TCP 流量控制4.3 TCP 拥塞控制4.4 TCP 三次握手4.5 TCP 四次挥手4.6 TCP 粘包问题4.7 TCP Socket交互流程4.8 UDP 协议以及和 TCP 协议的不同 5. HTTP协议5.1 HTTP 请求方法以及…...

JVM生产环境问题定位与解决实战(二):JConsole、VisualVM到MAT的高级应用

生产问题定位指南&#xff1a;几款必备的可视化工具 引言 在上一篇文章中&#xff0c;详细的介绍了JDK自带的一系列命令行工具&#xff0c;&#xff0c;如jps、jmap、jstat、jstack以及jcmd等&#xff0c;这些工具为排查和诊断Java虚拟机&#xff08;JVM&#xff09;问题提供…...

c++入门-------命名空间、缺省参数、函数重载

C系列 文章目录 C系列前言一、命名空间二、缺省参数2.1、缺省参数概念2.2、 缺省参数分类2.2.1、全缺省参数2.2.2、半缺省参数 2.3、缺省参数的特点 三、函数重载3.1、函数重载概念3.2、构成函数重载的条件3.2.1、参数类型不同3.2.2、参数个数不同3.2.3、参数类型顺序不同 前言…...

Lua语言入门(自用)

全局与非全局 在lua语言当中没有被local表示的是全局变量 反之则是本地变量(仅仅作用在某个文件,函数,或者代码块) 下面是实例代码和运行结果 --hello.luaA 10;--这样就是全局变量,然后这个编译器如果是大写就是默认的全局变量 local b 3;--这样就是局部变量--reference.…...

大数据开发平台的框架

根据你的需求&#xff0c;以下是从 GitHub 推荐的 10 个可以实现大数据开发平台的项目&#xff1a; 1. Apache Spark Apache Spark 是一个开源的分布式计算框架&#xff0c;适用于大规模数据处理和分析。它提供了强大的数据处理能力&#xff0c;支持实时数据处理、机器学习和…...

X86_64位下的GS寄存器

在 64 位模式下&#xff0c;段机制通常&#xff08;但不是完全&#xff09;被禁用&#xff0c;从而创建一个平坦的 64 位线性地址空间。处理器将 CS、DS、ES、SS 的段基地址视为零&#xff0c;从而创建一个与有效地址相等的线性地址。FS 和 GS 段是例外。这些段寄存器&#xff…...

#6【TIP2023】Dif-Fusion

📜 Dif-Fusion: Toward High Color Fidelity in Infrared and Visible Image Fusion With Diffusion Models 🍸 源码:https://github.com/GeoVectorMatrix/Dif-Fusion 🍺 前向扩散过程 前向过程看成是逐步加噪的Markov链,在每一个时间步 t t t ,...

科普:“git“与“github“

Git与GitHub的关系可以理解为&#xff1a;Git是一种软件工具&#xff0c;而GitHub则是一个在线平台&#xff0c;它们是“一家子”。二者的关联最直接体现在你通过Git在GitHub仓库中clone软件包到你的机器中来。 具体来说&#xff1a; 一、Git 定义&#xff1a;Git是一个开源的…...

unplugin-vue-components,unplugin-auto-import,借用ai去学习

好的&#xff0c;我现在需要帮助用户理解他们提供的这段Vite配置代码。用户之前已经询问过关于ElementPlusResolver的导入问题&#xff0c;现在他们展示了在vite.config.ts中使用该解析器的具体配置。我需要逐步分析这段代码&#xff0c;并解释每个部分的作用。 首先&#xff…...

蓝桥杯 2013 省 B 翻硬币

题目背景 小明正在玩一个“翻硬币”的游戏。 题目描述 桌上放着排成一排的若干硬币。我们用 * 表示正面&#xff0c;用 o 表示反面&#xff08;是小写字母&#xff0c;不是零&#xff09;&#xff0c;比如可能情形是 **oo***oooo&#xff0c;如果同时翻转左边的两个硬币&…...

XCTF-web-easyupload

试了试php&#xff0c;php7&#xff0c;pht&#xff0c;phtml等&#xff0c;都没有用 尝试.user.ini 抓包修改将.user.ini修改为jpg图片 在上传一个123.jpg 用蚁剑连接&#xff0c;得到flag...

树莓派超全系列教程文档--(61)树莓派摄像头高级使用方法

树莓派摄像头高级使用方法 配置通过调谐文件来调整相机行为 使用多个摄像头安装 libcam 和 rpicam-apps依赖关系开发包 文章来源&#xff1a; http://raspberry.dns8844.cn/documentation 原文网址 配置 大多数用例自动工作&#xff0c;无需更改相机配置。但是&#xff0c;一…...

边缘计算医疗风险自查APP开发方案

核心目标:在便携设备(智能手表/家用检测仪)部署轻量化疾病预测模型,实现低延迟、隐私安全的实时健康风险评估。 一、技术架构设计 #mermaid-svg-iuNaeeLK2YoFKfao {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg…...

376. Wiggle Subsequence

376. Wiggle Subsequence 代码 class Solution { public:int wiggleMaxLength(vector<int>& nums) {int n nums.size();int res 1;int prediff 0;int curdiff 0;for(int i 0;i < n-1;i){curdiff nums[i1] - nums[i];if( (prediff > 0 && curdif…...

江苏艾立泰跨国资源接力:废料变黄金的绿色供应链革命

在华东塑料包装行业面临限塑令深度调整的背景下&#xff0c;江苏艾立泰以一场跨国资源接力的创新实践&#xff0c;重新定义了绿色供应链的边界。 跨国回收网络&#xff1a;废料变黄金的全球棋局 艾立泰在欧洲、东南亚建立再生塑料回收点&#xff0c;将海外废弃包装箱通过标准…...

管理学院权限管理系统开发总结

文章目录 &#x1f393; 管理学院权限管理系统开发总结 - 现代化Web应用实践之路&#x1f4dd; 项目概述&#x1f3d7;️ 技术架构设计后端技术栈前端技术栈 &#x1f4a1; 核心功能特性1. 用户管理模块2. 权限管理系统3. 统计报表功能4. 用户体验优化 &#x1f5c4;️ 数据库设…...

虚拟电厂发展三大趋势:市场化、技术主导、车网互联

市场化&#xff1a;从政策驱动到多元盈利 政策全面赋能 2025年4月&#xff0c;国家发改委、能源局发布《关于加快推进虚拟电厂发展的指导意见》&#xff0c;首次明确虚拟电厂为“独立市场主体”&#xff0c;提出硬性目标&#xff1a;2027年全国调节能力≥2000万千瓦&#xff0…...

[免费]微信小程序问卷调查系统(SpringBoot后端+Vue管理端)【论文+源码+SQL脚本】

大家好&#xff0c;我是java1234_小锋老师&#xff0c;看到一个不错的微信小程序问卷调查系统(SpringBoot后端Vue管理端)【论文源码SQL脚本】&#xff0c;分享下哈。 项目视频演示 【免费】微信小程序问卷调查系统(SpringBoot后端Vue管理端) Java毕业设计_哔哩哔哩_bilibili 项…...

省略号和可变参数模板

本文主要介绍如何展开可变参数的参数包 1.C语言的va_list展开可变参数 #include <iostream> #include <cstdarg>void printNumbers(int count, ...) {// 声明va_list类型的变量va_list args;// 使用va_start将可变参数写入变量argsva_start(args, count);for (in…...

R 语言科研绘图第 55 期 --- 网络图-聚类

在发表科研论文的过程中&#xff0c;科研绘图是必不可少的&#xff0c;一张好看的图形会是文章很大的加分项。 为了便于使用&#xff0c;本系列文章介绍的所有绘图都已收录到了 sciRplot 项目中&#xff0c;获取方式&#xff1a; R 语言科研绘图模板 --- sciRplothttps://mp.…...