Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv to dll p

try to write some opencv

this is what I ended up with very simple but I can seem to get it to run when called externally - can anyone point to where I might be going wrong - tks M

[code]

include "stdafx.h"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include "opencv2/core/core.hpp"

include <iostream>

include <stdio.h>

using namespace std; using namespace cv;

extern "C" {

_declspec (dllexport) double adaptiveThreshold(unsigned __int8 *Igray, unsigned __int8 *Iat, double fixed_threshold, int adaptive_method, int threshold_type, int block_size, double offset);

} //extern "C"

_declspec (dllexport) double adaptiveThreshold(unsigned __int8 *Igray, unsigned __int8 *Iat, double fixed_threshold, int adaptive_method, int threshold_type, int block_size, double offset) {
// allocate memory for example for Mat // Mat src_baseR(rows,cols,CV_8U,&base_imageR[0]);

fixed_threshold = 255;
threshold_type = 0; //fixed_threshold invert(0=off|1=on)
adaptive_method = 0; //adaptive_type(0=mean|1=gaussian) use gaussion looks interesting  

block_size = 17;
offset = 10;

//Mat Iat;  
// Use the Adaptive method for testing 
adaptiveThreshold(Igray,Iat,fixed_threshold,adaptive_method,threshold_type,block_size,offset);

return 0;

}; [/code]

opencv to dll p

try to write some opencv

this is what I ended up with very simple but I can can't seem to get it to run when called externally - can anyone point to where I might be going wrong - tks M

[code]

include "stdafx.h"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include "opencv2/core/core.hpp"

include <iostream>

include <stdio.h>

using namespace std; using namespace cv;

extern "C" {

_declspec (dllexport) double adaptiveThreshold(unsigned __int8 *Igray, unsigned __int8 *Iat, double fixed_threshold, int adaptive_method, int threshold_type, int block_size, double offset);

} //extern "C"

_declspec (dllexport) double adaptiveThreshold(unsigned __int8 *Igray, unsigned __int8 *Iat, double fixed_threshold, int adaptive_method, int threshold_type, int block_size, double offset) {
// allocate memory for example for Mat // Mat src_baseR(rows,cols,CV_8U,&base_imageR[0]);

fixed_threshold = 255; threshold_type = 0; //fixed_threshold invert(0=off|1=on) adaptive_method = 0; //adaptive_type(0=mean|1=gaussian) use gaussion looks interesting

block_size = 17; offset = 10; 10;

//Mat Iat;
// Use the Adaptive method for testing adaptiveThreshold(Igray,Iat,fixed_threshold,adaptive_method,threshold_type,block_size,offset); adaptiveThreshold(Igray,Iat,fixed_threshold,adaptive_method,threshold_type,block_size,offset);

return 0; 0;
};

}; [/code]

click to hide/show revision 3
No.3 Revision

updated 2014-04-11 07:11:26 -0600

berak gravatar image

opencv to dll p

try to write some opencv

this is what I ended up with very simple but I can't seem to get it to run when called externally - can anyone point to where I might be going wrong - tks M

include "stdafx.h"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include "opencv2/core/core.hpp"

include <iostream>

include <stdio.h>

#include "stdafx.h" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/core/core.hpp" #include <iostream> #include <stdio.h> using namespace std; using namespace cv;

cv; extern "C" {

{ _declspec (dllexport) double adaptiveThreshold(unsigned __int8 *Igray, unsigned __int8 *Iat, double fixed_threshold, int adaptive_method, int threshold_type, int block_size, double offset);

offset); } //extern "C"

"C" _declspec (dllexport) double adaptiveThreshold(unsigned __int8 *Igray, unsigned __int8 *Iat, double fixed_threshold, int adaptive_method, int threshold_type, int block_size, double offset) {
// allocate memory for example for Mat // Mat src_baseR(rows,cols,CV_8U,&base_imageR[0]);

src_baseR(rows,cols,CV_8U,&base_imageR[0]); fixed_threshold = 255; threshold_type = 0; //fixed_threshold invert(0=off|1=on) adaptive_method = 0; //adaptive_type(0=mean|1=gaussian) use gaussion looks interesting

block_size = 17; offset = 10;

10; //Mat Iat;
// Use the Adaptive method for testing adaptiveThreshold(Igray,Iat,fixed_threshold,adaptive_method,threshold_type,block_size,offset);

adaptiveThreshold(Igray,Iat,fixed_threshold,adaptive_method,threshold_type,block_size,offset); return 0;
};