Search Results

Search found 340 results on 14 pages for 'opencv'.

Page 5/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • OpenCV to use in memory buffers or file pointers

    - by The Unknown
    The two functions in openCV cvLoadImage and cvSaveImage accept file path's as arguments. For example, when saving a image it's cvSaveImage("/tmp/output.jpg", dstIpl) and it writes on the disk. Is there any way to feed this a buffer already in memory? So instead of a disk write, the output image will be in memory. I would also like to know this for both cvSaveImage and cvLoadImage (read and write to memory buffers). Thanks! My goal is to store the Encoded (jpeg) version of the file in Memory. Same goes to cvLoadImage, I want to load a jpeg that's in memory in to the IplImage format.

    Read the article

  • openCV usage cvFindDominantPoints

    - by rsinha
    Hi, Does anyone know how to use the cvFindDominantPoints API of openCV? I basically have a 1 channel, binary image from which I get a set of contours. Judging from the image, I seem to be getting the correct contours. Now, I am selecting one of these contours to get dominant points of. This contour has about 60 vertices. However, the API call to cvFindDominantPoints is giving me a sequence of points (about 15) that does not even lie on the contour. It is quite far from it. Any insight? my usage: CvSeq *dominantpoints = cvFindDominantPoints(targetSeq, tristorage, CV_DOMINANT_IPAN, 7, 9, 9, 150);

    Read the article

  • OpenCv QT CvNamedWindow IplImage not working

    - by Shahzaib
    I have problem with displaying Cam on QTLabel using openCV, Every thing is working fine . except one . I have to call function from open === cvNamedWindow() == in order for program to work properly . its displaying the webcam on the QLabel no problem but if i don't call the cvNamedWindow function then the program is just hanging its just keep displaying the camera which are working on the screen but i can't click on any thing else its getting freeze. doest any one has any idea why its happening and what i am doing wrong ?

    Read the article

  • Visual c++ opencv 2.1 contains()

    - by kaushalyjain
    how to check whether a given point is contained in a rectangle using the contains() function in Rect_ construct... Please give me the exact function and its parameters.Like when i type this Point b(2,2); Rect a(10,10,50,50); cout<< Rect_::contains(b); There is a compile error saying 1c:\users\kaushal\documents\visual studio 2008\projects\test1\test1.cpp(23) : error C2352: 'cv::Rect_<Tp::contains' : illegal call of non-static member function 1c:\opencv2.1\include\opencv\cxcore.hpp(385) : see declaration of 'cv::Rect<_Tp::contains'

    Read the article

  • read successive frames OpenCV using cvQueryframe

    - by AtharvaI
    Hi all I have a basic question in regards to cvQueryFrame() in OpenCV. I have the following code: IplImage *frame1,*frame2; frame1 = cvQueryFrame(capture); frame2 = cvQueryFrame(capture); Now my question is: if frame1 is a pointer to the first frame, is frame2 a pointer to the 2nd frame? So will the two cvQueryFrame() calls read successive frames? I thought I'd check myself first but the pointers frame1,frame2 seem to have the same hex value. :s I just need to capture two frames at a time and then need to process them. Thanks in advance

    Read the article

  • Stack around variable corrupted when using cvBlobsLib (OpenCV)

    - by jpromvi
    I am trying to do simple image processing with OpenCV and the cvBlobsLib in Visual C++ 2008, and I get an error message when I try to create a CBlobResult object IplImage* original = cvLoadImage("pic6.png",0); cvThreshold(original, original, 100, 255, CV_THRESH_BINARY); CBlobResult blobs = CBlobResult(original, NULL, 255); The message is the following: Run-Time Check Failure #2 - Stack around the variable blobs was corrupted Why does this happen? How should I create this object? Thank you very much for your help.

    Read the article

  • OpenCV (c++) multi channel element access

    - by Vic
    I'm trying to use the "new" 2.0 c++ version of OpenCV, but everything is else like in simple C version. I have some problem with changing the values in image. The image is CV_8UC3. for (int i=0; i<image.rows; i++) { for (int j=0; j<image.cols; j++) { if (someArray[i][j] == 0) { image.at<Vec3i>(i,j)[0] = 0; image.at<Vec3i>(i,j)[1] = 0; image.at<Vec3i>(i,j)[2] = 0; } } } It's not working. What am I doing wrong??? Thank you!

    Read the article

  • Compare images after canny edge detection in OpenCV (C++)

    - by typoknig
    Hi all, I am working on an OpenCV project and I need to compare some images after canny has been applied to both of them. Before the canny was applied I had the gray scale images populating a histogram and then I compared the histograms, but when canny is added to the images the histogram does not populate. I have read that a canny image can populate a histogram, but have not found a way to make it happen. I do not necessairly need to keep using the histograms, I just want to know the best way to compare two canny images. SSCCE below for you to chew on. I have poached and patched about 75% of this code from books and various sites on the internet, so props to those guys... // SLC (Histogram).cpp : Defines the entry point for the console application. #include "stdafx.h" #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h> #include <stdio.h> #include <sstream> #include <iostream> using namespace std; IplImage* image1= 0; IplImage* imgHistogram1 = 0; IplImage* gray1= 0; CvHistogram* hist1; int main(){ CvCapture* capture = cvCaptureFromCAM(0); if(!cvQueryFrame(capture)){ cout<<"Video capture failed, please check the camera."<<endl; } else{ cout<<"Video camera capture successful!"<<endl; }; CvSize sz = cvGetSize(cvQueryFrame(capture)); IplImage* image = cvCreateImage(sz, 8, 3); IplImage* imgHistogram = 0; IplImage* gray = 0; CvHistogram* hist; cvNamedWindow("Image Source",1); cvNamedWindow("gray", 1); cvNamedWindow("Histogram",1); cvNamedWindow("BG", 1); cvNamedWindow("FG", 1); cvNamedWindow("Canny",1); cvNamedWindow("Canny1", 1); image1 = cvLoadImage("image bin/use this image.jpg");// an image has to load here or the program will not run //size of the histogram -1D histogram int bins1 = 256; int hsize1[] = {bins1}; //max and min value of the histogram float max_value1 = 0, min_value1 = 0; //value and normalized value float value1; int normalized1; //ranges - grayscale 0 to 256 float xranges1[] = { 0, 256 }; float* ranges1[] = { xranges1 }; //create an 8 bit single channel image to hold a //grayscale version of the original picture gray1 = cvCreateImage( cvGetSize(image1), 8, 1 ); cvCvtColor( image1, gray1, CV_BGR2GRAY ); IplImage* canny1 = cvCreateImage(cvGetSize(gray1), 8, 1 ); cvCanny( gray1, canny1, 55, 175, 3 ); //Create 3 windows to show the results cvNamedWindow("original1",1); cvNamedWindow("gray1",1); cvNamedWindow("histogram1",1); //planes to obtain the histogram, in this case just one IplImage* planes1[] = { canny1 }; //get the histogram and some info about it hist1 = cvCreateHist( 1, hsize1, CV_HIST_ARRAY, ranges1,1); cvCalcHist( planes1, hist1, 0, NULL); cvGetMinMaxHistValue( hist1, &min_value1, &max_value1); printf("min: %f, max: %f\n", min_value1, max_value1); //create an 8 bits single channel image to hold the histogram //paint it white imgHistogram1 = cvCreateImage(cvSize(bins1, 50),8,1); cvRectangle(imgHistogram1, cvPoint(0,0), cvPoint(256,50), CV_RGB(255,255,255),-1); //draw the histogram :P for(int i=0; i < bins1; i++){ value1 = cvQueryHistValue_1D( hist1, i); normalized1 = cvRound(value1*50/max_value1); cvLine(imgHistogram1,cvPoint(i,50), cvPoint(i,50-normalized1), CV_RGB(0,0,0)); } //show the image results cvShowImage( "original1", image1 ); cvShowImage( "gray1", gray1 ); cvShowImage( "histogram1", imgHistogram1 ); cvShowImage( "Canny1", canny1); CvBGStatModel* bg_model = cvCreateFGDStatModel( image ); for(;;){ image = cvQueryFrame(capture); cvUpdateBGStatModel( image, bg_model ); //Size of the histogram -1D histogram int bins = 256; int hsize[] = {bins}; //Max and min value of the histogram float max_value = 0, min_value = 0; //Value and normalized value float value; int normalized; //Ranges - grayscale 0 to 256 float xranges[] = {0, 256}; float* ranges[] = {xranges}; //Create an 8 bit single channel image to hold a grayscale version of the original picture gray = cvCreateImage(cvGetSize(image), 8, 1); cvCvtColor(image, gray, CV_BGR2GRAY); IplImage* canny = cvCreateImage(cvGetSize(gray), 8, 1 ); cvCanny( gray, canny, 55, 175, 3 );//55, 175, 3 with direct light //Planes to obtain the histogram, in this case just one IplImage* planes[] = {canny}; //Get the histogram and some info about it hist = cvCreateHist(1, hsize, CV_HIST_ARRAY, ranges,1); cvCalcHist(planes, hist, 0, NULL); cvGetMinMaxHistValue(hist, &min_value, &max_value); //printf("Minimum Histogram Value: %f, Maximum Histogram Value: %f\n", min_value, max_value); //Create an 8 bits single channel image to hold the histogram and paint it white imgHistogram = cvCreateImage(cvSize(bins, 50),8,3); cvRectangle(imgHistogram, cvPoint(0,0), cvPoint(256,50), CV_RGB(255,255,255),-1); //Draw the histogram for(int i=0; i < bins; i++){ value = cvQueryHistValue_1D(hist, i); normalized = cvRound(value*50/max_value); cvLine(imgHistogram,cvPoint(i,50), cvPoint(i,50-normalized), CV_RGB(0,0,0)); } double correlation = cvCompareHist (hist1, hist, CV_COMP_CORREL); double chisquare = cvCompareHist (hist1, hist, CV_COMP_CHISQR); double intersection = cvCompareHist (hist1, hist, CV_COMP_INTERSECT); double bhattacharyya = cvCompareHist (hist1, hist, CV_COMP_BHATTACHARYYA); double difference = (1 - correlation) + chisquare + (1 - intersection) + bhattacharyya; printf("correlation: %f\n", correlation); printf("chi-square: %f\n", chisquare); printf("intersection: %f\n", intersection); printf("bhattacharyya: %f\n", bhattacharyya); printf("difference: %f\n", difference); cvShowImage("Image Source", image); cvShowImage("gray", gray); cvShowImage("Histogram", imgHistogram); cvShowImage( "Canny", canny); cvShowImage("BG", bg_model->background); cvShowImage("FG", bg_model->foreground); //Page 19 paragraph 3 of "Learning OpenCV" tells us why we DO NOT use "cvReleaseImage(&image)" in this section cvReleaseImage(&imgHistogram); cvReleaseImage(&gray); cvReleaseHist(&hist); cvReleaseImage(&canny); char c = cvWaitKey(10); //if ASCII key 27 (esc) is pressed then loop breaks if(c==27) break; } cvReleaseBGStatModel( &bg_model ); cvReleaseImage(&image); cvReleaseCapture(&capture); cvDestroyAllWindows(); }

    Read the article

  • OpenCV Mat creation memory leak

    - by Royi Freifeld
    My memory is getting full fairly quick once using the next piece of code. Valgrind shows a memory leak, but everything is allocated on stack and (supposed to be) freed once the function ends. void mult_run_time(int rows, int cols) { Mat matrix(rows,cols,CV_32SC1); Mat row_vec(cols,1,CV_32SC1); /* initialize vector and matrix */ for (int col = 0; col < cols; ++col) { for (int row = 0; row < rows; ++row) { matrix.at<unsigned long>(row,col) = rand() % ULONG_MAX; } row_vec.at<unsigned long>(1,col) = rand() % ULONG_MAX; } /* end initialization of vector and matrix*/ matrix*row_vec; } int main() { for (int row = 0; row < 20; ++row) { for (int col = 0; col < 20; ++col) { mult_run_time(row,col); } } return 0; } Valgrind shows that there is a memory leak in line Mat row_vec(cols,1,CV_32CS1): ==9201== 24,320 bytes in 380 blocks are definitely lost in loss record 50 of 50 ==9201== at 0x4026864: malloc (vg_replace_malloc.c:236) ==9201== by 0x40C0A8B: cv::fastMalloc(unsigned int) (in /usr/local/lib/libopencv_core.so.2.3.1) ==9201== by 0x41914E3: cv::Mat::create(int, int const*, int) (in /usr/local/lib/libopencv_core.so.2.3.1) ==9201== by 0x8048BE4: cv::Mat::create(int, int, int) (mat.hpp:368) ==9201== by 0x8048B2A: cv::Mat::Mat(int, int, int) (mat.hpp:68) ==9201== by 0x80488B0: mult_run_time(int, int) (mat_by_vec_mult.cpp:26) ==9201== by 0x80489F5: main (mat_by_vec_mult.cpp:59) Is it a known bug in OpenCV or am I missing something?

    Read the article

  • OpenCV Video capture and fps problem

    - by Andrea Girardi
    Hi to all, I'm capturing video from my webcam using OpenCV on MacOSX. It works fine but when I try to play on QuickTime my captured video it plays too fast. i.e. I capture from camera for 10 seconds but when I play on QuickTime the video is 2 seconds. I've tried to change fps from 25 to 10 and It's works quite fine, but I'm sure it's not the correct process: CvVideoWriter *writer = 0; int isColor = 1; int fps = 25; int frameW = 640; // 744 for firewire cameras int frameH = 480; // 480 for firewire cameras The problem is that for now I've to capture with WebCam but the real pourpose of program is to capture image from any external source connected to my Mac. I'm using this code to capture: for (;;) { cvGrabFrame(capture) image = cvRetrieveFrame(capture); cvWriteFrame( writer, image ); } Any hint? I'm also showing webcam output on cvNamedWindow, how can I improve quality in this windows? thanks a lot to all! Andrea!

    Read the article

  • Eigenvector computation using OpenCV

    - by Andriyev
    Hi I have this matrix A, representing similarities of pixel intensities of an image. For example: Consider a 10 x 10 image. Matrix A in this case would be of dimension 100 x 100, and element A(i,j) would have a value in the range 0 to 1, representing the similarity of pixel i to j in terms of intensity. I am using OpenCV for image processing and the development environment is C on Linux. Objective is to compute the Eigenvectors of matrix A and I have used the following approach: static CvMat mat, *eigenVec, *eigenVal; static double A[100][100]={}, Ain1D[10000]={}; int cnt=0; //Converting matrix A into a one dimensional array //Reason: That is how cvMat requires it for(i = 0;i < affnDim;i++){ for(j = 0;j < affnDim;j++){ Ain1D[cnt++] = A[i][j]; } } mat = cvMat(100, 100, CV_32FC1, Ain1D); cvEigenVV(&mat, eigenVec, eigenVal, 1e-300); for(i=0;i < 100;i++){ val1 = cvmGet(eigenVal,i,0); //Fetching Eigen Value for(j=0;j < 100;j++){ matX[i][j] = cvmGet(eigenVec,i,j); //Fetching each component of Eigenvector i } } Problem: After execution I get nearly all components of all the Eigenvectors to be zero. I tried different images and also tried populating A with random values between 0 and 1, but the same result. Few of the top eigenvalues returned look like the following: 9805401476911479666115491135488.000000 -9805401476911479666115491135488.000000 -89222871725331592641813413888.000000 89222862280598626902522986496.000000 5255391142666987110400.000000 I am now thinking on the lines of using cvSVD() which performs singular value decomposition of real floating-point matrix and might yield me the eigenvectors. But before that I thought of asking it here. Is there anything absurd in my current approach? Am I using the right API i.e. cvEigenVV() for the right input matrix (my matrix A is a floating point matrix)? cheers

    Read the article

  • OpenCV to JNI how to make it work?

    - by padfoot-4444
    I am tring to use opencv and java for face detection, and in that pursit i found this "JNI2OPENCV" file....but i am confused on how to make it work, can anyone help me? http://img519.imageshack.us/img519/4803/askaj.jpg and the following is the FaceDetection.java `class JNIOpenCV { static { System.loadLibrary("JNI2OpenCV"); } public native int[] detectFace(int minFaceWidth, int minFaceHeight, String cascade, String filename); } public class FaceDetection { private JNIOpenCV myJNIOpenCV; private FaceDetection myFaceDetection; public FaceDetection() { myJNIOpenCV = new JNIOpenCV(); String filename = "lena.jpg"; String cascade = "haarcascade_frontalface_alt.xml"; int[] detectedFaces = myJNIOpenCV.detectFace(40, 40, cascade, filename); int numFaces = detectedFaces.length / 4; System.out.println("numFaces = " + numFaces); for (int i = 0; i < numFaces; i++) { System.out.println("Face " + i + ": " + detectedFaces[4 * i + 0] + " " + detectedFaces[4 * i + 1] + " " + detectedFaces[4 * i + 2] + " " + detectedFaces[4 * i + 3]); } } public static void main(String args[]) { FaceDetection myFaceDetection = new FaceDetection(); } }` CAn anyone tell me how can i make this work on Netbeans?? I tried Google but help on this particular topic is very meger. I have added the whole folder as Llibrary in netbeans project and whe i try to run the file i get the followig wrroes. Exception in thread "main" java.lang.UnsatisfiedLinkError: FaceDetection.JNIOpenCV.detectFace(IILjava/lang/String;Ljava/lang/String;)[I at FaceDetection.JNIOpenCV.detectFace(Native Method) at FaceDetection.FaceDetection.<init>(FaceDetection.java:19) at FaceDetection.FaceDetection.main(FaceDetection.java:29) Java Result: 1 BUILD SUCCESSFUL (total time: 2 seconds) CAn anyone tell me the exact way to work with this? like what all i have to do?

    Read the article

  • OpenCV to JNI how to make it work?

    - by user293252
    I am tring to use opencv and java for face detection, and in that pursit i found this "JNI2OPENCV" file....but i am confused on how to make it work, can anyone help me? http://img519.imageshack.us/img519/4803/askaj.jpg and the following is the FaceDetection.java class JNIOpenCV { static { System.loadLibrary("JNI2OpenCV"); } public native int[] detectFace(int minFaceWidth, int minFaceHeight, String cascade, String filename); } public class FaceDetection { private JNIOpenCV myJNIOpenCV; private FaceDetection myFaceDetection; public FaceDetection() { myJNIOpenCV = new JNIOpenCV(); String filename = "lena.jpg"; String cascade = "haarcascade_frontalface_alt.xml"; int[] detectedFaces = myJNIOpenCV.detectFace(40, 40, cascade, filename); int numFaces = detectedFaces.length / 4; System.out.println("numFaces = " + numFaces); for (int i = 0; i < numFaces; i++) { System.out.println("Face " + i + ": " + detectedFaces[4 * i + 0] + " " + detectedFaces[4 * i + 1] + " " + detectedFaces[4 * i + 2] + " " + detectedFaces[4 * i + 3]); } } public static void main(String args[]) { FaceDetection myFaceDetection = new FaceDetection(); } } CAn anyone tell me how can i make this work on Netbeans?? I tried Google but help on this particular topic is very meger. I have added the whole folder as Llibrary in netbeans project and whe i try to run the file i get the followig wrroes. Exception in thread "main" java.lang.UnsatisfiedLinkError: FaceDetection.JNIOpenCV.detectFace(IILjava/lang/String;Ljava/lang/String;)[I at FaceDetection.JNIOpenCV.detectFace(Native Method) at FaceDetection.FaceDetection.<init>(FaceDetection.java:19) at FaceDetection.FaceDetection.main(FaceDetection.java:29) Java Result: 1 BUILD SUCCESSFUL (total time: 2 seconds) CAn anyone tell me the exact way to work with this? like what all i have to do?

    Read the article

  • OpenCV shape matching

    - by MAckerman
    I'm new to OpenCV (am actually using Emgu CV C# wrapper) and am attempting to do some object detection. I'm attempting to determine if an object matches a predefined set of objects (that I will have to define). The background is well lit and does not move. My objects that I am starting with are bottles and cans. My current approach is: Do absDiff with a previously taken background image to separate the background. Then dilate 4x to make the lighter areas (in labels) shrink. Then I do a binary threshold to get a big blog, followed by finding contours in this image. I then take the largest contour and draw it, which becomes my shape to either save to the accepted set or compare with the accepted set. Currently I'm using cvMatchShapes, but the double return value seems to vary widely. I'm guessing it is because it doesn't take into account rotation. Is this approach a good one? It isn't working well for glass bottles since the edges are hard to find... I've read about haar classifiers, but thinking that might be overkill for my task.

    Read the article

  • Trying to write a video file using OpenCV

    - by Ted pottel
    Hi , I’m trying to use OpenCV to write a video file. I have a simple program that loads frames from a video file then accepts to save them At first the cvCreateVideoWrite always return NULL. I got a answer from your group saying it returns separate images and to try to change the file name to test0001.png, this worked. But now the cvWriteFrame function always fails, the code is CString path; path="d:\\mice\\Test_Day26_2.avi"; CvCapture* capture = cvCaptureFromAVI(path); IplImage* img = 0; CvVideoWriter *writer = 0; int isColor = 1; int fps = 25; // or 30 int frameW = 640; // 744 for firewire cameras int frameH = 480; // 480 for firewire cameras writer=cvCreateVideoWriter("d:\\mice\\test0001.png",CV_FOURCC('P','I','M','1'), fps,cvSize(frameW,frameH),isColor); if (writer==0) MessageBox("could not open writter"); int nFrames = 50; for(int i=0;i<nFrames;i++){ if (!cvGrabFrame(capture)) MessageBox("could not grab frame"); img=cvRetrieveFrame(capture); // retrieve the captured frame if (img==0) MessageBox("could not retrive data"); if (!cvWriteFrame(writer,img) ) MessageBox("could not write frame"); } cvReleaseVideoWriter(&writer); Any help would be GREAT - Ted

    Read the article

  • Creating new image in a loop using OpenCV

    - by user565415
    I am programing some image conversion code with OpenCV and I don't know how can I create image memory buffer to load image on every iteration. I have number of iteration (maxImNumber) and I have an input image. In every loop program must create image that is resized and modified input image. Here is some basic code (concept). for (int imageIndex = 0; imageIndex < maxImNumber; imageIndex++){ cvCopy(inputImage, images[imageIndex], 0); cvReleaseImage(&inputImage); images[imageIndex+1] = cvCreateImage(cvSize((image[imageIndex]->width)/2, image[imageIndex]->height), IPL_DEPTH_8U, 1); for (i=1; i < image[imageIndex]->height; i++) { index = 0; // for(j=0; j < image[imageIndex]->width ; j=j+2){ // doing some basic matematical operation on image content and store it to new image images[imageIndex+1][i][index] = (image[imageIndex][i][j] + image[imageIndex][i][j+2])/2; index++ } } inputImage = cvCreateImage(cvSize((image[imageIndex+1]->width), image[imageIndex]->height), IPL_DEPTH_8U, 1); cvCopy(images[imageIndex+1], inputImage, 0); } Can somebody, please, explain how can I create this image buffer (images[]) and allocate memory for it. Also how can I access any image in this buffer? Thank you very much in advance!

    Read the article

  • Opencv video frame not showing Sobel output

    - by user1016950
    This is a continuation question from Opencv video frame giving me an error I think I closed it off, Im new to Stackoverflow. I have code below that Im trying to see its Sobel edge image. However the program runs but the output is just a grey screen where if I mouseover the cursor disappears. Does anyone see the error? or is it a misunderstanding about the data structures Im using IplImage *frame, *frame_copy = 0; // capture frames from video CvCapture *capture = cvCaptureFromFile( "lightinbox1.avi"); //Allows Access to video propertys cvQueryFrame(capture); //Get the number of frames int nframe=(int) cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT); //Name window cvNamedWindow( "video:", 1 ); //start loop for(int i=0;i<nframe;i++){ //prepare capture frame extraction cvGrabFrame(capture); cout<<"We are on frame "<<i<<"\n"; //Get this frame frame = cvRetrieveFrame( capture ); con2txt(frame); frame_copy = cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,frame->nChannels ); //show and destroy frame cvCvtColor( frame,frame,CV_RGB2GRAY); //Create Sobel output frame_copy1 = cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_16S,1 ); cvSobel(frame_copy,frame_copy1,2,2,3); cvShowImage("video:",frame_copy1); cvWaitKey(33);} cvReleaseCapture(&capture);

    Read the article

  • Runtime unhandled exception while executing facedetect.py in opencv

    - by Rupesh Chavan
    When i tried to execute facedetect.py python script from opencv sample example i got the following runtime exception. Can someone please give me some pointer or some clue about the exception and why it is encountering? Here is the stack trace : 'python.exe': Loaded 'C:\Python26\python.exe' 'python.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\python26.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\user32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\shell32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll' 'python.exe': Loaded 'C:\WINDOWS\WinSxS \x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e\msvcr90.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\imm32.dll' 'python.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll' 'python.exe': Loaded 'C:\Python26\Lib\site-packages\opencv_cv.pyd', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libcv200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libcxcore200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\Python26\Lib\site-packages\opencv_ml.pyd', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libml200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\Python26\Lib\site-packages\opencv_highgui.pyd', Binary was not built with debug information. 'python.exe': Loaded 'C:\OpenCV2.0\bin\libhighgui200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\WINDOWS\system32\ole32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\avicap32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\winmm.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\version.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msvfw32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\avifil32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msacm32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\msctf.dll' 'python.exe': Loaded 'C:\OpenCV2.0\bin\libopencv_ffmpeg200.dll', Binary was not built with debug information. 'python.exe': Loaded 'C:\WINDOWS\system32\wsock32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll' 'python.exe': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME' Unhandled exception at 0x00e7e4e4 in python.exe: 0xC0000005: Access violation reading location 0xffffffff. Thanks a lot in advance, Rupesh Chavan

    Read the article

  • OpenCV/EmguCV face recognition

    - by Meko
    Hi .I am tying to make app that detect face and recognize it. I made Face detection but I want some idea to when making recognition. I using web cam for tracking and It can recognize face.Then I am taking only part of face to an new gray image and comparing it using EigenObjectRecognizer with list of images in database.But it is not giving good result.Some times find some thing wrong,some times nothing.I want to ask that for comparing photos which additional techniques i must implement?Like Histogram equalization or resolution of faces equalization ?

    Read the article

  • Hough transformation for iris detection in opencv

    - by iva123
    Hi, I wrote the code for iris detection and it works well. Also I can crop the eye location of a face. Now I want to detect the iris of the crop image with applying the Hough transformation(cvHoughCircle). However when I try this procedure, the system is not able to find any circle on the image. Maybe, the reason is, there are noises in the image but I don't think it's the reason. So, how can I detect the iris ? I have the code of binary thresholding maybe I can use it, but I don't know how to do ?? If anyone helps I really appreciated. thx :)

    Read the article

  • Compressing IplImage to JPEG using libjpeg in OpenCV

    - by Petar
    Hi everybody. So I have this problem. I have an IplImage that i want to compress to JPEG and do something with it. I use libjpeg. I found a lot of answers "read through examples and docs" and such and did that. And successfully written a function for that. FILE* convert2jpeg(IplImage* frame) { FILE* outstream = NULL; outstream=malloc(frame-imageSize*frame-nChannels*sizeof(char)) unsigned char *outdata = (uchar *) frame->imageData; struct jpeg_error_mgr jerr; struct jpeg_compress_struct cinfo; int row_stride; JSAMPROW row_ptr[1]; jpeg_create_compress(&cinfo); jpeg_stdio_dest(&cinfo, outstream); cinfo.image_width = frame->width; cinfo.image_height = frame->height; cinfo.input_components = frame->nChannels; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); jpeg_start_compress(&cinfo, TRUE); row_stride = frame->width * frame->nChannels; while (cinfo.next_scanline < cinfo.image_height) { row_ptr[0] = &outdata[cinfo.next_scanline * row_stride]; jpeg_write_scanlines(&cinfo, row_ptr, 1); } jpeg_finish_compress(&cinfo); jpeg_destroy_compress(&cinfo); return outstream; } Now this function is straight from the examples (except the part of allocating memory, but i need that since i'm not writnig to a file), but it still doesn't work. It dies on jpeg_start_compress(&cinfo, TRUE); part? Can anybody help?

    Read the article

  • Calculating skew of text OpenCV

    - by Nick
    I am trying to calculate the skew of text in an image so I can correct it for the best OCR results. Currently this is the function I am using: double compute_skew(Mat &img) { // Binarize cv::threshold(img, img, 225, 255, cv::THRESH_BINARY); // Invert colors cv::bitwise_not(img, img); cv::Mat element = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(5, 3)); cv::erode(img, img, element); std::vector<cv::Point> points; cv::Mat_<uchar>::iterator it = img.begin<uchar>(); cv::Mat_<uchar>::iterator end = img.end<uchar>(); for (; it != end; ++it) if (*it) points.push_back(it.pos()); cv::RotatedRect box = cv::minAreaRect(cv::Mat(points)); double angle = box.angle; if (angle < -45.) angle += 90.; cv::Point2f vertices[4]; box.points(vertices); for(int i = 0; i < 4; ++i) cv::line(img, vertices[i], vertices[(i + 1) % 4], cv::Scalar(255, 0, 0), 1, CV_AA); return angle; } When I look at then angle in debug I get 0.000000 However when I give it this image I get proper results of a skew of about 16 degrees: How can I properly detect the skew in the first image?

    Read the article

  • OpenCV's cvKMeans2 - chosing clusters

    - by Goffrey
    Hi, I'm using cvKMeans2 for clustering, but I'm not sure, how it works in general - the part of choosing clusters. I thought that it set the first positions of clusters from given samples. So it means that in the end of clustering process would every cluster has at least one sample - in the output array of cluster labels will be full range of numbers (for 100 clusters - numbers 0 to 99). But as I checked output labels, I realised that some labels weren't used at all and only some were used. So, does anyone know, how it works? Or how should I use the parameters of cvKMeans2 to do what I want (cause I'm not sure if I use them right)? I'm using cvKMeans2 function also with optional parameters: cvKMeans2(descriptorMat, N_CLUSTERS, clusterLabels, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0), 1, 0, 0, clusterCenters, 0) Thanks for any advices!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >