/** * @name ImageLineDetect * @brief 采集一帧图像的某一行 * @param None * @return None * @notice 由于函数栈过小,本函数使用了全局数组来存放采集到的数据 */ void ImageLineDetect(void) { int i; /* 从FIFO读出一行像素保存到Line_Buf */ for(i = 0; i < FRAME_WIDTH; ++i) READ_FIFO_PIXEL(LineBuf[i]); }
/* 320 * ------------------- *| | *| | *| | 240 *| | *| | * ------------------- */ void ImagDisp(void) { uint16_t i, j; uint16_t Camera_Data; for(i = 0; i < 240; i++) { for(j = 0; j < 320; j++) { READ_FIFO_PIXEL(Camera_Data); /* 从FIFO读出一个rgb565像素到Camera_Data变量 */ // LCD_WR_Data(Camera_Data); } } }
/* 320 * ------------------- *| | *| | *| | 240 *| | *| | * ------------------- */ void ImagDisp(void) { uint16_t i,j,m=0; uint16_t Camera_Data; for(i = 0; i < 240; i++){ for(j = 0; j < 320; j++){ READ_FIFO_PIXEL(Camera_Data); /* 从FIFO读出一个rgb565像素到Camera_Data变量 */ if((i == Mid[4].y) && (j > Mid[4].x) && (j <= Mid[4].x + pointNum)) ColorData4[0][j-Mid[4].x] = Camera_Data; if((i == Mid[4].y) && (j < Mid[4].x) && (j >= Mid[4].x - pointNum)) ColorData4[1][Mid[4].x-j] = Camera_Data; if((j == Mid[4].x) && (i >= Mid[4].y - pointNum) && (i < Mid[4].y)) ColorData4[2][Mid[4].y-i] = Camera_Data; if((j == Mid[4].x) && (i > Mid[4].y) && ( i <= Mid[4].y + pointNum)) ColorData4[3][i-Mid[4].y] = Camera_Data; if((i == Mid[2].y) && (j > Mid[2].x) && (j <= Mid[2].x + pointNum)) ColorData4[0][j-Mid[2].x] = Camera_Data; if((i == Mid[2].y) && (j < Mid[2].x) && (j >= Mid[2].x - pointNum)) ColorData4[1][Mid[2].x-j] = Camera_Data; if((j == Mid[2].x) && (i >= Mid[2].y - pointNum) && (i < Mid[2].y)) ColorData4[2][Mid[2].y-i] = Camera_Data; if((j == Mid[2].x) && (i > Mid[2].y) && ( i <= Mid[2].y + pointNum)) ColorData4[3][i-Mid[2].y] = Camera_Data; // // if(i==Mid[6].y&&j>Mid[6].x&&j<=Mid[6].x+pointNum) // ColorData6[0][j-Mid[6].x]=Camera_Data; // if(i==Mid[6].y&&j<Mid[6].x&&j>=Mid[6].x-pointNum) // ColorData6[1][Mid[6].x-j]=Camera_Data; // if(j==Mid[6].x&&i>=Mid[6].y-pointNum&&i<Mid[6].y) // ColorData6[2][Mid[6].y-i]=Camera_Data; // if(j==Mid[6].x&&i>Mid[6].y&&i<=Mid[6].y+pointNum) // ColorData6[3][i-Mid[6].y]=Camera_Data; if(i==65&&j==135) { MidColorData[0][0]=Camera_Data; Camera_Data=0; } if(i==65&&j==170) { MidColorData[0][1]=Camera_Data; Camera_Data=0; } if(i==65&&j==202) { MidColorData[0][2]=Camera_Data; Camera_Data=0; } if(i==100&&j==135) { MidColorData[1][0]=Camera_Data; Camera_Data=0; } if(i==100&&j==170) { MidColorData[1][1]=Camera_Data; Camera_Data=0; } if(i==100&&j==202) { MidColorData[1][2]=Camera_Data; Camera_Data=0; } if(i==135&&j==135) { MidColorData[2][0]=Camera_Data; Camera_Data=0; } if(i==135&&j==170) { MidColorData[2][1]=Camera_Data; Camera_Data=0; } if(i==135&&j==202) { MidColorData[2][2]=Camera_Data; Camera_Data=0; } LCD_WR_Data(Camera_Data); } } for(i=0;i<3;i++){ for(j=0;j<3;j++){ RGBtoHSL(MidColorData[i][j],hsl_l+m); outcolor(hsl_l+m); m++; } } if(ColorDataCompare(ColorData4)) { // if(ColorDataCompare(ColorData2)) Judgerubik=1; // else // Judgerubik=0; } else Judgerubik=0; }