亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pdf417_dec.c

?? PDF417編碼的算法的源程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
#include <ctype.h>
#include <stdio.h>
#include <math.h>
#include <pgm.h>
#include "bitcodes.h"

typedef unsigned int UInt32;

#define MAX_SQUARES 5000
#define MAX_LINE_PIXEL  17000   // a line all the way thru symbol
#define MAX_MOD_PIXEL   1700   // a line thru one modules worth = 17 bars
#define MAX_X_PIXEL 17000
#define MAX_Y_PIXEL 5000
#define OUT_MAX_X_PIXEL 6000
#define OUT_MAX_Y_PIXEL 2000
#define MAX_XPIXEL_MODULE  900    // number of x pixels in a 17 wide module
#define MAX_YPIXEL_MODULE 300    // number of y pixels in a 17 wide module
#define MAX_SYMBOL_ROWS  100  // standard limits it to 90
#define MAX_SYMBOL_COLS  330  // min 3 rows 929/3 = 310 
#define MAX_LINES_X 300
#define MAX_LINES_Y 300
#define MAX_TOT_LR   5000
#define MAX_BARS  2000
#define MAX_PB 1500
#define MAX_MOD_BARS 5     // at most 5 bars in a module ( actually 4 )
#define MAX_LINE_SCANS 120
#define TRUE 1
#define FALSE 0

// scan defines

 #define MAX_BYTE_INDEX 1024
 #define MAX_CODE 2500

 #define ALPHA 0
 #define LOWER 1
 #define MIXED 2
 #define PUNCT 3
 #define PUNCT_SH 4

 #define MAX_ROW 91
 #define MAX_COL 512
 #define NULLCHAR '\0'

 #define MAX_RAW_CODES 1500
 #define MIN_ROW_HEIGHT  4
 #define MIN_COL_WIDTH   4
 #define EDGE_THRESHOLD  10

 #define MAX_PIXEL_Y 2048
 #define MAX_PIXEL_X 2048


 #define NN 1024
 #define PRIM 1
 #define GPRIME 929
 #define KK 32
 #define A0 928
 #define Ldec 1

#define sgn(x) ((x<0)?-1:((x>0)?1:0)) /* macro to return the sign of a
                                         number */
void  write_pgm_outpix_final( int num_cols, int num_rows);
void write_pgm_outmod(char *namestrin,  int num_cols, int num_rows);
void write_pgm_outcol(char *namestrin,  int num_cols, int num_rows);
void write_pgm_out( int num_cols, int num_rows);
void write_pgm_outpix( int num_cols, int num_rows);

FILE *wr_data_file;
FILE *infile1, *outfile1,*infile;

int fail;
char inargstr[120];

char pgm_infile_str[120];

int write_mods;      // flags to control writing of pgm outputs
int write_final_pix;  // write the symbol after unslanting 
int write_leftcol;    // write the left column of the symbol
int write_cols;       // write the individual columns
int write_outpix;        // write the symbol before unslanting 
int write_data;         // write the bitcodes for each row, and col

int box_x_incr;   // size of box used to find the symbol
int box_y_incr;   // inside the white space that should surround it

int slope_array[100];
int fig_flag;

int tot_lr[MAX_TOT_LR];      // used by get_columns_start
int tot_lr_in[MAX_TOT_LR];    // 1st derivative of tot_lr

int begin_left_col;   // beginning pixel of left column
int begin_right_bars;  // beginning pixel of right bars

int min_box_x;
int min_box_y;
int max_box_x;
int max_box_y;

int bytes_per_pix;      // bytes per pixel

int col_begin_x[400];     // beginning x value of each column

float onewidthf;
int onewidth;
float onewf;
int num_sym_cols;

int anal_mod_index;     // successful index for analyze module
int rule_mod_index;     // successful index for rule_checker
int slide_mod_index;
int xline_mod_index;

int symbol_data[MAX_SYMBOL_ROWS][MAX_SYMBOL_COLS]; 
             //  put the codes for rows and columns here

int bestfig;
int pixel_out_xlen;   // size of the pix_out in x direction
int pixel_out_ylen;   // size of the pix_out in y direction

int dir;
int slope;
int pix_slope;       // final correction slope
float pix_slopef;

int best_normal_x;
int best_normal_y;
int best_normal_dir;
int best_onewidth;
int best_begin_left_col;
int best_begin_right_bars;
int best_num_sym_cols;
int best_pix_slope;
int best_normal_slope;
int best_pixel_out_xlen;
int best_pixel_out_ylen;
float best_onewf;

int left_highy;     // highest y value in pix_out at middle of left fat bar
int right_highy;    // highest y value in pix_out at middle of right fat bar
int left_highx;
int right_highx;
int y_begin;       // this is the estimated center of the top row

int scan_upleft_x;   // these are the beginning points of places to scan from
int scan_upleft_y;

int scan_cenleft_x;
int scan_cenleft_y;

int scan_lowleft_x;
int scan_lowleft_y;
int out_cnt;

int save_line_cnt;  // should not be more than 36

int dark_sqindex;      // indexs all the dark squares in the original image
int dark_threshold;    // average grey value of a dark square
int line_threshold;    
int lpixel;
int pixel_cnt;    
int post_pixel_cnt;
int mod_pixel_cnt;

    
int symbol_height;    // pixel count height of symbol at left wide bar

int number_of_rows;   // number of rows in pixel map
int number_of_cols;  // number of columns in pixel map
int row_height_avg;   // avg of row_height high and low estimate
int best_row_height;  // best estimate of row height
int best_col_width_avg;  // best estimate of avg column width

int pix_col_yline[MAX_LINES_Y];  // y co-ordinant of lines in column data
int pix_col_xline[MAX_LINES_X];  // x co-ordinant of lines in column data
int pix_col_ydiffs[MAX_LINES_Y];
int vert_line_cnt;

void draw_normal(int nx, int ny, int nslope, int ndir, int ylen);

void line_fast_norm(int x1, int y1, int x2, int y2);

void find_height(int nx, int ny, int nslope, int ndir, int ylen);

void final_pix(int xlen, int ylen );

void find_left_edge(int nx, int ny, int nslope, int ndir, int ylen, int xlen);

void get_a_column(int indexin, int startx, int onewid);

struct pixelod
{
  int greyval;
} pix_in[MAX_X_PIXEL * MAX_Y_PIXEL];

struct pixeluu
{
  int greyval;
} pix_module[MAX_XPIXEL_MODULE][MAX_YPIXEL_MODULE];

struct pixeltt
{
  int greyval;
} pix_cols[OUT_MAX_X_PIXEL][OUT_MAX_Y_PIXEL];

struct pixelzz
{
  int greyval;
} pix_out[OUT_MAX_X_PIXEL][OUT_MAX_Y_PIXEL];

struct pixelqq
{
  int greyval;
} pix_final[OUT_MAX_X_PIXEL][OUT_MAX_Y_PIXEL];
 
struct pixeldo 
{
  int greyval;
} pixel_array[MAX_X_PIXEL][MAX_Y_PIXEL];

struct darksqstuff
{
  int xloc;
  int yloc;
} dark_squares[MAX_SQUARES];

// codes from bit analysis go here

struct pb_stuff
{
  int rowval;
  int colval;
  int codeval;
} pb_array[MAX_PB];

int bar_cnt;   // count of bars
int pb_index;
int mod_bar_cnt;   // count of bars in a particular module

int b_box_xlen;
int b_box_ylen;
int b_box_maxx;
int b_box_maxy;
int b_box_minx;
int b_box_miny;
float max_theta;	/* Maximum theta range */
int barwidth;

struct barstuff
{
  int beginx;
  int beginy;
  int endx;
  int endy;
  int space_width;  // width of space before bar
  int width;
  int lpixel; 
}  bar_array[MAX_BARS];

struct mbarstuff
{
  int beginx;
  int beginy;
  int endx;
  int endy;
  int space_width;  // width of space before bar
  int width;
  int lpixel; 
}  mod_bar_array[MAX_MOD_BARS];

 int mod_bit_array[40];

struct linesavestuff
{
  int pixelcnt;
  int slope;
  int dir;
  int beginx;
  int beginy;
  int has_8111;   // begin 
  int has_7111;   // end
  int endlpixel;
  int endwidth;    // width of 7 wide end bar
  int beginwidth;   // width of begin 8 wide bar
  int barcnt;
  int bars_found;
  int normal_val;          // find the number of pixels hit by normal
  int line_vals[MAX_LINE_PIXEL];
  int line_x[MAX_LINE_PIXEL];
  int line_y[MAX_LINE_PIXEL];
  struct barstuff tbar[8];
  int fig;
} save_line_data[MAX_LINE_SCANS];

gray **greydata;

int norm_fdark_ind;   // number of pixels before first dark in norm
                      // line between one of the left start bars

int norm_line_data[MAX_LINE_PIXEL];
int normal_x[MAX_LINE_PIXEL];
int normal_y[MAX_LINE_PIXEL];

int post_line_data[MAX_LINE_PIXEL];
int post_x[MAX_LINE_PIXEL];
int post_y[MAX_LINE_PIXEL];

int line_data[MAX_LINE_PIXEL];
int mod_line_data[MAX_MOD_PIXEL];
int temp_data[MAX_LINE_PIXEL];

int line_x[MAX_LINE_PIXEL];
int line_y[MAX_LINE_PIXEL];

int mod_line_x[MAX_MOD_PIXEL];

int est_bar_height;   // estimate of bar height found from diffy
int bar_height;       // best estimate bar height found from hieght of symbol
                      // divided by number rows

// scan global variables

 int pixel_dark( int inx, int iny);
 int Alpha_to[1024];
 int Index_of[1024];
 int powers_of_3[1024];
 int log_of_3[1024];
 int verbose_out;
 int use_image;   // set true if getting bit image from file

 typedef struct raw_code_type {
    int code;
    int row;
    int col;
  } raw_codes_type;

 raw_codes_type raw_codes[MAX_RAW_CODES];
 int total_codes;
 int top_left_corn_x;
 int top_left_corn_y;

 
 int x_width;            // pixel width of scan in x direction
 int y_height;          // pixel height of scan in y direction
 int row_last_code;     // last code in row
 int col_count;
 int pixel_x;
 int pixel_y;
 int expected_cols;
 int col_width;
 float fcol_width;
 int row_height;
 int barcode_height;
 int barcode_width;
 int code_index;
 int code_index_t;      // code_index using t array
 int scan_code_array[128][40];
 int top_data_corner;
 int left_data_corner;
 int left_edge;
 int right_edge;
 int top_edge;
 int bottom_edge;
 int end_bar_found;
 int x_center;
 int y_center;
 int row_rem;
 int synd_array[512];
 int rows_cols[MAX_ROW][MAX_COL];
 int number_of_codes;
 int rows_from_raw;
 int columns_from_raw;
 int byte_compress_mode;
 int text_compress_mode;
 int numeric_compress_mode;
 int code_array[MAX_CODE];
 int code_array_size;
 int byte_array[MAX_BYTE_INDEX];
 struct b913_stuff
  { 
   char str913[20];
  }  byte_913_str[MAX_BYTE_INDEX];

 char punct_chars[32];
 char mixed_chars[32];
 int codes_bc[20];
 int codes_nc[20];
 int codeindex;
 int code;
 int number_check_words;
 int end_found;
 int raw_row_col [90] [100];
 char powers_of_900[16][50];   
 char powers_of_900h[10][50];
 char powers_of_900h_x10[10][50];
 char powers_of_900h_x100[10][50];
 char result[256];
 int data[1024];
 int erase_loc[MAX_RAW_CODES];  // where are the erasures?
 int erase_count;

 

void init_slopes()
{
  slope_array[0] = 0;
  slope_array[1] = 2;
  slope_array[2] = 4;
  slope_array[3] = 6;
  slope_array[4] = 10;
  slope_array[5] = 12;
  slope_array[6] = 14;
  slope_array[7] = 16;
  slope_array[8] = 18;
  slope_array[9] = 20;
  slope_array[10] = 23 ;
  slope_array[11] = 26;
  slope_array[12] = 29;
  slope_array[13] = 32;
  slope_array[14] = 36;
  slope_array[15] = 40;
  slope_array[16] = 44;
  slope_array[17] = 48;
  slope_array[19] = 52;
  slope_array[20] = 56;
  // slope_array[12] = 214;
  // slope_array[13] = 274;
  // slope_array[14] = 373;
}

// find all the squares in the image that are darker than a certain
//  thresshold.  Put the center x,y location of these squares in the 
//  array dark_squares

void find_dark_squares(int x_left, int y_top, int x_size, int y_size)
{

  int ii;
  int jj;
  int debug;
 
  int x_center;
  int y_center;
  int y_tot;
  int xy_tot;
  int y_avg;
  int xy_avg;

  debug = 0;  
  if ( debug )
    {
     printf("In find dark sq , in x,y = %d %d \n",  x_left, y_top);
    }

  xy_tot = 0;
  for(ii = x_left; ii < x_left + x_size; ii += 1)
    {

      y_tot = 0;
      for ( jj = y_top; jj > y_top - y_size; jj -=1 )
        {
          y_tot = y_tot +  pixel_array[ii][jj].greyval;
     
        }
       if ( y_size > 0.0)
	{
         y_avg = y_tot / y_size;
        }
       else
	 {
	   printf("\n y_size not positive = %f \n", y_size);
           exit(0);
         }
       xy_tot = xy_tot + y_avg;
    }

  if ( x_size > 0 )
    {
     xy_avg = xy_tot / x_size;
    }
  else
    {
      printf("\n x_size not positive = %f \n", x_size);
      exit(0);
    }
  

  if ( debug) { printf("xy_avg = %d \n", xy_avg); }

  if ( xy_avg > dark_threshold)
    {
      x_center = x_left + (( x_size) / 2);
      y_center = y_top - ((y_size) / 2);

      if ( dark_sqindex < MAX_SQUARES)
	{
         dark_squares[dark_sqindex].xloc = x_center;
         dark_squares[dark_sqindex].yloc = y_center;
         dark_sqindex += 1;
         if (debug)
	   {
            printf("Found a darks square at = %d %d \n", x_center, y_center );
           }
        }
      else
        {
	  printf("Error: Number of dark boxes too big = %d \n",
		 dark_sqindex);
        }
    }
}

// draw horizontal and vertical lines
//

void draw_pixel_line(int width, int beginx, int beginy, int endx, int endy )
{
  int ii,jj;


  if (( beginx - endx )  == 0)  // vertical
    {
      if ( endy > beginy )          
        {
	  for ( ii = beginy; ii < endy; ii += 1)
	    {
	      for ( jj = 0; jj < width; jj += 1)
                {
		  if (( ii + jj < MAX_Y_PIXEL) && ( beginx < MAX_X_PIXEL))
		    {
		     pixel_array[beginx][ii+jj].greyval = 510;
                    }
                }
            } 
        }
      else
        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区视频在线播放| 成人高清视频在线| 中文字幕亚洲精品在线观看| 欧美第一区第二区| 亚洲国产综合色| 欧美经典一区二区三区| 久久嫩草精品久久久久| 久久综合九色综合97_久久久| 久久亚洲私人国产精品va媚药| 久久综合给合久久狠狠狠97色69| 日韩天堂在线观看| 久久久久久99精品| 亚洲精品va在线观看| 亚洲精品成人天堂一二三| 亚洲裸体在线观看| 青青草伊人久久| 国产高清精品网站| 不卡一区二区中文字幕| 色视频欧美一区二区三区| 91精品福利在线| 欧美精品一区二区高清在线观看 | 无码av中文一区二区三区桃花岛| 中文字幕亚洲一区二区av在线| 日韩毛片一二三区| 国产二区国产一区在线观看| 风间由美中文字幕在线看视频国产欧美| 久久电影网站中文字幕| 粉嫩av一区二区三区| 在线免费观看日本欧美| 欧美高清一级片在线观看| 亚洲丝袜制服诱惑| 国产一区二区91| 欧美一级高清大全免费观看| 亚洲色图色小说| 激情小说亚洲一区| 欧美日韩久久一区| 国产精品久久久久一区| 韩国女主播成人在线观看| 91精品久久久久久蜜臀| 欧美一卡2卡三卡4卡5免费| 精品成人一区二区| 日韩va亚洲va欧美va久久| 日韩一区二区三区免费观看 | 亚洲欧洲无码一区二区三区| 久久精品久久综合| 欧美一区二区三区在| 免费人成在线不卡| 精品捆绑美女sm三区| 免费成人结看片| 精品福利在线导航| 精品一区二区三区在线播放 | 亚洲乱码日产精品bd| 91麻豆6部合集magnet| 亚洲欧美一区二区三区孕妇| 欧美日韩在线观看一区二区| 日本伊人精品一区二区三区观看方式| 欧美在线影院一区二区| 丝袜亚洲另类丝袜在线| 911国产精品| 欧美三电影在线| 美女免费视频一区二区| 久久久精品蜜桃| 欧美日韩在线三区| 亚洲色欲色欲www| 在线观看网站黄不卡| 美日韩一区二区| 国产精品丝袜91| 91精品国产福利| 91成人在线精品| 韩国精品在线观看| 亚洲成人免费在线观看| 中文字幕亚洲综合久久菠萝蜜| 欧美午夜影院一区| 国产精品一品二品| 五月婷婷综合激情| 中文字幕在线不卡一区 | 久久综合色婷婷| 日本高清无吗v一区| 国产伦精品一区二区三区视频青涩 | 日韩欧美在线影院| 欧洲一区二区三区在线| 国产91在线观看丝袜| 国产91精品一区二区麻豆网站| 亚洲影院久久精品| 亚洲伦在线观看| 亚洲免费视频中文字幕| 国产精品日韩成人| 亚洲天堂a在线| 亚洲在线观看免费| 三级影片在线观看欧美日韩一区二区 | 97久久精品人人澡人人爽| 黄色资源网久久资源365| 激情亚洲综合在线| 国产精品一区二区在线看| 大美女一区二区三区| 成人福利在线看| 96av麻豆蜜桃一区二区| 欧美在线观看视频在线| 欧美日韩国产首页在线观看| 日韩限制级电影在线观看| 26uuu精品一区二区三区四区在线| 日韩欧美自拍偷拍| 欧美一级欧美一级在线播放| 国产乱子伦视频一区二区三区| 一本一本大道香蕉久在线精品 | 17c精品麻豆一区二区免费| 国产亚洲美州欧州综合国 | 亚洲大型综合色站| 国精产品一区一区三区mba视频| 国产精品一区二区免费不卡 | 成人av集中营| 欧美日韩国产系列| 国产精品免费久久久久| 一区二区三区小说| 成人一区二区三区| 91精品国产日韩91久久久久久| 国产日韩欧美综合一区| 日韩成人一级片| 91欧美一区二区| 中文在线一区二区 | 在线免费视频一区二区| 久久综合网色—综合色88| 亚洲v日本v欧美v久久精品| 国产不卡视频一区二区三区| 日韩欧美专区在线| 视频一区二区三区入口| 欧美特级限制片免费在线观看| 国产精品久久久久影院老司 | 久久精品综合网| 韩国精品一区二区| 精品乱人伦小说| 韩国v欧美v日本v亚洲v| 26uuu另类欧美亚洲曰本| 日韩福利电影在线| 91精品一区二区三区在线观看| 亚洲永久精品国产| 欧美日韩dvd在线观看| 亚洲尤物在线视频观看| 欧美精品一二三四| 国产一区福利在线| 亚洲三级久久久| 欧美性大战久久久久久久蜜臀| 亚洲图片欧美色图| 欧美精品久久天天躁| 国产福利一区在线观看| 日韩一区在线看| 91精品国产手机| 99久久久精品免费观看国产蜜| 国产精品成人一区二区艾草| 欧美另类高清zo欧美| 国产成人在线网站| 韩国女主播成人在线观看| 国产色产综合产在线视频| 欧美日韩黄视频| 国产一二三精品| 石原莉奈一区二区三区在线观看| 精品国产乱码久久久久久闺蜜| 91丝袜美女网| 成人手机电影网| 毛片av一区二区| 亚洲午夜久久久| 亚洲在线成人精品| 一色屋精品亚洲香蕉网站| 久久亚区不卡日本| 91精品国产色综合久久ai换脸 | 蜜臀久久99精品久久久久宅男 | 在线看国产一区| 国产一区视频网站| 日韩高清不卡在线| 亚洲一区二区三区精品在线| 国产日本欧美一区二区| 日韩欧美在线综合网| 91精品午夜视频| 日韩一级二级三级| 日韩一区二区精品葵司在线| 日韩欧美黄色影院| 91精品国产麻豆| 欧美日韩国产小视频在线观看| 欧美日韩aaaaaa| 欧美一区二区私人影院日本| 欧美日韩成人高清| 精品国产污污免费网站入口 | 91浏览器打开| 色婷婷av一区二区| 日韩视频永久免费| 国产日韩高清在线| 亚洲三级电影全部在线观看高清| 一区二区三区四区视频精品免费 | 亚洲一区二区三区视频在线| 日韩影院免费视频| 国产一区二区三区四区五区美女| 久久精品国产网站| 国产成人免费9x9x人网站视频| 91免费版在线| 国产亚洲自拍一区| 日韩中文字幕不卡| 国产成人免费在线观看| 91国偷自产一区二区使用方法| 欧美日韩亚洲综合一区| 久久久久久亚洲综合影院红桃|