MindSpore数据集mindspore::dataset
ResizeBilinear
#include <image_process.h>
bool ResizeBilinear(LiteMat &src, LiteMat &dst, int dst_w, int dst_h)
通过双线性算法调整图像大小,当前仅支持的数据类型为uint8,当前支持的通道为3和1。
• 参数
o src: 输入的图片数据。
o dst: 输出的图片数据。
o dst_w: 输出图片数据的宽度。
o dst_h: 输出图片数据的高度。
• 返回值
执行成功返回true,否则不满足条件返回false。
InitFromPixel
#include <image_process.h>
bool InitFromPixel(const unsigned char *data, LPixelType pixel_type, LDataType data_type, int w, int h, LiteMat &m)
从像素初始化LiteMat,提供数据为RGB或者BGR格式,不用进行格式转换,当前支持的转换是RGB_TO_BGR、RGBA_To_RGB、RGBA_To_BGR、NV21_To_BGR和NV12_To_BGR。
• 参数
o data: 输入的数据。
o pixel_type: 像素点的类型。
o data_type: 数据的类型。
o w: 输出数据的宽度。
o h: 输出数据的高度。
o mat: 用于存储图像数据。
• 返回值
初始化成功返回true,否则返回false。
ConvertTo
#include <image_process.h>
bool ConvertTo(LiteMat &src, LiteMat &dst, double scale = 1.0)
转换数据类型,当前支持的转换是将uint8转换为float。
• 参数
o src: 输入的图片数据。
o dst: 输出图像数据。
o scale: 对像素做尺度(默认值为1.0)。
• 返回值
转换数据类型成功返回true,否则返回false。
Crop
#include <image_process.h>
bool Crop(LiteMat &src, LiteMat &dst, int x, int y, int w, int h)
裁剪图像,通道支持为3和1。
• 参数
o src: 输入的图片数据。
o dst: 输出图像数据。
o x: 屏幕截图起点的x坐标值。
o y: 屏幕截图起点的y坐标值。
o w: 截图的宽度。
o h: 截图的高度。
• 返回值
裁剪图像成功返回true,否则返回false。
SubStractMeanNormalize
#include <image_process.h>
bool SubStractMeanNormalize(const LiteMat &src, LiteMat &dst, const std::vector &mean, const std::vector &std)
归一化图像,当前支持的数据类型为float。
• 参数
o src: 输入的图片数据。
o dst: 输出图像数据。
o mean: 数据集的均值。
o std: 数据集的方差。
• 返回值
归一化成功返回true,否则返回false。
Pad
#include <image_process.h>
bool Pad(const LiteMat &src, LiteMat &dst, int top, int bottom, int left, int right, PaddBorderType pad_type, uint8_t fill_b_or_gray, uint8_t fill_g, uint8_t fill_r)
填充图像,通道支持为3和1。
• 参数
o src: 输入的图片数据。
o dst: 输出图像数据。
o top: 图片顶部长度。
o bottom: 图片底部长度。
o left: 图片左边长度。
o right: 图片右边长度。
o pad_type: padding的类型。
o fill_b_or_gray: R或者GRAY。
o fill_g: G。
o fill_r: R。
• 返回值
填充图像成功返回true,否则返回false。
ExtractChannel
#include <image_process.h>
bool ExtractChannel(const LiteMat &src, LiteMat &dst, int col)
按索引提取图像通道。
• 参数
o src: 输入的图片数据。
o col: 通道的序号。
• 返回值
提取图像通道成功返回true,否则返回false。
Split
#include <image_process.h>
bool Split(const LiteMat &src, std::vector &mv)
将图像通道拆分为单通道。
• 参数
o src: 输入的图片数据。
o mv: 单个通道数据。
• 返回值
图像通道拆分成功返回true,否则返回false。
Merge
#include <image_process.h>
bool Merge(const std::vector &mv, LiteMat &dst)
用几个单通道阵列创建一个多通道图像。
• 参数
o mv: 单个通道数据。
o dst: 输出图像数据。
• 返回值
创建多通道图像成功返回true,否则返回false。
Affine
#include <image_process.h>
void Affine(LiteMat &src, LiteMat &out_img, double M[6], std::vector<size_t> dsize, UINT8_C1 borderValue)
对1通道图像应用仿射变换。
• 参数
o src: 输入图片数据。
o out_img: 输出图片数据。
o M[6]: 仿射变换矩阵。
o dsize: 输出图像的大小。
o borderValue: 采图之后用于填充的像素值。
void Affine(LiteMat &src, LiteMat &out_img, double M[6], std::vector<size_t> dsize, UINT8_C3 borderValue)
#include <image_process.h>
对3通道图像应用仿射变换。
• 参数
o src: 输入图片数据。
o out_img: 输出图片数据。
o M[6]: 仿射变换矩阵。
o dsize: 输出图像的大小。
o borderValue: 采图之后用于填充的像素值。
GetDefaultBoxes
#include <image_process.h>
std::vector<std::vector> GetDefaultBoxes(BoxesConfig config)
获取Faster R-CNN,SSD,YOLO等的默认框。
• 参数
o config: BoxesConfig结构体对象。
• 返回值
返回默认框。
ConvertBoxes
#include <image_process.h>
void ConvertBoxes(std::vector<std::vector> &boxes, std::vector<std::vector> &default_boxes, BoxesConfig config)
将预测框转换为(y,x,h,w)的实际框。
• 参数
o boxes: 实际框的大小。
o default_boxes: 默认框。
o config: BoxesConfig结构体对象。
ApplyNms
#include <image_process.h>
std::vector ApplyNms(std::vector<std::vector> &all_boxes, std::vector &all_scores, float thres, int max_boxes)
对实际框的非极大值抑制。
• 参数
o all_boxes: 所有输入的框。
o all_scores: 通过网络执行后所有框的得分。
o thres: IOU的预值。
o max_boxes: 输出框的最大值。
• 返回值
返回框的id。
LiteMat
#include <lite_mat.h>
LiteMat是一个处理图像的类。
构造函数和析构函数
LiteMat
LiteMat()

LiteMat(int width, LDataType data_type = LDataType::UINT8)

LiteMat(int width, int height, LDataType data_type = LDataType::UINT8)

LiteMat(int width, int height, int channel, LDataType data_type = LDataType::UINT8)
MindSpore中dataset模块下LiteMat的构造方法,使用参数的默认值。
~LiteMat
~LiteMat()
MindSpore dataset LiteMat的析构函数。
公有成员函数
Init
void Init(int width, LDataType data_type = LDataType::UINT8)

void Init(int width, int height, LDataType data_type = LDataType::UINT8)

void Init(int width, int height, int channel, LDataType data_type = LDataType::UINT8)
该函数用于初始化图像的通道,宽度和高度,参数不同。
IsEmpty
bool IsEmpty() const
确定对象是否为空的函数。
• 返回值
返回true或者false。
Release
void Release()
释放内存的函数。
公有属性
data_ptr_
data_ptr_
pointer类型,表示存放图像数据的地址。
elem_size_
elem_size_
int类型,表示元素的字节数。
width_
width_
int类型,表示图像的宽度。
height_
height_
int类型,表示图像的高度。
channel_
channel_
int类型,表示图像的通道数。
c_step_
c_step_
int类型,表示经过对齐后的图像宽高之积。
dims_
dims_
int类型,表示图像的维数。
size_
size_
size_t类型,表示图像占用内存的大小。
data_type_
data_type_
LDataType类型,表示图像的数据类型。
ref_count_
ref_count_
pointer类型,表示引用计数器的地址。
Subtract
#include <lite_mat.h>
bool Subtract(const LiteMat &src_a, const LiteMat &src_b, LiteMat *dst)
计算每个元素的两个图像之间的差异。
• 参数
o src_a: 输入的图像a的数据。
o src_b: 输入的图像b的数据。
o dst: 输出图像的数据。
• 返回值
满足条件的计算返回true,否则返回false。
Divide
#include <lite_mat.h>
bool Divide(const LiteMat &src_a, const LiteMat &src_b, LiteMat *dst)
计算每个元素在两个图像之间的划分。
• 参数
o src_a: 输入的图像a的数据。
o src_b: 输入的图像b的数据。
o dst: 输出图像的数据。
• 返回值
满足条件的计算返回true,否则返回false。
Multiply
#include <lite_mat.h>
bool Multiply(const LiteMat &src_a, const LiteMat &src_b, LiteMat *dst)
计算每个元素在两个图像之间的相乘值。
• 参数
o src_a: 输入的图像a的数据。
o src_b: 输入的图像b的数据。
o dst: 输出图像的数据。
• 返回值
满足条件的计算返回true,否则返回false。

MindSpore数据集mindspore::dataset相关推荐

  1. MindSpore张量mindspore::tensor

    MindSpore张量mindspore::tensor MSTensor #include <ms_tensor.h> MSTensor定义了MindSpore Lite中的张量. 构造 ...

  2. MindSpore接口mindspore::api

    MindSpore接口mindspore::api Context #include <context.h> Context类用于保存执行中的环境变量. 静态公有成员函数 Instance ...

  3. moore 数据集_警报数据集(alarm dataset)_机器学习_科研数据集

    警报数据集 (alarm dataset) 数据摘要: The following datasets were used in Moore and Wong (2003), Optimal Reins ...

  4. 关于 ECharts4 新增的数据集(dataset)

    ECharts 4 开始有了 `数据集`(`dataset`)组件来单独声明数据,大概长这个样子: option = {dataset: {// 提供一份数据.source: [['product', ...

  5. MindSpore数据集加载-GeneratorDataset数据处理报错:The pointer[cnode] is null

    MindSpore可以自定义Python数据源,通过迭代该数据源构造数据集.有点类似PyTorch的DataLoader. 相关的API可以参考:mindspore.dataset.Generator ...

  6. 【mindspore】mindspore实现手写数字识别

    mindspore实现手写数字识别 具体流程参考教程:MindSpore快速入门 MindSpore 接口文档 注:本文章记录的是我在开发过程中的学习笔记,仅供参考学习,欢迎讨论,但不作为开发教程使用 ...

  7. 【mindspore】mindspore脚本迁移经历

    mindspore脚本迁移经历 使用mindspore进行脚本迁移经历 00.题记 01.开干 前期 中期 后期 02.总结 使用mindspore进行脚本迁移经历 00.题记    自2021年开年 ...

  8. MindSpore:[Gradoperation]mindspore复合函数求导

    问题描述: [功能模块] mindspore.ops.GradOperation [操作步骤&问题现象] 我想实现如下所示的一个函数 可是在华为的官方实现中,只有mindspore.ops.G ...

  9. 全景(360 度相机)图像数据集 3D60 Dataset 下载步骤 (详细)

    3D60 Dataset 下载步骤 (详细) 3D60 Dataset 是研究全景相机.360度相机必不可少的数据集. 目录 3D60 Dataset 下载步骤 (详细) 数据集简介 数据集下载方法 ...

最新文章

  1. python解压gz_使用python请求下载压缩tar.gz文件并使用tar解压它
  2. python获取动态数据采集仪代理_Python3爬虫技术文档(3)——动态页面数据采集,三,获取...
  3. 关于Java在Linux or Android平台调用.so库
  4. can not open file Permission denied at securecrt_linux_crack.pl line 57
  5. 六角填数---第五届蓝桥杯
  6. C# Redis实战(二)
  7. Java中对象和引用的理解
  8. 一行Python代码就可以下载任意网站视频,零基础小白也能轻松学会
  9. 工作笔记-新系统安装deb文件失败
  10. barbuttonitem 文字换行_ios开发 常用代码整理
  11. shipyard安装
  12. 【BZOJ】【3301】【USACO2011 Feb】Cow Line
  13. 120万名 GoDaddy 客户数据遭泄露
  14. Hierarchical deformation of Locally Rigid Meshes
  15. 每日一句20191126
  16. Unity一个默认占用C盘空间的小坑
  17. 全面解析JavaScript中对于字符串子串的查询方法
  18. SyntaxError :invalid syntax错误解决办法
  19. 介绍一款web端的截图工具
  20. infoQ推荐算法综述笔记

热门文章

  1. mysql并发更新数据,多用户并发修改数据解决方案。
  2. 大数据学习01——配置虚拟机节点相关网络
  3. 2022-2028年中国抽油烟机行业投资分析及前景预测报告
  4. 2022-2028年中国内衣用热熔胶膜行业发展现状调查及市场分析预测报告
  5. 【牛腩新闻发布系统】开始前端03
  6. Brat序列标注工具小结
  7. NNVM Compiler,AI框架的开放式编译器
  8. 编译器设计-有限自动机
  9. 匹配算法:局部结构保留
  10. 快速人体姿态估计:CVPR2019论文阅读