test.c

来自「TMS320VC55XX 图像 处理程序」· C语言 代码 · 共 32 行

C
32
字号
#include <stdio.h>
#include<imagelib.h>
#include <string.h>
 unsigned char input[50]={10,20,20,40,20,20,70,80,80,90, // input: 5x10
                          12,23,15,12,13,2,3,4,5,60,
                          70,80,9,30,4,30,40,3,6,7,
                         12,23,15,12,13,2,3,4,5,60,
                          70,80,9,30,4,30,40,3,6,7};

  unsigned char output[24];  // output: 3x8
   unsigned char mask[9]={10,20,3,40,50,6,70,8,9}; // mask:3x3
  int i;
   
  int column=10; // column size of input block
  int row=5; // row size of input block
  int shift=-8;
  int roundval=0;
   void main()
{
 IMG_corr_3x3(input,output,mask,row,column,shift,roundval);
  /* Output should be 
  30 32 12 17 9 17 22 14
  33 24 13 11 11 13 8 6
  37 34 11 15 8 14 14 4
  Round error (difference 1) may exit between DSP output and 
  theoretical output.
  */
  
}


 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?