Ask Your Question

Rsousa1980's profile - activity

2017-10-11 11:34:57 -0600 received badge  Notable Question (source)
2016-03-10 13:48:57 -0600 received badge  Popular Question (source)
2013-04-17 01:20:49 -0600 received badge  Student (source)
2013-04-16 11:59:21 -0600 asked a question background_segm.hpp: problem when building openCV code with cmake

Good Afternoon,

I have a small problem when need using cvaux.h, in program C linux.

when execute make give me this next error

In file included from /usr/local/include/opencv/cvaux.h:54:0,
                 from /home/ricardo/OpenCv1/main.c:12:
/usr/local/include/opencv2/video/background_segm.hpp:47:16: fatal error: list: Ficheiro ou directoria inexistente
compilation terminated.
make[2]: *** [CMakeFiles/OpenCV1.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/OpenCV1.dir/all] Error 2
make: *** [all] Error 2

What better way to solve the problem , for I can use the library cvaux.h

I explain in detail

#include <stdio.h>
#include <stdlib.h>
#include<opencv/cv.h>
#include<opencv/highgui.h>
#include <opencv/cvaux.h>


int main(int argc, char** argv) {
    // Open the file "lena.jpg".
    IplImage* img = cvLoadImage("/home/images/_20121212114438.ppm", CV_LOAD_IMAGE_UNCHANGED);
    if (!img) {
        printf("Error: Could not open the image file! \n");
        exit(1);
    }
    cvNamedWindow("Blurred", CV_WINDOW_AUTOSIZE);
    cvShowImage("Blurred", img);
    cvWaitKey(0);
    // Free the resources.
    cvDestroyWindow("Blurred");
    cvReleaseImage( &img );
    return (EXIT_SUCCESS);
}

I use this CmakeList.txt

cmake_minimum_required(VERSION 2.8)
project(OpenCV1)
find_package(OpenCV REQUIRED)
add_executable(OpenCV1 main.c)
target_link_libraries(OpenCV1 ${OpenCV_LIBS})

and when create ccmake create this make file

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
2013-04-10 06:23:02 -0600 received badge  Scholar (source)
2013-04-10 05:06:06 -0600 commented answer error cvaux.h:54:0

Thank you for the reply, The problem is when I declare the library # include "cvaux.h" In this small example if put library as a comment, the program works. If remains using cvaux.h, give me the same compilation errors, I'm using Netbeans and opencv version 2.3.1.7, Certainly, I have to make some changes to get to use the function, but I don't know how .

In file included from /usr/local/include/opencv/cvaux.h:54:0, from main.c:12: /usr/local/include/opencv2/video/background_segm.hpp:47:16: fatal error: list: Ficheiro ou directoria inexistente compilation terminated.

stdio.h stdlib.h opencv/cv.h opencv/highgui.h opencv/cvaux.h

int main(int argc, char** argv) { // Open the file "

2013-04-10 04:17:24 -0600 received badge  Editor (source)
2013-04-10 04:14:44 -0600 asked a question Save Image Sequence real time

Good morning,

     I'm trying to create a small program that allows you to capture frames from 2 to 2 seconds of a web camera in real time.     My code is working, the problem is to record the images, only one image is recorded.     My idea was to have several files stored in the directory of images, with the name years months days hours min sec     It is possible to do this with cvSaveImage, or is otherwise more effective to do this.

sprintf(file,"%s","/home/ricardo/Imagens/");
sprintf(file,"%d%d%d_%d%d%d.pgm\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
cvSaveImage(file, frame,0);



#include stdio.h
#include <stdlib.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include<time.h>


int main() {


char file[256];  


time_t mytime;
mytime = time(NULL);
struct tm tm = *localtime(&mytime);

printf("now: %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);

sprintf(file,"%d%d%d_%d%d%d.pgm\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);

printf("%s",file);

getchar();

   CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
   if ( !capture ) {
     fprintf( stderr, "ERROR: capture is NULL \n" );
     getchar();
     return -1;
   }

   cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE );
   while ( 1 ) {
      IplImage* frame = cvQueryFrame(capture);
     if ( !frame ) {

       fprintf( stderr, "ERROR: frame is null...\n" );
       getchar();
       break;
     }
     cvShowImage( "mywindow", frame );
     sprintf(file,"%s","/home/ricardo/Imagens/");
     sprintf(file,"%d%d%d_%d%d%d.pgm\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
     cvSaveImage(file, frame,0);

     //sleep(2);
     // Do not release the frame!
     //If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version),
     //remove higher bits using AND operator
     if ( (cvWaitKey(10) & 255) == 27 ) break;
   }
   // Release the capture device housekeeping
   cvReleaseCapture( &capture );
   cvDestroyWindow( "mywindow" );
   return 0;
 }
2013-04-09 03:50:24 -0600 asked a question error cvaux.h:54:0

Good morning,

I'm new in using opencv, I am trying to create a little program that needs cvaux.h functions. The problem is giving me the error in the statement of this library. How can I solve this problem, The error I get is the following:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/ricardo/NetBeansProjects/OpenCvDoPca'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/opencvdopca
make[2]: Entering directory `/home/ricardo/NetBeansProjects/OpenCvDoPca'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
gcc    -c -g `pkg-config --cflags opencv`    -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.c
In file included from /usr/local/include/opencv/cvaux.h:54:0,
                 from main.c:12:
/usr/local/include/opencv2/video/background_segm.hpp:47:16: fatal error: list: Ficheiro ou directoria inexistente
compilation terminated.
make[2]: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
make[2]: Leaving directory `/home/ricardo/NetBeansProjects/OpenCvDoPca'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/ricardo/NetBeansProjects/OpenCvDoPca'
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 2s)

Thanks