Ask Your Question

monev's profile - activity

2015-01-10 09:20:05 -0600 received badge  Enthusiast
2015-01-06 18:26:42 -0600 commented question OpenCv Form Application Release

I was write about clr project in VS 2013

2015-01-06 14:13:05 -0600 received badge  Editor (source)
2015-01-06 13:20:31 -0600 asked a question OpenCv Form Application Release

I wonder is it possible to build windows form application with opencv static library? I know how do this with console application (like in this thread using static libraries instead of dynamic libraries in opencv ), but when we use windows form we can't use MTd Runtime Library (only MD) But when we use MD Runtime Library then we can't use .lib library, only .dll. Am i right? I hope that somebody can help me:)

2015-01-05 09:40:34 -0600 received badge  Necromancer (source)
2015-01-05 09:40:34 -0600 received badge  Self-Learner (source)
2015-01-05 09:26:39 -0600 answered a question Webcam and IP cam recording with openCv

The answer is very very easy... camera is old and not very good. That how thdrksdfthmn said this cam from time to time send empty frames. I change camera and problem is solved.

2015-01-05 09:26:39 -0600 asked a question OpenCV form application- convert Mat to Grayscale

I have question which is theoretically very easy but... only theoretically :) I want to convert Mat frame image to gray scale. I know that i shoud use something like this:

cv::cvtColor(frameA1, grayImageA1, CV_BGR2GRAY);

But the result is this

image description

I don't know why i have 3 images in one after convert to grayscale. This is part of my code:

  private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
    BackgroundWorker^ worker = dynamic_cast<BackgroundWorker^>(sender);
    capture1.open(1);
    while (camStatus1){
        if (camBusy1) continue;
        capture1.read(frameA1);
        if (frameA1.empty()) continue;
        cv::cvtColor(frameA1, grayImageA1, CV_BGR2GRAY);
        worker->ReportProgress(1);
    }
}


  private: System::Void backgroundWorker1_ProgressChanged(System::Object^  sender, System::ComponentModel::ProgressChangedEventArgs^  e) {
    if (!camBusy1){
        camBusy1 = 1;
        System::Drawing::Graphics^ graphics = imageBox1->CreateGraphics();
        System::IntPtr ptr(frameA1.ptr());
        System::Drawing::Bitmap^ b = gcnew System::Drawing::Bitmap(frameA1.cols, frameA1.rows, frameA1.step, System::Drawing::Imaging::PixelFormat::Format24bppRgb, ptr);
        System::Drawing::RectangleF rect(0, 0, imageBox1->Width, imageBox1->Height);
        graphics->DrawImage(b, rect);
        if (debugA){
            System::Drawing::Graphics^ graphics = imageBox3->CreateGraphics();
            System::IntPtr ptr(grayImageA1.ptr());
            System::Drawing::Bitmap^ b = gcnew System::Drawing::Bitmap(grayImageA1.cols, grayImageA1.rows, grayImageA1.step, System::Drawing::Imaging::PixelFormat::Format24bppRgb, ptr);
            System::Drawing::RectangleF rect(0, 0, imageBox3->Width, imageBox3->Height);
            graphics->DrawImage(b, rect);
        }
        camBusy1 = 0;
    }
}

Any ideas why it work like that? I hope that you can help me with this theoretically easy issue

2014-12-02 15:07:50 -0600 commented question Webcam and IP cam recording with openCv

But even i write sth like this:

const std::string videoStreamAddress = "http://.........../img/video.mjpeg";

cv::VideoCapture camera0(0);

cv::VideoCapture camera1(videoStreamAddress);

it still doesn't work. It's compilate, run and working for while but then it crash with this error "Unhandled exception at 0x757EC42D in iptest.exe: Microsoft C++ exception: cv::Exception at memory location 0x003AF768."

2014-12-01 19:24:30 -0600 asked a question Webcam and IP cam recording with openCv

i have a problem with capture frames from 2 different cameras in the same time. I know that is probably impossible (or it's quite difficult) to connect in this way 2 USB cams, but connecting one USB cam and one IPcam maybe is easier. Of course if they works separatly i don't have problems. For example this code doesn't work:

int main() {

const std::string videoStreamAddress = "http://........../img/video.mjpeg";
cv::VideoCapture camera0(0);
cv::VideoCapture camera1(1);
camera0.open(videoStreamAddress);
cv::Mat3b frame0;
cv::Mat3b frame1;
while (true) {
    camera0 >> frame0;
    camera1 >> frame1;
    cv::imshow("Video0", frame0);
    cv::imshow("Video1", frame1);
    int c = cvWaitKey(40);
    if (27 == char(c)) break;
}

return 0;
}

I hope that anybody can help me