Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
how do Conert Code C++ to C# ? ( OPEN CV ===> EMGU CV)



C++
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <cmath>

using namespace std;

#define blue  CV_RGB(0,0,255)
#define green CV_RGB(0,255,0)
#define red   CV_RGB(255,0,0)
#define white CV_RGB(255,255,255)
#define black CV_RGB(0,0,0)

void ClearScreen(IplImage* imgScribble, IplImage* imgDrawing)
{
    cvSet(imgScribble, black);
    cvSet(imgDrawing, white);
}



C++
IplImage* GetThresholdedImage(IplImage* img, CvScalar& lowerBound, CvScalar& upperBound)
{
    // Convert the image into an HSV image
    IplImage* imgHSV = cvCreateImage(cvGetSize(img), 8, 3);
    cvCvtColor(img, imgHSV, CV_BGR2HSV);

    IplImage* imgThreshed = cvCreateImage(cvGetSize(img), 8, 1);

    cvInRangeS(imgHSV, lowerBound, upperBound, imgThreshed);

    cvReleaseImage(&imgHSV);
    return imgThreshed;
}







Tutorial:
http://www.emgu.com/wiki/index.php/Tutorial[^]
Posted
Updated 5-Jun-13 21:49pm
v6

1 solution

Do not convert. Rewrite. You have found the tutorial. You probably have the documentation on OpenCV. The .net edition is well documented: http://www.emgu.com/wiki/files/2.3.0/document/Index.html[^], and self-documenting also.
So, go ahead and do it.
 
Share this answer
 
Comments
goldpower 6-Jun-13 4:42am    
please help me to Rewrite !!!!
Zoltán Zörgő 6-Jun-13 5:03am    
How? What is the problem you are facing? What have you tried?
"I can't" is a problem, but not of a kind we can deal with.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900