Ask Your Question

Darius's profile - activity

2014-12-09 14:01:17 -0600 marked best answer Get Mat or vector from CvHaarClassifierCascade

Hi, i'm new to openCV, i'm trying to make simple face recognition program and i was wondering how to get Matrix or vector from this:

pStorageface = cvCreateMemStorage(0);    
        pFaceRectSeq = cvHaarDetectObjects
                (frame, face_cascade, pStorageface,
                1.1,                       
                3,                        
                CV_HAAR_DO_CANNY_PRUNING,  
                cvSize(30,30));

i am interested only in detected image.

2014-05-14 11:53:58 -0600 commented question trying to make face recognition with ANN

im getting these values with one output layer:

0.00310645

0.0036663

0.00303187

0.00387334

0.00420805

0.00306508

0.00303341

0.00389742

if i try making 3 output layers i get error bad argument, that number of columns must be equal to output layer

2014-05-14 10:15:10 -0600 commented question trying to make face recognition with ANN

well lets say its magic :D ok, question: my training labels where 1112233.. and .predict(input,output) output is 0, shouldn't it be value from training labels?

2014-05-14 09:49:14 -0600 commented question trying to make face recognition with ANN

well actually on weights i used Mat::ones. So in the sampleIdx part just leave Mat()? that is quite strange :)

2014-05-14 09:27:39 -0600 commented question trying to make face recognition with ANN

yeah, google knows it all :D i checked that transormation, everything is alight, i guess now just need to make backprop with parameters :) could you explain in human language what sampleIdx should contain? talking about CvANN_MLP::train

2014-05-14 08:59:02 -0600 commented question trying to make face recognition with ANN

lol, i just now sow that i made a mistake in that word :D it should be sluoksniai :D nwm layers = 38416, 300,100,50,1 its random values actualy. but im quite concerned about that CV_32F part, because when i use imshow() the image is almost all white, i wonder does it affect pixel values. and when i use ANN.predict(input.label) (like 10 times with different input) the output doesn't change :(

2014-05-14 08:26:32 -0600 commented question trying to make face recognition with ANN

ok, i guess its working kinda :D i get from .predict(input,label) data i get it by cout<<(int)label.at<float>(0,0) but its always the same result, no matter what is input. i guess i need to edit ANN.train(). btw i was assuming that it would be trained as backprop and not as rprop.

2014-05-14 07:14:37 -0600 commented question trying to make face recognition with ANN

thank you once again :) i will make that ** work :D in this point you deserve a medal for helping me out ;)

2014-05-14 06:50:06 -0600 commented question trying to make face recognition with ANN

how as i thought, i have main function which Creates ANN and trains it (1 time), and i have another function which is in a loop and i want that in there i could use .predict(). so my question: what parameters i should send to my function (which is in a loop) that it could use .predict() ? or maybe i could make ANN global or smth?

2014-05-14 05:41:22 -0600 commented question trying to make face recognition with ANN

ok, so in that case everything should work, but im geting "OpenCV Error: Assertion failed (layer_sizes != 0) in CvANN_MLP::predict, file ........\opencv\modules\ml\src\ann_mlp.cpp, line 1611" could it be that i have created and trained ANN in a void function? i guess no, because i can use .predict

structure main{ void{load images, create/train ANN} void{webcam stream, .predict} }

2014-05-14 05:14:36 -0600 commented question trying to make face recognition with ANN

morning :) well yes my output layer is 1. but i thought label supposed to be the same as in training, now i assume that the predict value will be stored in there?

2014-05-14 04:46:33 -0600 commented question trying to make face recognition with ANN

ok, so found reason for that error, it was my silly mistake, forgot to set correct first layer. now i have another error, is with prediction. so the label is the same

cv::Mat label= cv::Mat(17,1,CV_32F,temp); cv::Mat pazinti(0,38416,CV_32F); tinklas.predict(pazinti,label);

and i get this error: OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)si ze.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channel s()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3 ) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file c:\opencv\build\include\op encv2\core\mat.hpp, line 537

2014-05-13 14:46:21 -0600 commented question trying to make face recognition with ANN

still same error, ill gonna continue tomorrow, and ill post if find anything :) thank you for your help, its getting bit clearer :D

2014-05-13 13:57:46 -0600 commented question trying to make face recognition with ANN

yeah, i did a bit reading bout CV_32F c1 c2 and etc :) ill gona try thank you again :)

2014-05-13 12:56:24 -0600 commented question trying to make face recognition with ANN

and one again i get memory allocation problem. cv::Mat trainData(17,38416,CV_8UC1)// its 17 rows and 38416 columns of grey images 1 row = image
cv::Mat label= cv::Mat(1,17,CV_32S,temp);// temp is int temp[17]; witch contains {0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2} cv::Mat weights= cv::Mat::ones(1,17,CV_32S); tinklas.train(trainData,label,weights);

i tried cv::Mat new; cvtColor(trainData,new,CV_32S);

2014-05-13 11:38:27 -0600 commented question trying to make face recognition with ANN

dude, sry my bad.. didn't sow the "cv::Mat" part. now its seams to run :) thank you so much :)

2014-05-13 11:24:05 -0600 commented question trying to make face recognition with ANN

thank you for quick response. k, ill leave CV_32SC1 part for later. but when i remove & i get "no instance of overloaded function "CvANN_MLP::create"" :( yes :)

2014-05-13 11:08:43 -0600 commented question trying to make face recognition with ANN

can someone explain me why i get memory allocation problem?

int sks[4]={10,10,5,1};
  CvMat skuoksniai= cvMat(1,4,CV_8UC1,sks); // not sure about CV_8UC1 part as well :/
  CvANN_MLP tinklas;
  tinklas.create( &amp;skuoksniai,CvANN_MLP::SIGMOID_SYM,1,1); //problem line.
2014-05-12 12:48:14 -0600 commented question trying to make face recognition with ANN

that post is realy good:) i already made data loading, now just reading the "MLP readymade" to get a grip how its made :)

2014-05-12 10:36:28 -0600 asked a question trying to make face recognition with ANN

Hello, i'm using c++, VS2010, OpenCV 2.4.8. I want to make ANN witch can be trained to separate pictures to different classes (in my case face pictures), and decide if streaming video contains image witch belongs to any class. could you recommend where to start with ANN? how to make training part, or maybe some link to tutoials. i'm using OpenCV face detection program from examples. thank you in advance.

2014-05-11 13:51:00 -0600 commented question FisherFaceRecognizer does it uses ANN

k, that was not what i was expecting, but ty for fast answer :)

2014-05-11 13:07:35 -0600 asked a question FisherFaceRecognizer does it uses ANN

Hello i am using C++, VS2010, and opencv 2.4.8, and i can't find FisherFaceRecognizer documentation, im interested what kind of algorithm does it use? dose it use Artificial Neural Network? if no, is there another Recognizer with does use ANN and where to find documentation on classes and methods. Thank you guys in advance :)

2014-03-26 14:33:28 -0600 commented question OpenCV Error trying print every Mat element

ty guys that worked perfectly :)

2014-03-26 10:22:53 -0600 commented question OpenCV Error trying print every Mat element

maybe there is another way to reach Mat elements?

2014-03-26 10:20:10 -0600 commented question OpenCV Error trying print every Mat element

well thats strange, with <Vec3b> i got sets of RGB collor codes, and with <uchar> i get random values, btw after trying to cout all values i use imshow( "ROI", faceROI ); and i get clear good image...

2014-03-26 09:41:27 -0600 commented question OpenCV Error trying print every Mat element

now program runs through all matrix but results are : ↨↑↑↓↓↑↑↓↓↑↨§▬↨↨↑↨↨↨↨ how could i get int type ?

2014-03-26 09:15:01 -0600 commented question OpenCV Error trying print every Mat element

so yes its CV_8UC1

2014-03-26 09:11:35 -0600 commented question OpenCV Error trying print every Mat element

faceROI.type()

its says 0

2014-03-26 09:08:58 -0600 commented question OpenCV Error trying print every Mat element

code runs for a while and stops at the end, lets say i have image 100x100 and i get error at the end like [30][98]

2014-03-26 09:05:36 -0600 commented question OpenCV Error trying print every Mat element

Mat faceROI = frame_gray( faces[i] );

cout <<"depth: "<<faceROI.depth()<<" chanels: "<<faceROI.channels() depth: 0 chanels: 1;

2014-03-26 07:28:23 -0600 asked a question OpenCV Error trying print every Mat element
for (int k = 0; k < faceROI.rows; k++)
    {
        for (int j = 0; j < faceROI.cols; j++)
        {
          cout<<"["<<k<<","<<j<<"]"<<" element: "<< faceROI.at<Vec3b>(j,k)<<endl;
         }

`at this place i am getting :

OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)si ze.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channel s()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3 ) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file c:\opencv\build\include\op encv2\core\mat.hpp, line 537

its a simple program and i can't print out all elements of image. p.s. i will gona use each and every element.

2014-03-23 11:34:29 -0600 commented answer openCV VideoCapture isOpened() returns false on Android

try checking if lib paths are correct. im talking about correct compiler and debuger setup (i had this problem too, btw i didin't managed to set up OpenCV with Win7 x64 and Visual Studio 2012 and 2010)

2014-03-23 06:22:53 -0600 answered a question openCV VideoCapture isOpened() returns false on Android

hello, did you tried VideoCapture cap(-1) or VideoCapture cap(1)?

2014-03-23 06:17:00 -0600 asked a question cv::Mat output

how to use mat data one by one? i.e.

for (i=0, i<500, i++){
     cout mat[i];
}
2014-01-29 12:53:11 -0600 commented answer OpenCV 2.4.8 cannot load cascade

can't i have <50 points :(

2014-01-29 12:52:13 -0600 received badge  Scholar (source)
2014-01-28 14:23:18 -0600 answered a question OpenCV 2.4.8 cannot load cascade

ok, so after many tries, i found out that the problem was with Linker>Input>Additional Dependencies, when i set correct libs for release and debug, everything worked fine. p.s. i did that on new system, i used Win8 with VS2010.

Thanks everybody for help :)

2014-01-24 05:06:04 -0600 commented question OpenCV 2.4.8 cannot load cascade

JAyThaRevo i tied that already, does not help. I have tried moving "haarcascade_frontalface_alt.xml" everywhere, even tried changing its permissions. Hyo tried double backslashes, single backslashes, double forward slashes, single forward slashes.