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

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

?? frontend.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 sum_array[20000];
 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)
		    {
		     pixel_array[beginx][ii+jj].greyval = 510;
                    }
                }
            } 
        }
      else
        {
          for ( ii = endy; ii < beginy; ii += 1)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线看国产一区| 亚洲成人激情综合网| 亚洲欧洲精品一区二区三区 | 丝袜亚洲另类欧美| 欧美日韩激情一区| 日韩激情一二三区| 精品久久久久av影院| 国产一区二区在线免费观看| 国产日韩欧美一区二区三区综合| 国产激情偷乱视频一区二区三区| 国产精品国产三级国产有无不卡| 在线视频欧美区| 热久久国产精品| 国产欧美一区二区三区在线老狼| 成人av免费网站| 亚洲精品视频在线观看网站| 欧美另类高清zo欧美| 国产一区二区三区在线观看精品| 国产精品久久久久毛片软件| 欧美在线影院一区二区| 久草热8精品视频在线观看| 欧美激情一区不卡| 欧美午夜一区二区| 精品在线免费观看| 亚洲欧洲国产专区| 欧美一区二区视频网站| 丁香啪啪综合成人亚洲小说 | 久久精品国产一区二区三区免费看| 久久综合五月天婷婷伊人| bt7086福利一区国产| 日本亚洲最大的色成网站www| 精品久久久网站| 欧美国产日韩精品免费观看| 日本高清不卡aⅴ免费网站| 久久精品噜噜噜成人av农村| 亚洲欧美日韩小说| 久久久亚洲欧洲日产国码αv| 在线视频国内自拍亚洲视频| 国产一区二区三区av电影| 亚洲国产日韩精品| 欧美高清在线视频| 日韩一级完整毛片| 在线欧美小视频| 丁香另类激情小说| 激情小说欧美图片| 天天色 色综合| 亚洲视频 欧洲视频| 久久影院电视剧免费观看| 欧美日韩性生活| 色诱视频网站一区| www.在线欧美| 国产福利精品一区二区| 另类小说欧美激情| 亚洲一卡二卡三卡四卡无卡久久 | 欧美日本在线播放| 99久久精品国产导航| 国产美女av一区二区三区| 日韩精品电影在线| 亚洲国产精品一区二区久久恐怖片| 久久精品夜色噜噜亚洲aⅴ| 91精品国产综合久久精品图片 | 午夜精品久久久久久久| 91一区二区三区在线观看| 国产乱色国产精品免费视频| 日本亚洲电影天堂| 午夜精品久久久久久久久| 亚洲亚洲人成综合网络| 亚洲自拍偷拍麻豆| **欧美大码日韩| 中文字幕一区视频| 中文字幕制服丝袜成人av| 欧美国产精品一区| 日本一区免费视频| 国产欧美视频一区二区| 久久网站热最新地址| 精品国产乱码久久久久久蜜臀| 欧美一级日韩一级| 91麻豆精品国产91久久久使用方法 | 99精品视频在线观看| yourporn久久国产精品| 99九九99九九九视频精品| 色综合久久久久综合体 | 欧美日韩一区在线观看| 欧美日韩不卡视频| 日韩亚洲欧美在线观看| 精品成人在线观看| 久久精品亚洲国产奇米99| 亚洲国产成人私人影院tom| 国产精品毛片久久久久久| **欧美大码日韩| 亚洲国产一区视频| 欧美三级中文字幕| 91精品国产免费| 欧美一区二区三区免费在线看 | 欧美亚男人的天堂| 欧美女孩性生活视频| 日韩一级欧美一级| 欧美大尺度电影在线| 久久婷婷成人综合色| 国产精品毛片久久久久久久| 亚洲精品老司机| 日本网站在线观看一区二区三区| 韩国av一区二区三区在线观看| 成人影视亚洲图片在线| 一本大道久久a久久综合| 欧美久久久久中文字幕| 日韩欧美卡一卡二| 亚洲欧美综合另类在线卡通| 亚洲国产美女搞黄色| 久久99精品久久久久婷婷| 成人高清视频在线观看| 欧美日韩五月天| 国产日韩三级在线| 午夜精品视频一区| 国产激情一区二区三区四区| 五月天激情小说综合| 国产日韩亚洲欧美综合| 在线播放中文一区| 播五月开心婷婷综合| 久久精品国产免费看久久精品| 国产精品污网站| 日韩女优电影在线观看| 欧美在线影院一区二区| 成人av网站大全| 国产伦精品一区二区三区免费迷| 亚洲在线成人精品| 欧美国产丝袜视频| 日韩精品中文字幕在线不卡尤物| 91视视频在线观看入口直接观看www | 麻豆91精品91久久久的内涵| 亚洲美女免费在线| 久久网站最新地址| 91精品国产91久久久久久最新毛片| 91啪亚洲精品| 高清在线观看日韩| 精品影视av免费| 日本美女视频一区二区| 亚洲最大成人综合| 亚洲免费观看高清| 国产精品狼人久久影院观看方式| 日韩精品一区二| 欧美日韩高清在线播放| 欧美色偷偷大香| 色哟哟一区二区| 色呦呦网站一区| 天天综合色天天| 91天堂素人约啪| 中文字幕精品—区二区四季| 精品一区二区三区日韩| 欧美性猛交xxxxxxxx| 亚洲特级片在线| 成人国产亚洲欧美成人综合网| 精品国产一区二区三区av性色| 亚洲电影视频在线| 日本高清不卡aⅴ免费网站| 亚洲视频 欧洲视频| av午夜一区麻豆| 国产精品伦一区| 成人免费高清视频在线观看| 久久精品亚洲麻豆av一区二区| 狠狠色丁香久久婷婷综合_中| 肉肉av福利一精品导航| 欧美综合久久久| 亚洲国产一区二区视频| 欧美性感一类影片在线播放| 亚洲精品美国一| 欧美综合亚洲图片综合区| 亚洲激情中文1区| 在线观看亚洲一区| 午夜视频一区二区| 91精品久久久久久蜜臀| 日韩精品电影一区亚洲| 欧美一区二区三区系列电影| 日本中文字幕一区二区视频| 91精品国产91久久久久久一区二区 | 日韩午夜激情视频| 日韩高清在线不卡| 欧美一三区三区四区免费在线看| 日韩精品1区2区3区| 欧美电影免费观看完整版| 国产美女视频一区| 中文字幕乱码日本亚洲一区二区| 不卡av在线网| 亚洲最大成人网4388xx| 91精品午夜视频| 久久99精品国产.久久久久| 久久久高清一区二区三区| 成人午夜av电影| 亚洲一区二区在线视频| 欧美福利一区二区| 国产综合色在线| 亚洲同性gay激情无套| 欧美日韩一区二区三区四区| 日韩精品久久理论片| 久久久国产精品不卡| 色妞www精品视频| 蜜乳av一区二区三区| 国产欧美1区2区3区| 色999日韩国产欧美一区二区| 婷婷丁香久久五月婷婷|