• 大小: 3.81M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-12
  • 语言: 其他
  • 标签: 其他  

资源简介

zhili_xinche714_03.zip

资源截图

代码片段和文件信息

#include 
#include “common.h“
#include “include.h“
#include “Image.h“


int white[60]img_l[60]img_r[60];
extern int middle;
int s_mid;
int middle_last;
extern int witwidth;
extern uint8 img[CAMERA_H][CAMERA_W];
extern int distance_middleimgrimgl;
extern int flag_stop;

int xiuzheng[60]={40404039393938383837
                  37373636353534343332
                  32313131303029292828
                  27272626252524242323
                  22222121202019191817
                  17161615141414141414
                };

///////////////////定义行列60*80//////////////////
#define ROW    60 
#define COLUMN 80 
//标志位
int stopcar = 0;
extern int errerr_last;
uint8 rowcolcnt = 0;
int sumR_flag=0L_flag=0wit_flag=0stop_flag=0 variance = 0variance_return ;
int now_go=0;
int obflag_r=0obflag_l=0;              //障碍物出现标志
//作用: 近场的数据滤波,即将孤立的噪声去除,即两个黑点之间是黑点,两个白点之间是白点
//改变全局变量: img[ROW][COLUMN]
//输入: 无
//输出: 无
void nearlvbo()
{
int ij;
for(i=ROW-1;i>0;i--)
{
for(j=1;j if(img[i][j-1]==255&&img[i][j+1]==255&&img[i][j]==0)
img[i][j]=255;
else if(img[i][j-1]==0&&img[i][j+1]==0&&img[i][j]==255)
img[i][j]=0;
}
}
///////////////////////
//修正函数避免数组溢出
////////////////////////
int sum_border(int sum)
{
    if(sum<1)
        sum=1;
    else if(sum>78)
        sum=78;
    return sum;
}

//远场发现障碍物
//发现在直道上双边线都在
/*
int find_far()
{
    int ob=0count_o=0;//计数速减次数
    R_flag=0; L_flag=0;//obflag_l=0;obflag_r=0;
    
    for(row=30;row>27;row--)
    {
      for(col = 40; col<79; col++ )         //右边界255为白,0为黑
      {
            if((img[row][col-1] == 255)&&(img[row][col-2]==255)&&(img[row][col+1]==0)&&(img[row][col+2]==0))
             {                     
                 img_R =col;                         
                 R_flag=1;               
                 break;                             
             }
      }
      for(col = 40; col>1; col-- )            //左边界
      {
            if((img[row][col+1] == 255)&&(img[row][col+2]==255)&&(img[row][col-1]==0)&&(img[row][col-2]==0))
            {
                  img_L =col;
                  L_flag=1;
                  break;
            }
      }

      if(R_flag==1 && L_flag==1)
      { 
          sum += (img_R+img_L)/2;
          count_o++;
             
          if( ((img_R-img_L)>20) && ((img_R-img_L)<40) )
                ob++;
                sum /= count_o; 
                
                if(ob >= 2)
                {
                    if(sum>40)
                    {
                        obflag_l = 1;
                        obflag_r = 0;
                    }else 
                    {
                        obflag_r = 1;
                        obflag_l = 0;
                    }
                    
                    break;
                }   
      }
      R_flag=0;L_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-23 21:44  zhili_xinche714_03\
     目录           0  2017-07-14 11:17  zhili_xinche714_03\zhili_xinche714_02\
     目录           0  2017-07-13 11:36  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\
     目录           0  2017-07-14 22:45  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\
     目录           0  2017-07-14 22:40  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\
     文件       18010  2018-01-23 21:46  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Image.c
     文件         387  2017-07-14 03:17  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Image.h
     目录           0  2017-07-09 11:12  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Inc\
     文件        1522  2015-03-24 12:03  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Inc\include.h
     文件        4397  2017-07-09 11:12  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Inc\MK60_conf.h
     文件         914  2014-10-06 04:08  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Inc\MK60_it.h
     文件        5992  2017-03-19 12:49  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\Inc\PORT_cfg.h
     文件       17931  2018-01-23 21:46  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\main.c
     文件          59  2017-07-01 22:23  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\main.h
     文件       11533  2014-10-02 15:24  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\MK60_conf.c
     文件         463  2014-10-06 04:08  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\App\MK60_it.c
     目录           0  2017-07-08 15:45  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\
     目录           0  2017-07-09 11:11  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\
     文件         661  2015-01-26 13:58  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_ASCII.h
     文件        2805  2014-09-21 22:19  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_BMP.h
     文件        1765  2015-04-01 22:10  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_camera.h
     文件         943  2015-03-24 12:36  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_computer.h
     文件         209  2014-09-21 22:19  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\vcan_img2sd.h
     文件        2087  2014-10-09 01:07  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_key.h
     文件         336  2014-09-21 22:19  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_key_event.h
     文件        5486  2015-03-30 13:28  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_LCD.h
     文件         959  2014-10-24 15:29  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_LCD_CH.h
     文件        2100  2017-07-09 11:11  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_LCD_ILI9341.h
     文件        4390  2014-10-02 15:27  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_LCD_ST7735R.h
     文件        4390  2014-10-02 15:27  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_LCD_ST7735S.h
     文件         962  2014-10-02 15:27  zhili_xinche714_03\zhili_xinche714_02\zhili_xinche713_01\zhili_xinche713\Board\inc\VCAN_LED.H
............此处省略174个文件信息

评论

共有 条评论