|
|
如題 stm32顏色識(shí)別 默認(rèn)識(shí)別顏色為藍(lán)色 可修改 而二值化需要自行添加(比較簡(jiǎn)單)
單片機(jī)源程序如下:
- #include "stm32f10x.h"
- #include "bsp_ov7725.h"
- #include "bsp_ili9341_lcd.h"
- #include "EasyTracer.h"
- extern uint8_t Ov7725_vsync;
- RESULT Resu;
- TARGET_CONDI Condition={50,80,20,250,20,250,20,10,100,100}; //藍(lán)色
- int main(void)
- {
- LCD_Init(); //液晶初始化
- Ov7725_GPIO_Config(); //ov7725 gpio 初始化
- while(Ov7725_Init() != SUCCESS); //ov7725 寄存器配置初始化
- VSYNC_Init(); //ov7725 場(chǎng)信號(hào)線初始化
- Ov7725_vsync = 0;
-
- while(1)
- {
- if( Ov7725_vsync == 2 )
- {
- Ov7725_vsync = 0;
- if(Trace(&Condition,&Resu))
- {
- LCD_Clear(Resu.x-Resu.w/2,Resu.y-Resu.h/2,Resu.w,1,0xf800);
- LCD_Clear(Resu.x-Resu.w/2,Resu.y-Resu.h/2,1,Resu.h,0xf800);
- LCD_Clear(Resu.x-Resu.w/2,Resu.y+Resu.h/2,Resu.w,1,0xf800);
- LCD_Clear(Resu.x+Resu.w/2,Resu.y-Resu.h/2,1,Resu.h,0xf800);
- LCD_Clear(Resu.x-2,Resu.y-2,4,4,0xf800);
- }
- }
- }
- }
復(fù)制代碼
所有資料51hei提供下載:
|
-
-
OV7725顏色識(shí)別.7z
2019-7-16 16:33 上傳
點(diǎn)擊文件名下載附件
194.21 KB, 下載次數(shù): 165
管理提醒:此附件有多人回帖說(shuō)不能用,大家不要下載
|