示例#1
0
文件: c24.c 项目: helios66/arkhan
main() {

	printf("Screw us all\n");
	long set = negar(100);
	printf("%lu\n", set);
	return 0;
}
示例#2
0
文件: c24.c 项目: helios66/arkhan
negar (long num) {
	if (num == 0) {
		return 1;

	}else{
	return	num*(negar(num-1));
	}
}
示例#3
0
void pracAOC::TODO(){

	cargar();
	negar();
	umbralizar();
	detectarv();
	detectarh();
	recortar();
	matching();

	update();
}
示例#4
0
pracAOC::pracAOC(int argc, char ** argv): QWidget()
{
	mainWin=new QMainForm();
	mainWin->setupUi(this);
	path= new QString (argv[0]);
	path->chop(7);
	ctable.resize(256);
	for(int i=0; i < 256; i++)
		ctable[i] = qRgb(i,i,i);

	imgO=new uchar[320*100]; // matriz de imagen origen
	imgM=new uchar[320*100]; // se usa solo para mostrar datos
	imgD=new uchar[320*100]; // matriz de imagen destino de los procesos

	for (int i=0; i<7;i++)
		imgdigit[i]=new uchar[32*55]; //grupo de siete matrices para matching final

	qimgOrig = new QImage(imgO,320, 100, QImage::Format_Indexed8);
	qimgOrig->setColorTable(ctable);
	qimgOrig->setNumColors(256);

	qimgDest = new QImage(imgM,320, 100, QImage::Format_Indexed8);
	qimgDest->setColorTable(ctable);
	qimgDest->setNumColors(256);

	for (int i=0; i<7; i++){
	qimgDigit[i] = new QImage(imgdigit[i],32, 55, QImage::Format_Indexed8);
	qimgDigit[i]->setColorTable(ctable);
	qimgDigit[i]->setNumColors(256);
	}


    for (int i=0; i<320;i++) Vhor[i]=0; //guarda al integral proyectiva de cada columna

    Hmin=0;  //almacena la fila inferior y superior donde se encuentra los caracteres
    Hmax=0;

    for (int j=0; j<7;j++)
    	for(int i=0; i<32*55;i++)
    		imgdigit[j][i]=0;

	for(int i=0; i<320*100;i++)
	{
		imgO[i]=0;
		imgM[i]=0;
		imgD[i]=0;
	}
    init_digit();
    v=0;

	connect ( mainWin->pushButtonCargar, SIGNAL (clicked()), this, SLOT( cargar() ) );
	connect ( mainWin->pushButtonCopiarO, SIGNAL (clicked()), this, SLOT( copiarOrigen() ) );
	connect ( mainWin->pushButtonCopiarD, SIGNAL (clicked()), this, SLOT( copiarDestino() ) );
	connect ( mainWin->pushButtonBorrar, SIGNAL (clicked()), this, SLOT( borrar() ) );	
	connect ( mainWin->pushButtonNegar, SIGNAL (clicked()), this, SLOT( negar() ) );
	connect ( mainWin->pushButtonUmbralizar, SIGNAL (clicked()), this, SLOT( umbralizar() ) );
	connect ( mainWin->pushButtonDetectarV, SIGNAL (clicked()), this, SLOT( detectarv() ) );
	connect ( mainWin->pushButtonDetectarH, SIGNAL (clicked()), this, SLOT( detectarh() ) );
	connect ( mainWin->pushButtonRecortar, SIGNAL (clicked()), this, SLOT( recortar() ) );
	connect ( mainWin->pushButtonMatching, SIGNAL (clicked()), this, SLOT( matching() ) );
	connect ( mainWin->pushButtonTodo, SIGNAL (clicked()), this, SLOT( TODO() ) );
	connect ( mainWin->pushButtonSalir, SIGNAL (clicked()), this, SLOT( close() ) );

}