图像格式转换-cross-plannar

本文介绍了一种将交错图像格式转换为平面图像格式的算法。该算法适用于RGB图像,通过重新组织像素数据,实现从交错格式到平面格式的高效转换,这对于图像处理和计算机视觉应用至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/**************************************************************************************************/
/* func: change the cross to the plannar format
/**************************************************************************************************/
/*            src                 -I    the rgb rgb image 
*             dst                 -O    the rr..gg..bb  image 
*             width               -I    the width of the image
*             height              -I    the height of the image
*             channel             -I    the channel of the image
** note:
*/
void TEST_Cross2Plannar(U08 *src, U08 *dst, S32 width, S32 height ,S32 channel)
{
    S32 mem_size       =  channel * width * height;
    S32 single_size    =  width * height;
    S32 cross_count          =  0;
    S32 plannar_count        =  0;
    S32 channel_c      =  0;

    for (cross_count = 0; cross_count < mem_size; cross_count+= channel)
    {
        for (channel_c = 0; channel_c < channel; channel_c++)
        {
              dst[plannar_count + channel_c * single_size] = src[cross_count + channel_c];
        }
        plannar_count++;
    }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值