This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 在 DSP 上未正确检测到边沿

Guru**** 2923960 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/655900/edge-not-properly-detected-on-dsp

大家好、团队、

我正在使用现有的框架复制插件移植 DSP 上的清晰边缘检测。我修改了其边缘检测的处理函数。我使用两个阵列、两个存储临时处理的数据、然后再修改原始输入缓冲区、我使用 malloc 将内存分配给这些阵列。

它是从堆动态分配内存的正确方法吗?

当我运行插件时、未获得预期结果、请参阅随附的图像以供参考。

请参阅下面的框架复制插件处理功能中添加的插件代码片段。

unsigned char * inputPtr_1、* inputPtr_2、* inputPtr_3;

        unsigned char *ptr1、*ptr2、*temp;
       ptr1 = pAlgHandle->optptr1;
   ptr2 = pAlgHandle->optptr2;
      
   inputPtr_1 =(unsigned char*) inPtr[0];
       inputPtr_2 =(unsigned char*)(inPtr[0]+宽度);
       inputPtr_3=(无符号字符*)(inPtr[0]+(2*width));

   memcpy (ptr1、inputPtr_1、width);

       int pixel_value、pixel_value_1、pixel_value_2;
   
   对于(rowIdx = 1;rowIdx <高度;++rowIdx)
   {
      for (colIdx = 1;colIdx <宽度;+colIdx)
       {
            
          PIXEL_value_1=(int)(-1)*((int)*(inputPTR_1+colIdx-1))+(-2)*(((int)*(inputPtr_1_colIdx))+(-1)*(((int)*(inputPtr_1_colx+1)+ 1)+
                             (0)*((int)*(inputPtr_2+colIdx -1))+(0)*((int)*(inputPtr_2+colIdx))+(0)*((int)*(inputPtr_2+colIdx+1))+
                             (1)*((int)*(inputPtr_3+colIdx-1))+(2)*((int)*(inputPtr_3+colIdx))+(1)*(((int)*(inputPtr_3+colIdx+1))));

          PIXEL_value_2=(int)(-1)*((int)*(inputPtr_1_colIdx-1))+(0)*((int)*(inputPtr_1_colIdx))+(1)*((int)*(inputPtr_1_colIdx+1)+)+
                             (-2)*((int)*(inputPtr_2+colIdx -1))+(0)*((int)*(inputPtr_2+colIdx))+(2)*((int)*(inputPtr_2+colIdx+1))+
                             (-1)*(((int)*(inputPtr_3+colIdx-1))+(0)*((int)*(inputPtr_3+colIdx))+(1)*((int)*(inputPtr_3+colIdx+1))));

         PIXEL 值_1 = ABS (PIXEL 值_1);
         PIXEL 值_2 = ABS (PIXEL 值_2);           
         PIXEL 值=(PIXEL 值_1 + PIXEL 值_2)>> 1;
         //pixel_value= sqrt (pixel_value* pixel_value);


         if (pixel_value > 255)
            PIXEL 值= 255;
         *(ptr2 + colIdx)=(unsigned char)(pixel_value);
         
              }
      
      memcpy (inputPtr_1、ptr1、width);
      temp = ptr1;
      ptr1 = ptr2;
      ptr2= temp;
      inputPtr_1 =(unsigned char*)(inputPtr_1 +宽度);
      inputPtr_2 =(unsigned char*)(inputPtr_2 +宽度);
      inputPtr_3=(unsigned char*)(inputPtr_3 +宽度);

        }
      memcpy (inputPtr_1、ptr1、width);

是否有人能建议任何指针来找出问题… ?

此致、

普里塔姆

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    我已将您的问题转发给算法专家。

    此致、
    Yordan
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    从第一张图片(灰色图片)中、您看起来会看到一些边缘。 您的期望是否不同? 您能解释一下期望是什么、您得到了什么?
    此致、Manu
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我不清楚这个问题是相关的算法还是框架。  

    您的问题是否已解决? 请进一步详细解释问题、以及您认为导致问题的原因。

    此致、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    您的问题是否已解决? 如果没有、如果您可以清楚地描述您的问题(预期结果是什么、而您得到的结果是什么?)

    如果仍然没有回复、我将假定您的问题已解决。

    此致、