Ask Your Question

kodasbatt's profile - activity

2017-12-13 07:51:37 -0600 received badge  Notable Question (source)
2016-09-02 17:16:42 -0600 received badge  Popular Question (source)
2015-02-21 09:04:31 -0600 commented question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

i managed to: problem was .open(-1) i've set that to.open(0) and it works fine!

thank you berak for all of your help

2015-02-21 05:52:32 -0600 commented question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

thanks once again. this solved the problem. and sorry for yesterday(i was exausted :D) -the error was pretty obvious as you said..

I'm now having problems again with the videoCapture though >.< in fact doing

VideoCapture capture;
capture.open(-1);
if (capture.isOpened())

does not enter the body of the if cycle.

2015-02-21 05:51:40 -0600 answered a question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

thanks once again. this solved the problem. and sorry for yesterday(i was exausted :D) -the error was pretty obvious as you said..

I'm now having problems again with the videoCapture though >.< in fact doing

VideoCapture capture;
capture.open(-1);
if (capture.isOpened())

does not enter the body of the if cycle.

2015-02-20 11:41:56 -0600 commented question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

berak please help

2015-02-20 05:48:24 -0600 commented question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

lol.. PLEASE tell me because i'm litteraly going crazy with this code and can't look at it no more

2015-02-20 05:23:37 -0600 commented question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

hello berak,you were correct! i managed to compile it finally. THANK YOU the struggle though is not over as i get the following messages in the terminal Compilation OK. Creating machine code... Code generating 'detectAndDisplay()' Linking... Linking OK. Finished compiling (0.21+0.22=0.42 sec) and linking (0.59 sec). 11:21:19 Build Finished (took 1s.822ms) <terminanted> --(!)Error loading

have you got any clue of what this mught be? thank you!

2015-02-16 10:31:17 -0600 commented question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

thank you so much for your reply. you're right, it's not givin me that error no more.

although... it is now saying that CV_BGR2GRAY , CV_HAAR_SCALE_IMAGE and CV_HAAR_SCALE_IMAGE use undeclared identifiers. I know these aren't declared but aren't they contained in the included libraries? also could you explain you very correct previous solution please?

2015-02-15 14:48:52 -0600 asked a question undeclared indentifier opencv cvCaptureFromCAM and cvQueryFrame

I'm pretty new to openCv and C++ in general.

I cannot undestand why I get a undeclared identifier on the cvCaptureFromCAM and from cvQueryFrame

Do you get this type of error when the function is not included into a library? If so, aren't these two functions included into those i include?

My code is

#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

 /** Function Headers */
 void detectAndDisplay( Mat frame );

  /** Global variables */
  String face_cascade_name = "haarcascade_frontalface_alt.xml";
  String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml";
  CascadeClassifier face_cascade;
  CascadeClassifier eyes_cascade;
  string window_name = "Capture - Face detection";
  RNG rng(12345);

  /** @function main */
  int main( int argc, const char** argv )
  {
    CvCapture* capture;
    Mat frame;

    //-- 1. Load the cascades
    if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error      loading\n"); return -1; };    //carica nome face_cascade &      eyes_cascade da file xml in CascadeClassifier
    if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error      loading\n"); return -1; };

    //-- 2. Read the video stream
    capture = cvCaptureFromCAM(-1); //legge da camera
    if( capture )
    {
      while( true )
      {
    frame = cvQueryFrame( capture ); //assegna frame

    //-- 3. Apply the classifier to the frame
        if( !frame.empty() )
        { detectAndDisplay( frame ); }
        else
        { printf(" --(!) No captured frame -- Break!"); break; }

        int c = waitKey(10);
        if( (char)c == 'c' ) { break; }
       }
    }
    return 0;
  }

 /** @function detectAndDisplay */
 void detectAndDisplay( Mat frame ) //Mat is the struct that divides      image in 24x24
 {
     //able to store a single instance of  primitive data type is Vec.      Multiple instances Vec can be stored in std::vector, Mat
   std::vector<Rect> faces; //creates rectangular conteiner of info of      faces
   Mat frame_gray; //creates mat container of std vec

   cvtColor( frame, frame_gray, CV_BGR2GRAY ); //void           cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0 ) Converts an image from one color space to another
  equalizeHist( frame_gray, frame_gray );   
 face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) ); 
 for( size_t i = 0; i < faces.size(); i++ )
 {
    Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 ); //define center for each investigated area
   ellipse( frame, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );

   Mat faceROI = frame_gray( faces[i] );
   std::vector<Rect> eyes;

   //-- In each face, detect eyes
   eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) );

   for( size_t j = 0; j < eyes.size(); j++ )
    {
       Point center( faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5 );
   int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 );
   circle( frame, center, radius, Scalar( 255, 0, 0 ), 4, 8, 0 );
 }
 }
  //-- Show what you got
   imshow( window_name, frame );
}

please someone help

2015-02-07 13:18:10 -0600 received badge  Editor (source)
2015-02-07 12:52:57 -0600 asked a question Debugging Settings for openCV project on VisualStudio 2013 [x64 machine]

My computer is x64bit so when setting the libraries and headers i would pass through opencv/build/x64/.. directory

it would display errors in the code

i so changed all of the settings to opencv/build/x86/.. and got no errors in the code

trying to debug, a window appears saying that it's impossible to start the program because "opencv_highgui2410.dll" is missing in th computer. i assured that i was importing this file when importing the .lib files imported in both PropertySheet_Release and _Debug > Linker>Input

in the IDE's terminal the output i get these error messages 'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. The program '[7084] ConsoleApplication2.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'.

but checking in the directory i find those files..

what should i do to get the code working?

thank you in advance for the help :)