OV7670+stc12C5a60s2 救助
先附问题图第一张是手机拍的,第二张是摄像头出来显示在液晶屏上的 ,奇怪的是一半是黑屏的 没数据,另一半显示出图像了 但是图像是错位的,切屏,整体偏暗和绿,然后我延时让他一帧一帧慢慢的显示,呈现出一种滚屏的效果,让我很不解,液晶是正常的,显示图片的时候,也是用240*160(两个点)这个for循环,一共是240*320个点,写图片是显示正常,不知道是哪里出了问题
下面是我摄像头的配置
{0x00,0x00}, unsigned char code OV_reg[]=
{
{0x00,0x00}, //AGC,自动增益控制
{0x01,0x80}, //BLUE,AWB-蓝色通道增益
{0x02,0xff}, //RED,AWB-红色通道增益
{0x03,0x06}, //VREF,帧竖直方向控制
//{0x04,0x00}, //COM1,通用控制1使能 CCIR格式
//{0x05,0x00}, //BAVE,U/B的平均电平,随输出自动更新
//{0x06,0x00}, //GbAVE,Y/Gb的平均电平,随输出自动更新
//{0x07,0x00}, //AECHH,曝光值-AEC高5位
//{0x08,0x00}, //RAVE,V/R的平均电平,随输出自动更新
{0x09,0x00}, //COM2,通用控制2设置 睡眠模式 输出驱动能力
//{0x0a,0x76}, //PID,产品高位识别号(只读)
//{0x0b,0x73}, //VER,产品低位识别号(只读)
{0x0c,0x00}, //COM3,通用控制3 时钟、数据三态 缩放模式 DCW使能 数据位交换
{0x0d,0x00}, //COM4,通用控制4 平均选择 窗口大小
{0x0e,0x61}, //COM5,通用控制5 保留
{0x0f,0x80}, //COM6,通用控制6 光学黑行HREF输出选择 格式变化复位所有时序
{0x10,0x00}, //AECH,曝光值
{0x11,0x04}, //CLRRC,内外部时钟、分频选择
{0x12,0x14}, //COM7,通用控制7设置帧格式(如RGB) SCCB复位 彩色条
{0x13,0xe7}, //COM8,通用控制8 使能 AGC AWB AEC AEC步长限制 条纹滤波器
{0x14,0x28}, //COM9,通用控制9 自动增益限度
{0x15,0x02}, //COM10,通用控制10 HREF PCLK VSYNC HSYNC 输出选择
{0x16,0x02}, //RSVD,保留
{0x17,0x16}, //HSTART,输出格式-行频开始高8位(低3位在HREF)
{0x18,0x04}, //HSTART,输出格式-行频结束高8位(低3位在HREF)
{0x19,0x02}, //HSTART,输出格式-场频开始高8位(低2位在VREF)
{0x1a,0x7b}, //HSTART,输出格式-场频结束高8位(低2位在VREF)
//{0x1b,0x00}, //PSHFT,数据格式-像素延迟选择(D相对于HREF延迟多少像素时钟周期)
//{0x1c,0x7f}, //MIDH,厂商识别字-高(只读=0X7F)
//{0x1d,0xa2}, //MIDL,厂商识别字-低(只读=0xa2)
{0x1e,0x07}, //MVFP,水平镜像/竖直翻转 消除黑太阳
//{0x1f,0x00}, //LAEC,保留
//{0x20,0x04}, //ADCCTR0,ADC控制
{0x21,0x02}, //ADCCTR1,保留
{0x22,0x91}, //ADCCTR2,保留
//{0x23,0x00}, //ADCCTR3,保留
{0x24,0x07}, //AEW,AGC/AEC-稳定运行区域(上限)
{0x25,0x63}, //AEB,AGC/AEC-稳定运行区域(下限)
{0x26,0xa5}, //VPT,AGC/GEC快速运行区域
//{0x27,0x80}, //BBIAS,B通道信号输出偏移(当COM6=1有效)
//{0x28,0x80}, //GbIAS,Gb通道信号输出偏移(当COM6=1有效)
{0x29,0x07}, //RSVD,保留
//{0x2a,0x00}, //EXHCH,插入空像素数的高位
//{0x2b,0x00}, //EXHCL,插入空像素数的低8位
//{0x2c,0x80}, //RBIAS,R通道信号输出偏移(当COM3=1有效)
//{0x2d,0x00}, //ADVFL,场中插入空行的低8位(一位表示一行)
//{0x2e,0x00}, //ADVFH,场中插入空行的高8位
//{0x2f,0x00}, //YAVE,Y/G通道的平均值
//{0x30,0x08}, //HSYST,HSYNC上升沿延迟(低8位)
//{0x31,0x30}, //HSYEN,HSYNC下降沿延迟(低8位)
{0x32,0x80}, //HREF,HREF控制
{0x33,0x0b}, //CHLF,感光阵列电流控制,保留
{0x34,0x11}, //ARBLM,感光阵列参考电压控制,保留
{0x35,0x0b}, //RSVD,保留
//{0x36,0xXX}, //RSVD,保留
{0x37,0x1d}, //ADC,ADC控制,保留
{0x38,0x71}, //ACOM,ADC和模拟共模控制,保留
{0x39,0x2a}, //OFON,ADC偏移控制,保留
{0x3a,0x00}, //TSLB,行缓冲测试选项
{0x3b,0x42}, //COM11,通用控制11
{0x3c,0x00}, //COM12,通用控制12
{0x3d,0xc2}, //COM13,通用控制13
{0x3e,0x00}, //COM14,通用控制14
{0x3f,0x00}, //EDGE,边缘增强调整
{0x40,0xd0}, //COM15,通用控制15
{0x41,0x38}, //COM16,通用控制16
//{0x42,0x00}, //COM17,通用控制17
{0x43,0x14}, //AWBC1,保留
{0x44,0xf0}, //AWBC2,保留
{0x45,0x34}, //AWBC3,保留
{0x46,0x58}, //AWBC4,保留
{0x47,0x28}, //AWBC5,保留
{0x48,0x3a}, //AWVC6,保留
//{0x49,0xXX}, //RSVD,保留
//{0x4a,0xXX}, //RSVD,保留
{0x4b,0x09}, //REG4B,读寄存器4B
//{0x4c,0x00}, //DNSTH,噪声抑制强度
{0x4d,0x40}, //RSVD,保留
{0x4e,0x20}, //RSVD,保留
{0x4f,0x80}, //MTX1,色彩矩阵系数1
{0x50,0x80}, //MTX2,色彩矩阵系数2
{0x51,0x00}, //MTX3,色彩矩阵系数3
{0x52,0x22}, //MTX4,色彩矩阵系数4
{0x53,0x5e}, //MTX5,色彩矩阵系数5
{0x54,0x80}, //MTX6,色彩矩阵系数6
//{0x55,0x00}, //BRIGHT,亮度控制
{0x56,0x40}, //CONTRAS,对比度控制
//{0x57,0x80}, //CONTRAS-CENTER,对比度中心
{0x58,0x9e}, //MTXS,色彩矩阵系数5~0的符号
{0x59,0x88}, //RSVD,AWB控制
{0x5a,0x88}, //RSVD,AWB控制
{0x5b,0x44}, //RSVD,AWB控制
{0x5c,0x67}, //RSVD,AWB控制
{0x5d,0x49}, //RSVD,AWB控制
{0x5e,0x0e}, //RSVD,AWB控制
//{0x5f,0xXX}, //RSVD,AWB控制
//{0x60,0xXX}, //RSVD,AWB控制
//{0x61,0xXX}, //RSVD,AWB控制
//{0x62,0x00}, //LCC1,镜头补偿选项1-对于光学中心补偿中心的X轴坐标
//{0x63,0x00}, //LCC2,镜头补偿选项2-对于光学中心补偿中心的Y轴坐标
{0x64,0x04}, //LCC3,镜头补偿选项3-G通道的补偿系数LCCD=1有效;RGB通道补偿系数LCC5=0有效
{0x65,0x20}, //LCC4,镜头补偿选项4-避免补偿的半径
{0x66,0x05}, //LCC5,镜头补偿选项5
//{0x67,0x80}, //MANU,手动U值,(寄存器TSLB=1有效)
//{0x68,0x80}, //MANV,
{0x69,0x00}, //GFIX,固定增益控制
{0x6a,0x40}, //GGAIN,G通道AWB增益
{0x6b,0x60}, //DBLV,PLL控制,LDO
{0x6c,0x0a}, //AWBCTR3,AWB控制3
{0x6d,0x55}, //AWBCTR2,AWB控制2
{0x6e,0x11}, //AWBCTR1,AWB控制1
{0x6f,0x9a}, //AWBCTR0,AWB控制0
{0x70,0x00}, //SCALING_XSC,测试图案选择
{0x71,0x10}, //SCALING_YSC,测试图案选择
{0x72,0x11}, //SCALING_DCWCTR,DCW控制
{0x73,0x00}, //SCALING_PC,DSP缩放时钟分频控制
{0x74,0x19}, //REG74,寄存器74 数字增益控制
{0x75,0x05}, //边缘增强下限
{0x76,0xe1}, //REG76,黑白点校正,边缘增强上限
{0x77,0x01}, //REG77,噪声去除偏移
{0x78,0x04}, //RSVD,保留
{0x79,0x0f}, //RSVD,保留
{0x7a,0x20}, //SLOP,伽马曲线最高斜率-计算公式
{0x7b,0x1c}, //GAM1,伽马曲线1节输入结束点0x04输出值
{0x7c,0x28}, //GAM2,伽马曲线2节输入结束点0x08输出值
{0x7d,0x3c}, //GAM3,伽马曲线3节输入结束点0x10输出值
{0x7e,0x55}, //GAM4,伽马曲线4节输入结束点0x20输出值
{0x7f,0x68}, //GAM5,伽马曲线5节输入结束点0x28输出值
{0x80,0x76}, //GAM6,伽马曲线6节输入结束点0x30输出值
{0x81,0x80}, //GAM7,伽马曲线7节输入结束点0x38输出值
{0x82,0x88}, //GAM8,伽马曲线8节输入结束点0x40输出值
{0x83,0x8f}, //GAM9,伽马曲线9节输入结束点0x48输出值
{0x84,0x96}, //GAM10,伽马曲线10节输入结束点0x50输出值
{0x85,0xa3}, //GAM11,伽马曲线11节输入结束点0x60输出值
{0x86,0xaf}, //GAM12,伽马曲线12节输入结束点0x70输出值
{0x87,0xc4}, //GAM13,伽马曲线13节输入结束点0x90输出值
{0x88,0xd7}, //GAM14,伽马曲线14节输入结束点0xb0输出值
{0x89,0xe8}, //GAM15,伽马曲线15节输入结束点0xd0输出值
//{0x8a,0xXX}, //RSVD,保留
//{0x8b,0xXX}, //RSVD,保留
//{0x8c,0x00}, //RGB44,RGB444控制
{0x8d,0x4f}, //RSVD,保留
{0x8e,0x00}, //RSVD,保留
{0x8f,0x00}, //RSVD,保留
{0x90,0x00}, //RSVD,保留
{0x91,0x00}, //RSVD,保留
{0x92,0x00}, //DM_LNL,空行低8位
//{0x93,0x00}, //DM_LNH,空行高8位
{0x94,0x04}, //LCC6,镜头校正选项6(LCC5=1有效)
{0x95,0x08}, //LCC7,镜头校正选项7(LCC5=1有效)
{0x96,0x00}, //RSVD,保留
{0x97,0x30}, //RSVD,保留
{0x98,0x20}, //RSVD,保留
{0x99,0x30}, //RSVD,保留
{0x9a,0x84}, //RSVD,保留
{0x9b,0x29}, //RSVD,保留
{0x9c,0x03}, //RSVD,保留
{0x9d,0x4c}, //BD50ST,50Hz条纹滤波器的值(在COM8=1和COM11=1)
{0x9e,0x3f}, //BD60ST,60Hz条纹滤波器的值(在COM8=1和COM11=0)
{0x9f,0x78}, //HAECC1,基于直方图的AEC/AGC的控制1
{0xa0,0x68}, //HAECC2,基于直方图的AEC/AGC的控制2
{0xa1,0x03}, //RSVD,保留
{0xa2,0x02}, //SCALING_PCLK_KELAY,像素始终延迟
//{0xa3,0xXX}, //RSVD,保留
{0xa4,0x89}, //NT_CTRL,帧率调整
{0xa5,0x05}, //BD50MAX,50Hz条纹滤波器步长限制
{0xa6,0xdf}, //HAECC3,基于直方图的AEC/AGC的控制3
{0xa7,0xdf}, //HAECC4,基于直方图的AEC/AGC的控制4
{0xa8,0xf0}, //HAECC5,基于直方图的AEC/AGC的控制5
{0xa9,0x90}, //HAECC6,基于直方图的AEC/AGC的控制6
{0xaa,0x94}, //HAECC7, AEC公式选择
{0xab,0x07}, //BD60MAX,60Hz条纹滤波器步长限制
//{0xac,0x00}, //STR-OPT,闪光灯控制
//{0xad,0x80}, //STR_R,打LED闪光灯输出时的R增益
//{0xae,0x80}, //STR_G,打LED闪光灯输出时的G增益
//{0xaf,0x80}, //STR_B,打LED闪光灯输出时的B增益
{0xb0,0x84}, //RSVD,保留
{0xb1,0x0c}, //ABLC1,自动黑电平校正
{0xb2,0x0e}, //RSVD,保留
{0xb3,0x82}, //THL_DLT,自动黑电平校正目标值
//{0xb4,0xXX}, //RSVD,保留
//{0xb5,0x04}, //THL_DLT,自动黑电平校正稳定区域
//{0xb6,0xXX}, //RSVD,保留
//{0xb7,0xXX}, //RSVD,保留
{0xb8,0x0a}, //RSVD,保留
//{0xb9,0xXX}, //RSVD,保留
//{0xba,0xXX}, //RSVD,保留
//{0xbb,0xXX}, //RSVD,保留
//{0xbc,0xXX}, //RSVD,保留
//{0xbd,0xXX}, //RSVD,保留
//{0xbe,0x00}, //AC-CHB,B通道黑电平补偿
//{0xbf,0x00}, //R通道黑电平补偿
//{0xc0,0x00}, //Gb通道黑电平补偿
//{0xc1,0x00}, //Gb通道黑电平补偿
//{0xc2,0xXX}, //RSVD,保留
//{0xc3,0xXX}, //RSVD,保留
//{0xc4,0xXX}, //RSVD,保留
//{0xc5,0xXX}, //RSVD,保留
//{0xc6,0xXX}, //RSVD,保留
//{0xc7,0xXX}, //RSVD,保留
{0xc8,0x30}, //RSVD,保留
{0xc9,0x26}, //SATCTR,饱和度控制 jie杰 发表于 2012-4-11 16:09 static/image/common/back.gif
unsigned char code OV_reg[]=
{
{0x00,0x00}, //AGC,自动增益控制
mark,楼主能发一份资料我么?最近也在做图像处理相关的东西呀!想用430处理。
abcfanyuan@vip.qq.com
谢谢啦 STC系列单片机处理起来很慢吧
楼主,请问还在研究吗,一起探讨下 楼主,求你的完整程序,1154507441@qq.com,万分感谢 我也遇到相同 的问题,楼主解决了吗,求助
页:
[1]