Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Problems with cvSobel and cvLaplace functions under visual studio 2010

Problems with cvSobel and cvLaplace functions under visual studio 2010

Scheduled Pinned Locked Moved ATL / WTL / STL
helpvisual-studiocsharpc++performance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A Ms
    wrote on last edited by
    #1

    Hi, I have downloaded OpenCV 2.2.0 distribution for visual studio 2010 and as i started programming with the opencv APIs under VS 2010 I faced a terrible problem. cvSobel and cvLaplace functions always throw cv::Exceptions and also their exceptions could have not been handled with try ... catch blocks. the provided error is: Unhandled exception at 0x7463b727 in App.exe: Microsoft C++ exception: cv::Exception at memory location 0x003bfb9c. and here is my code:

    IplImage* pImage = cvLoadImage("..\\Tulips.jpg");

    IplImage\* pImage1 = cvCreateImage(
    	cvSize(pImage->width, pImage->height),
    	pImage->depth,
    	pImage->nChannels
    	);
    
    IplImage\* pImage2 = cvCreateImage(
    	cvSize(pImage->width, pImage->height),
    	pImage->depth,
    	pImage->nChannels
    	);
    	
    cvSobel(pImage, pImage1, 0, 1, 2);
    cvLaplace( pImage, pImage2);
    
    
    cvNamedWindow("Image", CV\_WINDOW\_AUTOSIZE);
    cvShowImage("Image", pImage);
    
    cvNamedWindow("Image1", CV\_WINDOW\_AUTOSIZE);
    cvShowImage("Image1", pImage1);
    
    cvNamedWindow("Image2", CV\_WINDOW\_AUTOSIZE);
    cvShowImage("Image2", pImage2);
    
    cvWaitKey(0);
    

    please, help me if I am forgetting sth.

    R 1 Reply Last reply
    0
    • A A Ms

      Hi, I have downloaded OpenCV 2.2.0 distribution for visual studio 2010 and as i started programming with the opencv APIs under VS 2010 I faced a terrible problem. cvSobel and cvLaplace functions always throw cv::Exceptions and also their exceptions could have not been handled with try ... catch blocks. the provided error is: Unhandled exception at 0x7463b727 in App.exe: Microsoft C++ exception: cv::Exception at memory location 0x003bfb9c. and here is my code:

      IplImage* pImage = cvLoadImage("..\\Tulips.jpg");

      IplImage\* pImage1 = cvCreateImage(
      	cvSize(pImage->width, pImage->height),
      	pImage->depth,
      	pImage->nChannels
      	);
      
      IplImage\* pImage2 = cvCreateImage(
      	cvSize(pImage->width, pImage->height),
      	pImage->depth,
      	pImage->nChannels
      	);
      	
      cvSobel(pImage, pImage1, 0, 1, 2);
      cvLaplace( pImage, pImage2);
      
      
      cvNamedWindow("Image", CV\_WINDOW\_AUTOSIZE);
      cvShowImage("Image", pImage);
      
      cvNamedWindow("Image1", CV\_WINDOW\_AUTOSIZE);
      cvShowImage("Image1", pImage1);
      
      cvNamedWindow("Image2", CV\_WINDOW\_AUTOSIZE);
      cvShowImage("Image2", pImage2);
      
      cvWaitKey(0);
      

      please, help me if I am forgetting sth.

      R Offline
      R Offline
      RockwoodGuitar
      wrote on last edited by
      #2

      You cannot use any type of images with a sobel operator. If you use a 8U image as the source then the destination image needs to be 16S (not even 16U) because of some overflow issue then you can transform if back to 8U at will.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups