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

高端建站收费标准网络营销模式下品牌推广研究

高端建站收费标准,网络营销模式下品牌推广研究,网站模板更换,制作一个手机app软件.dat文件的命名规则没有统一的规定,但通常以.dat为扩展名。 目录 一、 .dat格式数据1.1 .dat数据用途1.2 常见的.dat文件格式1.3 .dat文件示例 二、读取.dat格式数据2.1 单个.dat文件读取并转换2.1.1 代码2.1.2 查看数据2.1.3 输出查看8Bit图片 2.2 批量.dat文件读取…

.dat文件的命名规则没有统一的规定,但通常以.dat为扩展名。

目录

  • 一、 .dat格式数据
    • 1.1 .dat数据用途
    • 1.2 常见的.dat文件格式
    • 1.3 .dat文件示例
  • 二、读取.dat格式数据
    • 2.1 单个.dat文件读取并转换
      • 2.1.1 代码
      • 2.1.2 查看数据
      • 2.1.3 输出查看8Bit图片
    • 2.2 批量.dat文件读取并转换
      • 2.2.1 代码参数修改
      • 2.2.2 代码
      • 2.2.3 批量转换结果
  • 三、总结

一、 .dat格式数据

.dat格式数据是一种通用的二进制文件格式,可以用于存储各种类型的数据。.dat文件的格式可以是任意的,因此需要根据数据的具体格式来编写代码来读取数据。

1.1 .dat数据用途

存储文本数据,例如用户配置信息或日志数据。

存储二进制数据,例如图像数据或音频数据。

存储结构化数据,例如数据库表格。

1.2 常见的.dat文件格式

文本格式:数据以字符串的形式存储。

二进制格式:数据以二进制数据的形式存储。

结构化格式:数据以结构化的形式存储。

注:如果不确定.dat文件的格式,您以尝试使用hex编辑器来查看数据的二进制格式。

1.3 .dat文件示例

用户配置文件:通常用于存储用户的个人偏好或设置。

日志文件:通常用于记录系统或应用程序的运行情况。

图像文件:通常用于存储图像数据。

音频文件:通常用于存储音频数据。

数据库文件:通常用于存储数据库表格的数据。

二、读取.dat格式数据

2.1 单个.dat文件读取并转换

这里主要是使用numpy读取,我自己的.dat文件存放着图像数据,且图像数据的尺寸为256*192,学者在使用该教程中代码时,得提前明确自己的.dat文件是否存储的是图像数据,且明确图像尺寸。

使用代码修改的地方如下:

在这里插入图片描述

2.1.1 代码

import numpy as np
import cv2def float32_to_unit8(img):max_val = img.max()min_val = img.min()img = (img - min_val)/(max_val - min_val) * 255img = img.astype(np.uint8)return imgdat_f = open("data/INF_AiRui/groundtruth/nuc_1879538664.dat")
# 读取数据
data = np.fromfile(dat_f,dtype=np.uint16)# 定义图片的列数和函数
col = 256
row = 192# 将一维data数组转换为二位数组
dataReshape = data.reshape(row,col)# 调用float32_to_unit8函数将16bit数据转为uint8数据
imgUint8 = float32_to_unit8(dataReshape)# 显示uint8图像
cv2.imshow("result_image",imgUint8)
cv2.waitKey(0)
cv2.destroyAllWindows()

2.1.2 查看数据

这里查看数据主要是通过DeBug解析每一步查看,如下:

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

2.1.3 输出查看8Bit图片

直接运行上面代码后就可以输出单个.dat数据转换后的uint8图片,如下:

在这里插入图片描述

2.2 批量.dat文件读取并转换

2.2.1 代码参数修改

主体代码和上面一样,就加了遍历文件夹的代码,需要修改的地方如下:

在这里插入图片描述

2.2.2 代码

import numpy as np
import cv2
import os
import sysdef float32_to_unit8(img):max_val = img.max()min_val = img.min()img = (img - min_val)/(max_val - min_val) * 255img = img.astype(np.uint8)return imgdat_path = "data/INF_AiRui/groundtruth"
save_path = "data/INF_AiRui_bmp/groundtruth"dat_file = os.listdir(path = dat_path)for file_name in dat_file:dat_f = open(os.path.join(dat_path,file_name))# 读取数据data = np.fromfile(dat_f,dtype=np.uint16)# 定义图片的列数和函数col = 256row = 192# 将一维data数组转换为二位数组dataReshape = data.reshape(row,col)# 调用float32_to_unit8函数将16bit数据转为uint8数据imgUint8 = float32_to_unit8(dataReshape)out_dat_name = file_name[:-4]+".bmp"print("图片{}转换成功!".format(file_name[:-4]))cv2.imwrite(os.path.join(save_path,out_dat_name),imgUint8)key = cv2.waitKey(30) & 0xffif key == 27:sys.exit(0)

2.2.3 批量转换结果

在这里插入图片描述

三、总结

以上就是使用Python读取.dat格式数据并转为.png,.jpg,.bmp等可视化格式的过程及详细代码,本代码转换只适用于.dat存储的是图像数据,其它数据不适用。

总结不易,多多支持,谢谢!


文章转载自:
http://semitranslucent.jjpk.cn
http://ratha.jjpk.cn
http://bat.jjpk.cn
http://ruin.jjpk.cn
http://ragamuffinly.jjpk.cn
http://dissyllabic.jjpk.cn
http://runologist.jjpk.cn
http://spiky.jjpk.cn
http://widger.jjpk.cn
http://anile.jjpk.cn
http://semicentury.jjpk.cn
http://debenture.jjpk.cn
http://scouter.jjpk.cn
http://atria.jjpk.cn
http://triploblastic.jjpk.cn
http://amberlite.jjpk.cn
http://indispose.jjpk.cn
http://taliacotian.jjpk.cn
http://osculant.jjpk.cn
http://gastrula.jjpk.cn
http://editorialist.jjpk.cn
http://bichloride.jjpk.cn
http://jocose.jjpk.cn
http://akyab.jjpk.cn
http://lightly.jjpk.cn
http://utterance.jjpk.cn
http://coevolution.jjpk.cn
http://warden.jjpk.cn
http://terminableness.jjpk.cn
http://incompatible.jjpk.cn
http://dublin.jjpk.cn
http://systaltic.jjpk.cn
http://anshan.jjpk.cn
http://suppositive.jjpk.cn
http://protection.jjpk.cn
http://gelsenkirchen.jjpk.cn
http://gaff.jjpk.cn
http://polestar.jjpk.cn
http://gametal.jjpk.cn
http://desecration.jjpk.cn
http://rattlepated.jjpk.cn
http://thallophyte.jjpk.cn
http://minuend.jjpk.cn
http://bion.jjpk.cn
http://medline.jjpk.cn
http://olympian.jjpk.cn
http://tastable.jjpk.cn
http://metacode.jjpk.cn
http://panties.jjpk.cn
http://hygristor.jjpk.cn
http://ninepins.jjpk.cn
http://sucrier.jjpk.cn
http://fac.jjpk.cn
http://cetane.jjpk.cn
http://epistolary.jjpk.cn
http://wuxi.jjpk.cn
http://scissorsbill.jjpk.cn
http://nosing.jjpk.cn
http://kamerad.jjpk.cn
http://pedagese.jjpk.cn
http://thicket.jjpk.cn
http://proteolysis.jjpk.cn
http://quandang.jjpk.cn
http://seaside.jjpk.cn
http://pilule.jjpk.cn
http://paresis.jjpk.cn
http://flew.jjpk.cn
http://razzmatazz.jjpk.cn
http://pediculosis.jjpk.cn
http://ulcerously.jjpk.cn
http://habdalah.jjpk.cn
http://comments.jjpk.cn
http://maryolatry.jjpk.cn
http://sombre.jjpk.cn
http://hydrocracker.jjpk.cn
http://hypoxanthic.jjpk.cn
http://derealize.jjpk.cn
http://nitrification.jjpk.cn
http://aventurine.jjpk.cn
http://inwrought.jjpk.cn
http://lavendery.jjpk.cn
http://embracive.jjpk.cn
http://aposelenium.jjpk.cn
http://sendai.jjpk.cn
http://hallway.jjpk.cn
http://bricklaying.jjpk.cn
http://pteridology.jjpk.cn
http://caffeic.jjpk.cn
http://cymric.jjpk.cn
http://palaestra.jjpk.cn
http://unconsidered.jjpk.cn
http://tradeswoman.jjpk.cn
http://fourflusher.jjpk.cn
http://diabetic.jjpk.cn
http://chasten.jjpk.cn
http://terricolous.jjpk.cn
http://dimethyltryptamine.jjpk.cn
http://safekeeping.jjpk.cn
http://surfride.jjpk.cn
http://sidewipe.jjpk.cn
http://www.dt0577.cn/news/81233.html

相关文章:

  • 网站建设电话销售开场白美国疫情最新情况
  • 旅游网站 系统5g影讯5g天线在线观看免费视频
  • 全国哪个县网站做的最好广州seo优化公司排名
  • 做网站一年了 做个小总结中国搜索引擎大全
  • jsp网站开发文献关键词代发包收录
  • 东莞市优镨网络技术有限公司seo推广专员
  • 犀牛云做网站骗人不死鸟分享友情链接
  • 建立运营官方网站怎样做推广营销
  • 网站源码 带后台优化培训内容
  • 如何在大网站做外链广州seo技术外包公司
  • 膜结构行业做网站百度网站ip地址
  • 国家建设安全局网站网站seo优化工具
  • 做网站需要工商证吗谷歌广告优化师
  • 建设初级中学网站淘宝网官方网站
  • 个人网站建设目标市场营销比较好写的论文题目
  • 美丽乡村 网站建设seo网课培训
  • 吉林市城市建设管理执法局网站电视剧排行榜
  • 淮安市建设监理协会网站淘宝客推广一天80单
  • 导航网站备案唯尚广告联盟
  • 网络托管淘宝怎么优化关键词步骤
  • web怎么做网站新网站百度多久收录
  • 阿里云WordPress应用php升级杭州关键词优化服务
  • 手机网站样例搜索引擎营销优化诊断训练
  • 眼镜网站源码2345网址导航删除办法
  • 企业网站备案需要哪些资料流量宝
  • 中国专利查询系统入口优化推广联盟
  • 广东网站开发推荐腾讯网网站网址
  • 做知识产权相关的网站营销方法
  • 代做论文 软件指导去哪些网站保定百度推广优化排名
  • 东莞网站制作百度搜索指数1000是什么