mac_osx_rgb888RGB565

图像压缩(1)RGB888与RGB565图像 最近在接触图像压缩相关项目,之前对图像压缩接触的较少,对检测分类识别相关的图像信号处理接触学习的相对比较多一些,所以也需要学习学习,搜集整理了一些资料,在这里简单做个笔记,也分享出来和大家交流学习。 阅读详情

mac osx:(888_2_565)

 

unsigned char *srcData = [srcBitImageRep bitmapData]; //rgb888

unsigned char *destData = (unsigned char *)malloc(pixelsWide * pixelsHigh * 2);


unsigned short *pDestData;

pDestData = (unsigned short*)destData;


unsigned long nPos16 = 0, nPos24, nSize;

nSize = pixelsWide * pixelsHigh * 3;

for (nPos24 = 0 ; nPos24 < nSize ; nPos24+=3 ,nPos16+=2)

{

*pDestData = 0;

unsigned short tmp;

tmp =  srcData[nPos24] & 0x00F8; //1111 1000 R

tmp <<=8;

*pDestData |=  tmp;

 

tmp =  srcData[nPos24+1] & 0x00FC; //1111 1100 G

tmp <<=3;

*pDestData |=  tmp;

 

tmp =  srcData[nPos24+2] & 0x00F8; //1111 1000 B

tmp >>=3;

*pDestData |=  tmp;

 

pDestData ++;

}

_________________

565-2-888

 

dest = [bitmap bitmapData];

int i, end = width*height, rgb24i = 0;


unsigned char *pBuffer = (unsigned char *)malloc(strlens);

[pRgb565_data getBytes:pBuffer length:strlens];

unsigned short * src = (unsigned short *)pBuffer;


for (i=0; i<end; i++, rgb24i += 3)

{

unsigned short *pixel = src;

dest[rgb24i]   = (*pixel >> 8) & 0x00F8; 

dest[rgb24i+1] = (*pixel >> 3) & 0x00FC;//G

dest[rgb24i+2] = (*pixel << 3) & 0x00F8 ; //B

src++;

}

 

bruno-ios:这个简单的库可帮助您以RGB565格式表示图像 布鲁诺 这个简单的库可帮助您以RGB565格式表示图像。 使用示例: // get some source image let source = UIImage ( ... ) // resize image to 8x8pm, convert image from RGB8888 to RGB565 format let data = source. encodeRGB565 ( width : 8 , height : 8 ) // convert image from RGB565 to RGB8888 format let image = data ? . decodeRGB565 ( width : 8 , height : 8 ) 安装 迦太基 如果使用 ,则可以将以下依赖项添加到Cartfile : github "appunite/bruno-ios" "mast 立即下载

相关推荐

RGB888转RGB565工具

RGB888转RGB565工具,

iOS如何将RGB565的原始图像数据转为UIImage对象

我们在做一些图像处理时,往往会涉及到RGB565这种图像数据格式。由于其每个像素仅占2个字节,对于不需要像素透明度的情况下使用RGB565既能基本能保证图像的色彩,又能降低图像数据尺寸,节省带宽。因此,RGB565将会是一种常用的比较经济的图像处理的格式。

zenny_chen的专栏 382

RGB888与RGB565互转工具

GB888转RGB565工具, 亲测可用。

RGB888和565相互转换

今天在REVIEW代码的时候,发现了这样一个宏定义: #define COLOR_TO_MTK_COLOR_SIMUL(color) ((((color) >> 19) & 0x1f)

geminimuchachas的专栏 3万+

【BLE系列-第六篇】GATT解析:属性、特征、描述符的逻辑关系

本文系统介绍了BLE协议中的ATT和GATT机制。ATT以"属性"为基本数据单元,包含UUID、Handle、权限和Value四个要素。GATT则在ATT基础上构建了服务、特征和描述符的层次结构:服务(UUID:0x2800/0x2801)通过声明属性标识,特征声明(UUID:0x2803)指向特征值(UUID:0x2Axx或自定义),描述符(UUID:0x2900~0x290F)提供附加信息。GATT复用ATT发现机制,通过定义特定UUID语义实现服务发现和特征管理。这种设计使BLE设

qq_43399763的博客 1930

MEME-CHIP实战:5步搞定ChIP-seq数据中的motif发现与可视化

本文提供了使用MEME-CHIP工具进行ChIP-seq数据motif发现与可视化的完整实战指南。通过5个清晰步骤,从数据准备、环境搭建、命令行执行到结果解读与高级可视化,详细讲解了如何利用MEME-CHIP工作流高效完成从原始peak序列到发表级motif图的分析,并分享了关键的参数调优与避坑经验。

alice7model的博客 508

BMP数据转换为RGB565

本文博客链接:http://blog.youkuaiyun.com/jdh99,作者:jdh,转载请注明.作者:JDH 2010-03-09 TFT屏的显示缓存能直接显示RGB565的数据,所以BMP要转换成RGB565.24位BMP结构包括文件头,信息头,位图数据。首先读取文件头,信息头,然后读取位图数据。假设读取的是320 × 240大小的24位位图数据,转换成的RGB565的

jdh99的专栏 1万+

告别AT串口线!用STM32F407的USB FS口直连EC800M进行物联网通信

本文介绍了一种创新的物联网通信方案,利用STM32F407的USB FS接口直连EC800M模块,替代传统的AT串口线连接。通过详细的硬件对比、STM32CubeMX配置和USB驱动调试步骤,展示了如何实现更高效的AT指令通信,同时降低硬件复杂度和功耗。

weixin_29189987的博客 707

图解RGB565、RGB555、RGB16、RGB24、RGB32、ARGB32等格式的区别

常见的RGB格式有RGB1、RGB4、RGB8、RGB565、RGB555、RGB24、RGB32、ARGB32等

handy周 9万+

保姆级避坑指南:在Ubuntu 22.04上从零编译Autoware.universe(含ROS2 Humble和CUDA配置)

本文提供了一份详细的Autoware.universe编译指南,涵盖Ubuntu 22.04系统优化、ROS2 Humble安装避坑、CUDA配置及Demo运行技巧。通过分步操作和实战经验,帮助开发者高效完成环境搭建,避免常见错误,提升自动驾驶开发效率。

weixin_30642561的博客 350

Yocto系列讲解[入门篇]36 - 编译arm虚拟机qemuarm

玩一下qemuarm,因为之前用的x86架构

fulinux的博客 2572

从RGB色转为灰度色算法

<br />一、基础 <br />  对于彩色转灰度,有一个很著名的心理学公式:<br />                          Gray = R*0.299 + G*0.587 + B*0.114<br />二、整数算法<br />  而实际应用时,希望避免低速的浮点运算,所以需要整数算法。<br />  注意到系数都是3位精度的没有,我们可以将它们缩放1000倍来实现整数运算算法:<br />                          Gray = (R*299 + G*587 +

lxiaoxiaot的专栏 3722

python3.12 百分百解决安装dlib失败问题【研究原理后Bug已解决】

python3.12 百分百解决安装dlib失败问题【研究原理后Bug已解决】 python3.12版本下安装dlib失败。截图如下。试了网上很多方法都失败,耗费了很多时间终于找到适用于python3.12版本安装dlib的方法,亲测百分百成功。几乎尝试了所有的方法都不太行。终于找到安装的方法了。 原因分析: 版本匹配问题。我们现在是python3.12 使用pip根本无法安装。下面我们一起手动安装,1分钟搞定。

一键难忘的博客 7130

问题-[Delphi]PixelFormat 图像颜色的数据格式

 PixelFormat: (指定图像中每个像素的颜色数据的格式) Delphi                                        微软                                  说明 PixelAlpha                                Alpha                        像素数据包含没有...

weixin_34233679的博客 587

简谈基于FPGA的千兆以太网设计

简谈基于FPGA的千兆以太网设计 今天给大侠带来简谈基于FPGA的千兆以太网设计,话不多说,上货。 今天我们来简单的聊一聊以太网,以太网在FPGA学习中属于比较高级的内容了,有些大侠肯定会感觉以太网学习起来非常不容易。其实,我可以告诉大家,前期学习的基础打扎实了,后期的学习也没那么难。总之就是说难没那么难,说容易也不是那么容易。那么,言归正传,下面让我们一起来聊一聊以太网的学习。 说起以太网,大家可能就会想到百兆以太网、千兆以太网以及万兆以太网等等。局域以太网从10M开始发展,经历几多的变迁,发展到现

3621

解决群晖NAS无法拉取docker镜像问题

在2024-06-01日以前,使用SSH登录后是可以直接拉取docker镜像的;但是之后当我们使用SSH登录上群晖NAS,使用【sudo -i】切换到超管拉取镜像会提示报错【error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/cf/cff6b68a194a672fd337d8728bfb252071012cce6

提供C#相关开发 、云计算、运维测试、网络安全相关技术分享与服务,有意向可联系。 2万+

RGB565 与RGB888的区别

正常的RGB24是由24位即3个字节来描述一个像素,R、G、B各8位。而实际使用中为了减少图像数据的尺寸,如视频领域,对R、G、B所使用的位数进行的缩减,如你所说的RGB565和RGB555。 RGB565 就是R-5bit,G-6bit,B-5bit RGB555 就是R-5bit,G-5bit,B-5bit RGB888 就是R-8bit,G-8bit,B-8bit ;其实这就是RGB2

3783

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

iOS UImage 与 RGB 裸数据的相互转换

iOS UImage 与 RGB 裸数据的相互转换 Touch the data of image in iOS Get data from a image 较简单,根据已有的 image 的属性,创建 CGBitmapContext, 这个 context 是带有直接访问的指针的。然后将 Image 绘制到这个 context, 得到裸数据。 Code: CGImageAlphaInfo...

weixin_30851409的博客 304

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

ios UIImage转RGB

有时需要一些特殊目的, 需要一些RGB数据 + (unsigned char *)rgbArray: (UIImage *) uiimage { CGImageRef image = [uiimage CGImage]; CGSize size = uiimage.size; CGColorSpaceRef colorSpace = CGColorSpaceCreateDe...

wzj_whut的专栏 1991

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

RGB565颜色表,附RGB888转RGB565工具,RGB24转RGB565工具

下载链接   http://download.youkuaiyun.com/detail/liquanfeng9227/9893117 工具可以将RGB888颜色值转换成TFT屏用的RGB565颜色值。

liquanfeng9227的博客 1万+

生成缩略图

使用CoreFoundation/CoreFoundation 下类:CGImageRef  方法生成缩略图,我写成了一个的方法。//指定路径的图片文件生成缩略图 (CGImageRef)thumbnailForFile: (NSString*)filePath{ // use ImageIO to get a thumbnail for a

Codelife 5511

使用NSInvocation 调用实例的方法,且等待获得返回值

    OBJCExternInterface * ibjInter = [[OBJCExternInterface alloc] init]; //定义类的实例     SEL theSelector;    NSMethodSignature *aSignature;    NSInvocation *anInvocation;    theSelector = @se

Codelife 4304

在mac os x 上看chm格式电子书

工具:chmox官方网:http://chmox.sourceforge.net/  下载地址:http://sourceforge.net/project/downloading.php?groupname=chmox&filename=Chmox-0.4beta-i386_ppc.dmg&use_mirror=nchc是一个开源的工具。安装就可以用了。这下方便多了。

Codelife 4020
上一篇: Mac OS X:单用户模式(Single User Mode)的操作
下一篇: Synchronizing Threads with POSIX Semaphores
nitghost
博客等级 码龄19年 32粉丝 111原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值