Ask Your Question

Icetray's profile - activity

2020-09-04 00:15:32 -0600 received badge  Famous Question (source)
2020-07-07 16:36:51 -0600 received badge  Famous Question (source)
2018-09-09 13:30:31 -0600 received badge  Notable Question (source)
2018-08-06 09:16:15 -0600 received badge  Notable Question (source)
2018-08-03 13:01:27 -0600 received badge  Notable Question (source)
2018-02-07 12:20:13 -0600 received badge  Notable Question (source)
2018-01-30 00:58:48 -0600 received badge  Popular Question (source)
2017-08-14 14:22:43 -0600 received badge  Popular Question (source)
2017-07-28 13:58:56 -0600 received badge  Popular Question (source)
2017-07-19 15:16:33 -0600 received badge  Popular Question (source)
2017-04-13 05:06:41 -0600 received badge  Famous Question (source)
2016-06-10 03:13:55 -0600 received badge  Notable Question (source)
2016-01-11 11:25:46 -0600 received badge  Popular Question (source)
2015-03-07 04:44:29 -0600 received badge  Editor (source)
2015-03-07 04:35:26 -0600 commented question Stitching Video Stream

Hi Ribs,

Would you happen to have a video recording of what's happening? Perhaps you can send me your code and we can see how we can take mine and yours to produce a decent result. :)

2015-03-07 04:32:29 -0600 asked a question Error: Expression: _BLOCK_TYPE_IS_VALID(pHead -> nBlockUse)

Hi guys,

I have a simple program that does stitching and the code I've used mainly comes from here. When complied on it's own, the program runs fine but when I embed it into a Windows Form and run the same code in a background worker, I get the following error:


Edit: This is another error that accompanies it. Also caused by the line highlighted below Error 2

I have slowly worked through the code and it seems that the error is triggered when it reaches the following line:

            cv::Mat homography = cv::findHomography(framePoints, stitchedPoints, CV_RANSAC);


std::vector <cv::Point2f> stitchedPoints, framePoints; where data is from goodMatches

for (size_t i = 0; i < goodMatches.size(); i++)
            //-- Get the keypoints from the good matches

I thank you guys in advance for taking the time to read my post and in assisting me with this.

2015-01-09 10:21:04 -0600 commented question Showing Mat image in Picturebox

Hi Steven! Thanks for helping me out with this.

Is there a way to fix this? I'm new to C++/CLI coding and Windows Forms. I read that Mat images can only be converted to bitmap if they are in CV_8UC3 format so I tried doing a frame.convertTo(frameDisplay, CV_8UC3). It worked for 2 images but then suddenly stopped working all together.

I apologize if I'm missing what you're trying to say completely. I'm new to C++, OpenCV and especially Windows Forms. I've done all my C++/OpenCV codes. Now I'm just left with making everything more visually appealing with a proper GUI.

Once again, thanks for your help!

2015-01-09 01:00:48 -0600 received badge  Enthusiast
2015-01-08 07:55:20 -0600 asked a question Showing Mat image in Picturebox

Hi guys,

I'm attempting to create a GUI for my project and I am having issues displaying the output in the GUI picturebox. I used the following function I found online to convert the Mat image to bitmap:

void DrawCVImage(System::Windows::Forms::Control^ control, cv::Mat& colorImage)
    System::Drawing::Graphics^ graphics = control->CreateGraphics();
    System::IntPtr ptr(colorImage.ptr());
    System::Drawing::Bitmap^ b = gcnew System::Drawing::Bitmap(colorImage.cols, colorImage.rows, colorImage.step, System::Drawing::Imaging::PixelFormat::Format24bppRgb, ptr);
    System::Drawing::RectangleF rect(0, 0, control->Width, control->Height);
    graphics->DrawImage(b, rect);

I then just did a simple:

                frame = imread("C:\\Users\\xxx\\Pictures\\picture.jpg");

but only a tiny bit of the picture appears as shown here:

Thanks in advance!

2014-12-30 21:36:55 -0600 commented question Stitching Video Stream

My algorithm is actually very similar to the one you posted just that when used for video stitching, at certain frames the image is warped and at other times it warps back. I think I found away to ignore certain stitches by looking for any warping in the homography and so far it looks...okay. fingers crossed

Now I just have an issue pushing back my stitched image as my first image for stitching. For some reason after awhile it just stops and there is a weird black box appearing in my stitched image. Here's a video of what's going on:

Previous Frame: Frame1 plus whatever has been stitched Current Frame: Current Video frame Stitched: Current Stitched Image

Thanks so much for your help. :)

2014-12-30 00:28:17 -0600 commented question Stitching Video Stream

I'm not getting any errors. Right now it stitches well with the first frame of the image until it runs out of common features to match with. i.e. frame1 stitches with "capture.grab()" until it runs out of features. This shows that my stitching algorithm works.

To continue the stitching process, I'll need to feed back the stitched image back into the loop but I'm having huge problems doing this as at times, the image can be warped. In essence, what I'm trying to achieve is this: Outputting one smooth stitched image in the end.

2014-12-29 07:01:56 -0600 asked a question Stitching Video Stream

Hi guys,

I'm attempting to stitch the following video stream (

I've used SURF and homographs to carry out the stitching and this part is going well. However, I'm having issues knowing when to push back my stitched image into the loop to carry on stitching for the whole video.

frame2: current video frame stitched: stitched image (also frame1 at the start)

the loop: stitched + frame2 = stitched

Thanks in advance guys!

2014-12-09 14:13:08 -0600 marked best answer Convex Hull for Added Contours

Hi Guys.

Is it possible to detect a drawn convex hull that resides in another? If a convex hull is drawn inside a smaller one, I want to ignore it and only keep the bigger one.

Is there a way to do this?

2014-12-09 13:05:32 -0600 marked best answer OpenCV Window Resize with Trackbar

Hi Guys,

I have set my windows to CV_WINDOW_NORMAL but whenever I add a track-bar to a window, it expends that window to the full width and I cannot re-size properly. It can be re sized vertically and slightly horizontally till the end of the slider. Is there anyway around it? Perhaps limiting the max length of the slider or having the slider automatically re-size to the window width?

An example:

    namedWindow("Threshold", CV_WINDOW_NORMAL);
    createTrackbar("Min", "Threshold", &threshMin, 255, on_trackbar);
    imshow("Threshold", imageThresh);

And this is what I get: See image:

If it helps, I'm using Visual Studio 2013 running on Windows 7. When the trackbar is removed from the window, it can be re-sized normally.

Thanks in advance!

2014-12-03 04:59:02 -0600 marked best answer C++ Function Declaration for Matrix

Hi Guys,

I tend to write my functions at the end of my main functions. I'm having a little trouble making my function declarations a little neater.

Lets say my function is:

void function(int height, int width, Mat matrix, Mat  matrix2, string stringName){

I tried declaring

void function(int, int, Mat, Mat, string);

but this doesn't work. How do you put the argument for a matrix?

Thanks in advance guys!

2014-12-03 04:58:43 -0600 commented answer C++ Function Declaration for Matrix

Just wanted to drop you guys an update. Worked for me on another program I was working on. Strange. Must have been Visual Studio being difficult.

2014-12-03 04:53:04 -0600 asked a question Stitching from single camera live stream

Hi guys,

I'm attempting to stitch a live stream. I have a single camera that moves slowly and I want to output a stitched image. Here's what I attempted:

    while (1){
    capture >> frame;
    stitcher.stitch(inputStream, outputImage);
    if (!Stitcher::OK)
        cout << "Can't stitch images" << endl;
        return -1;

    imshow("Main", frame);
    imshow("Stitched", outputImage);

It keeps crashing though. :( Any suggestions? :)

Thanks in advance!

2014-10-04 07:43:12 -0600 asked a question Camera calibration xml file

Hi Guys,

I've generated the camera calibration xml file from the sample code provided. How can I implement this into my current project?

I've been googling but haven't been able to find a clear tutorial guide for implementation. The projects I wish to implement them in are both real-time ones.

Using C++ and Visual Studio 2013.

Thanks in advance!

2014-09-23 22:37:16 -0600 received badge  Student (source)
2014-09-23 21:25:19 -0600 commented answer Drawing Houghlines until they intersect with another

Would it be possible to apply the same techniques even if my lines aren't straight? Perhaps a lower number of voting points or something? I'm looking to get a clear canny edge using this.

2014-09-23 20:18:26 -0600 asked a question Drawing Houghlines until they intersect with another

Hi Guys,

I'm looking to draw houghlines from my canny edge image.

I'm looking to fill in gaps. So the line should be drawn until it hits another white pixel or until it hits a max length.

Is this possible?

2014-09-21 07:40:31 -0600 commented answer Convex Hull for Added Contours

I found a way to solve the problem. Thanks for all your help though! Really appreciate it!

2014-09-21 00:59:19 -0600 commented answer image height and width

Hi berak,

can you explain what you mean by "but do not keep or pass around pointers to cv::Mat. those are already refcounted smartpointers, and you will inevitably wreck the internal refcounts this way."?

I thought it was more efficient to pass your images as pointers?

2014-09-21 00:57:50 -0600 commented answer image height and width

Thanks berak! This works perfectly!

2014-09-21 00:19:23 -0600 commented answer image height and width

Thank you!

Is there a reason why I can't use a pointer for these statements? I get an error message saying that the expression must have a class type (*image is underlined). I'm planning to use this in a function.

Size sz = *image.size(); int imageWidth = sz.width; int imageHeight = sz.height;

2014-09-20 23:13:11 -0600 asked a question image height and width

Hi Guys,

Is it possible to get the height and width of an image? I tried using image.get(3) and image.get(4) as I do with video captures but it doesn't seem to work with still images.


2014-09-19 20:33:40 -0600 commented answer Convex Hull for Added Contours

See this Image

Lets say the red boxes are my points of interest. Since I was unable to get a clean contour, I have in some cases 2 hulls (black lines) on one point while some have only one.

I wish to only have one hull for each point of interest. So where there are 2 hulls on one point of interest, I wish to only keep one. Either the bigger or the smaller of the two.

2014-09-19 08:45:56 -0600 commented answer Convex Hull for Added Contours

Lets say I have 4 areas of interest. After hulling, 2 of the areas appear as in the image attached (hull in hull) and the other two only have one bounding hull each.

I'm looking to somehow find a way to delete the smaller hull in the first two. Is it possible to get the coordinates of the hulls? Perhaps I can extract the coordinates of each hull and somehow see if one lies in another?