Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to write Pyhton wrapper

I have no idea to create a python wrapper file for my source code, Any one of the expert can provide me a solution

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int my(Mat image)
{
   cv::Mat out; 
   int z1=10;
    if(! image.data )                                          // Check for invalid input
   {
       cout <<  "Could not open or find the image" << std::endl ;  
   }
  cvtColor(image, out,COLOR_BGR2GRAY);
  imshow( "Display window", out);                   // Show our image inside it.
  waitKey(0);                                                // Wait for a keystroke in the window
    return z1;
}
click to hide/show revision 2
retagged

updated 2015-03-09 11:24:53 -0600

berak gravatar image

How to write Pyhton wrapper

I have no idea to create a python wrapper file for my source code, Any one of the expert can provide me a solution

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int my(Mat image)
{
   cv::Mat out; 
   int z1=10;
    if(! image.data )                                          // Check for invalid input
   {
       cout <<  "Could not open or find the image" << std::endl ;  
   }
  cvtColor(image, out,COLOR_BGR2GRAY);
  imshow( "Display window", out);                   // Show our image inside it.
  waitKey(0);                                                // Wait for a keystroke in the window
    return z1;
}