Commit 987b4534 authored by Aylen Ricca's avatar Aylen Ricca
Browse files

camera functions - not file images

parent 980fa06d
#!/bin/sh
cd /home/futbot13/repo-futbot2014/visrob2
rm -rf build
mkdir build
cd build/
......@@ -10,7 +9,7 @@ make
make install
cd /home/futbot13/repo-futbot2014/visrob2/example/IntegradoWEB
cd ../example/IntegradoWEB
rm -rf build
mkdir build
cd build/
......
......@@ -127,7 +127,7 @@ int getConfiguration2(){
*/
int utilBlobs_initialize(){
getConfiguration();
/*if (!(capture = cvCaptureFromCAM(0))){
if (!(capture = cvCaptureFromCAM(0))){
fprintf(stderr, "== ERROR 0 - revisar conexion a camara.\n");
return 0;
}
......@@ -141,10 +141,10 @@ int utilBlobs_initialize(){
return 0;
}
img = cvRetrieveFrame(capture);
*/
img = cvLoadImage(imagen,1);
/*img = cvLoadImage(imagen,1);
imgSize = cvGetSize(img);
frame = cvCreateImage(imgSize, img->depth, img->nChannels);
frame = cvCreateImage(imgSize, img->depth, img->nChannels);*/
frameNumber = 0;
return 1;
......@@ -154,22 +154,22 @@ int utilBlobs_initialize(){
* Elimina las estructuras utilizadas por el modulo.
*/
void utilBlobs_terminate(){
cvReleaseImage(&frame);
// cvReleaseCapture(&capture);
//cvReleaseImage(&frame);
cvReleaseCapture(&capture);
}
/**
* Obtiene un nuevo frame de la camara conectada, retorna -1 si hay algún problema con la lectura desde la camara
*/
int utilBlobs_getFrame(){
/* if (!cvGrabFrame(capture)) {
if (!cvGrabFrame(capture)) {
fprintf(stderr,"== ERROR 1 - revisar conexion a camara. Posible desconexion.\n");
return 0;
}
img = cvRetrieveFrame(capture);
*/
img = cvLoadImage(imagen,1);
cvConvertScale(img, frame, 1, 0);
/* img = cvLoadImage(imagen,1);
cvConvertScale(img, frame, 1, 0);*/
std::stringstream filename;
filename << "IMG" << std::setw(5) << std::setfill('0') << num++ << ".png";
cvSaveImage(filename.str().c_str(),frame);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment