|  | 
| 为了得到相机的亮度图像,我在如下函数中增加了代码: /****************************************************************************/
 /*                                                                          */
 /*                       VPIF中断服务程序                                                                               */
 /*                                                                          */
 /****************************************************************************/
 static void VPIFIsr(void)
 {
 unsigned int temp;
 unsigned int Y_i;
 unsigned short int PixelVal;
 unsigned short int R_Val,G_Val,B_Val;
 #ifdef _TMS320C6X
 IntEventClear(SYS_INT_VPIF_INT);
 #else
 IntSystemStatusClear(SYS_INT_VPIF);
 #endif
 for(Y_i=0;Y_i<800*600;Y_i++)
 {
 PixelVal = *((unsigned short int *)(image)+Y_i);
 R_Val = (PixelVal & 0xF800) >> 11;
 G_Val = (PixelVal & 0x07E0) >> 5;
 B_Val = (PixelVal & 0x01F);
 
 image_Y[Y_i] = (R_Val * 0.3 + G_Val * 0.59 + B_Val * 0.11);
 }
 
 temp = VPIFInterruptStatus(SOC_VPIF_0_REGS, VPIF_ERROR_INT | \
 VPIF_FRAMEINT_CH3 | \
 VPIF_FRAMEINT_CH2 | \
 VPIF_FRAMEINT_CH1 | \
 VPIF_FRAMEINT_CH0);
 
 
 /* if error interrupt occurs, report error */
 if ((temp & VPIF_ERROR_INT))
 {
 error_flag = 1;
 }
 }
 麻烦帮忙看看代码是否有问题,通过调试的结果,image_Y中的值都是30以下,改变相机的亮度,值变化也不大。另外我想看看image_Y中的图像,应该怎么看?
 
 | 
 |