当前位置:网站首页>Matlab: convert PNG pictures into txt files
Matlab: convert PNG pictures into txt files
2022-07-23 13:51:00 【Liu Yaner】
Preface
Text
clc;
clear;
close all;
a=imread('che.png');
% Extract the three channel information of the image
channel_R=a;
channel_G=a;
channel_B=a;
% Separate 3 Values for channels =0, Extract R、G、B passageway
%R
channel_R(:,:,2)=0;
channel_R(:,:,3)=0;
gray_R=rgb2gray(channel_R);% Convert to grayscale value
bin_R=dec2bin(gray_R');% Convert to binary dlmwrite('E:\FPGA\picture_tuuuuu\che_R.txt',bin_R,'delimiter','','newline','pc');
%G
channel_G(:,:,1)=0;
channel_G(:,:,3)=0;
gray_G=rgb2gray(channel_G);
bin_G=dec2bin(gray_G'); dlmwrite('E:\FPGA\picture_tuuuuu\che_G.txt',bin_G,'delimiter','','newline','pc');
%B
channel_B(:,:,1)=0;
channel_B(:,:,2)=0;
gray_B=rgb2gray(channel_B);
bin_B=dec2bin(gray_B'); dlmwrite('E:\FPGA\picture_tuuuuu\che_B.txt',bin_B,'delimiter','','newline','pc');
% Display images
subplot(2,2,1);
imshow(channel_R,[]);
title('R passageway ');
subplot(2,2,2);
imshow(channel_G,[]);
title('G passageway ');
subplot(2,2,3);
imshow(channel_B,[]);
title('B passageway ');
subplot(2,2,4);
imshow(a,[]);
title(' Original picture ');
边栏推荐
- Reference and output message types in ROS
- Elephant Swap的LaaS方案优势分析,致eToken表现强势
- CenterNet目标检测模型及CenterFusion融合目标检测模型
- Tutorial on principles and applications of database system (040) -- MySQL query (II): set the column name or expression to be queried
- China leads the United States in another emerging technology field and stands at the commanding height of scientific and technological innovation
- 关于#redis#的问题:Redis设置数据持久化之后还是会有丢失数据的风险
- Establish stm32f103c8t6 project template and STM32 st-link utility burn hex file
- About this pointer
- 图形管线(一)后处理阶段 alpha测试 模版测试 深度测试 混合
- 同花顺开户风险性大吗,安全吗?
猜你喜欢

微服务重点

Shell operator, $((expression)) "or" $[expression], expr method, condition judgment, test condition, [condition], comparison between two integers, judgment according to file permission, judgment accor

CenterNet目标检测模型及CenterFusion融合目标检测模型

CSDN recommended template

LeetCode_491_递增子序列

SeekTiger的Okaleido有大动作,生态通证STI会借此爆发?

Research on hardware architecture of Ti single chip millimeter wave radar xwr1642

Power BI----综合应用

The fourth operation
![Shell运算符、$((运算式))” 或 “$[运算式]、expr方法、条件判断、test condition、[ condition ]、两个整数之间比较、按照文件权限进行判断、按照文件类型进行判断](/img/65/a735ca2c2902e3fc773dda79438972.png)
Shell运算符、$((运算式))” 或 “$[运算式]、expr方法、条件判断、test condition、[ condition ]、两个整数之间比较、按照文件权限进行判断、按照文件类型进行判断
随机推荐
在虚拟环境下使用pip时默认使用系统环境的pip该怎么办
The fourth operation
GLIB-CRITICAL g_file_test:assertion ‘filename != null‘ failed
中国在又一个新兴科技领域领先美国,站在科技创新制高点
十大券商开户风险性大吗,安全吗?
[ardunio] two methods to control the steering gear
Backtracking method to solve the eight queens problem
单例模式实现及防止反射与序列化
【STM32】串口通信基础知识
Error running ‘XXX‘: Command line is too long. Shorten command line for AudioTest or also ...
Database view detailed exploration
数据库系统原理与应用教程(050)—— MySQL 查询(十二):SELECT 命令的执行过程分析
Tutorial on principles and applications of database system (040) -- MySQL query (II): set the column name or expression to be queried
QNX modify system time
数据库系统原理与应用教程(038)—— MySQL 的索引(四):使用 EXPLAIN 命令分析索引
Redis常用命令
ModuleNotFoundError: No module named ‘setuptools_ rust‘
数据库系统原理与应用教程(045)—— MySQL 查询(七):聚合函数
Unity制作简单拦截近防炮——如何预测打击目标
第二章关系数据库课后习题