• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

stm32f103图像卷积处理算法

yhj416606438 2021-09-21 浏览量:726
stm32f103有没有图像卷积算法函数或者例程参考下载
0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
  • 这个例程还是比较多的吧,如下

    [numthreads(32321)]
    void Dim_Main (uint3 id : SV_DispatchThreadID)
    {

        float sumR = 0;
        float sumG = 0;
        float sumB = 0;
        float sumA = 0;
        for (int i = -1; i <= 1; i++)
        {
            for (int j = -1; j <= 1; j++)
            {
                sumR += texBuffer[(id.x+i)*texWidth[0]+(id.y+j)].r * convolutionTempBuffer[(i+1)*3+(j+1)];
                sumG += texBuffer[(id.x+i)*texWidth[0]+(id.y+j)].g * convolutionTempBuffer[(i+1)*3+(j+1)];
                sumB += texBuffer[(id.x+i)*texWidth[0]+(id.y+j)].b * convolutionTempBuffer[(i+1)*3+(j+1)];
                sumA += texBuffer[(id.x+i)*texWidth[0]+(id.y+j)].a * convolutionTempBuffer[(i+1)*3+(j+1)];
            }
        }

        texBuffer[id.x*texWidth[0]+id.y].r = sumR;
        texBuffer[id.x*texWidth[0]+id.y].g = sumG;
        texBuffer[id.x*texWidth[0]+id.y].b = sumB;
        texBuffer[id.x*texWidth[0]+id.y].a = sumA;

        Result[id.xy] = float4(sumR sumG sumB sumA);
    }


    一般单片机上用不了opencv的库函数的

    • 发布于 2021-09-30
    • 举报
    • 评论 0
    • 0
    • 0

其他答案 数量:2
  • filter2D()函数是OpenCV中进行图像卷积运算的函数
    • 发布于2021-09-21
    • 举报
    • 评论 0
    • 0
    • 0

  • 这个是单片机上的,要使用openmv的库来进行计算才可以的
    • 发布于2021-09-27
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

stm32f103图像卷积处理算法