Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: Comparing a name inputted against a database of names Pin
jschell2-Nov-13 6:49
jschell2-Nov-13 6:49 
AnswerRe: Comparing a name inputted against a database of names Pin
PIEBALDconsult4-Nov-13 4:11
mvePIEBALDconsult4-Nov-13 4:11 
Questionsingle chat TCP, Console C# Pin
Member 103468781-Nov-13 19:01
Member 103468781-Nov-13 19:01 
AnswerRe: single chat TCP, Console C# Pin
Mycroft Holmes1-Nov-13 22:10
professionalMycroft Holmes1-Nov-13 22:10 
GeneralRe: single chat TCP, Console C# Pin
Dave Kreskowiak2-Nov-13 9:12
mveDave Kreskowiak2-Nov-13 9:12 
QuestionPage_init with variable Pin
vkEE1-Nov-13 8:14
vkEE1-Nov-13 8:14 
SuggestionRe: Page_init with variable Pin
Matt T Heffron1-Nov-13 13:25
professionalMatt T Heffron1-Nov-13 13:25 
QuestionI have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert1-Nov-13 6:50
josephdalebert1-Nov-13 6:50 
when i try to run the code it always return only a black screen..

here's the code..

C#
        private CvCapture VideoCapture;
        private IplImage frame;
        private IplImage imgMain;

private void btnVideo_Click(object sender, EventArgs e)
        {
            //double vidWidth, vidHeight;

            if (btnVideo.Text.Equals("Start Video"))
            {
                trainData();

                videoCapture = highgui.CvCreateCameraCapture(0);

                if (videoCapture.ptr == IntPtr.Zero)
                {
                    MessageBox.Show("Failed");
                    return;
                }

                btnVideo.Text = "Stop Video";

                //highgui.CvSetCaptureProperty(ref videoCapture, highgui.CV_CAP_PROP_FRAME_WIDTH, 640);
                //highgui.CvSetCaptureProperty(ref videoCapture, highgui.CV_CAP_PROP_FRAME_HEIGHT, 320);

                highgui.CvQueryFrame(ref videoCapture);

                //vidWidth = highgui.cvGetCaptureProperty(videoCapture, highgui.CV_CAP_PROP_FRAME_WIDTH);
                //vidHeight = highgui.cvGetCaptureProperty(videoCapture, highgui.CV_CAP_PROP_FRAME_HEIGHT);

                //CamImageBox.Width = (int)vidWidth;
                //CamImageBox.Height = (int)vidHeight;

                timerGrab.Interval = 45;
                timerFPS.Interval = 1100;
                timerGrab.Enabled = true;
                timerFPS.Enabled = true;

                hc = new HaarCascade(this);
                abs = new AbsoluteDiff(this);
            }

            else
            {
                btnVideo.Text = "Start Video";
                timerFPS.Enabled = false;
                timerGrab.Enabled = false;

                if (videoCapture.ptr != IntPtr.Zero)
                {
                    highgui.CvReleaseCapture(ref videoCapture);
                    videoCapture.ptr = IntPtr.Zero;
                }
            }
        }



C#
private void timerGrab_Tick(object sender, EventArgs e)
{
    frame = highgui.CvQueryFrame(ref VideoCapture);

    if (frame.ptr == IntPtr.Zero)
    {
        timerGrab.Stop();
        MessageBox.Show("Invalid");
        return;
    }

    imgMain = cxcore.CvCreateImage(cxcore.CvGetSize(ref frame), 8, 3);

    cxcore.CvCopy(ref frame, ref imgMain);
    cxcore.CvFlip(ref imgMain, 0);


    pictureBox1.Image = highgui.ToBitmap(imgMain, false);

    cxcore.CvReleaseImage(ref imgMain);

}

AnswerRe: I have a problem regarding my project. thanks for answering this :)) Pin
Richard Andrew x641-Nov-13 13:50
professionalRichard Andrew x641-Nov-13 13:50 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert2-Nov-13 22:13
josephdalebert2-Nov-13 22:13 
AnswerRe: I have a problem regarding my project. thanks for answering this :)) Pin
Richard Andrew x643-Nov-13 13:18
professionalRichard Andrew x643-Nov-13 13:18 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert5-Nov-13 15:26
josephdalebert5-Nov-13 15:26 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
Richard Andrew x645-Nov-13 18:10
professionalRichard Andrew x645-Nov-13 18:10 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert5-Nov-13 19:14
josephdalebert5-Nov-13 19:14 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert5-Nov-13 22:45
josephdalebert5-Nov-13 22:45 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
Richard Andrew x646-Nov-13 3:32
professionalRichard Andrew x646-Nov-13 3:32 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert6-Nov-13 4:02
josephdalebert6-Nov-13 4:02 
GeneralRe: I have a problem regarding my project. thanks for answering this :)) Pin
josephdalebert6-Nov-13 19:28
josephdalebert6-Nov-13 19:28 
QuestionHow can I open a pipeline (exchange shell) with different credentials? Pin
turbosupramk31-Nov-13 4:09
turbosupramk31-Nov-13 4:09 
AnswerRe: How can I open a pipeline (exchange shell) with different credentials? Pin
turbosupramk31-Nov-13 6:37
turbosupramk31-Nov-13 6:37 
GeneralRe: How can I open a pipeline (exchange shell) with different credentials? Pin
Simon_Whale1-Nov-13 6:50
Simon_Whale1-Nov-13 6:50 
GeneralRe: How can I open a pipeline (exchange shell) with different credentials? Pin
turbosupramk31-Nov-13 6:59
turbosupramk31-Nov-13 6:59 
GeneralRe: How can I open a pipeline (exchange shell) with different credentials? Pin
Simon_Whale1-Nov-13 7:24
Simon_Whale1-Nov-13 7:24 
GeneralRe: How can I open a pipeline (exchange shell) with different credentials? Pin
turbosupramk31-Nov-13 7:32
turbosupramk31-Nov-13 7:32 
GeneralRe: How can I open a pipeline (exchange shell) with different credentials? Pin
turbosupramk31-Nov-13 8:27
turbosupramk31-Nov-13 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.