Ask Your Question

norzanbzura's profile - activity

2020-06-09 05:47:28 -0600 received badge  Famous Question (source)
2019-11-26 09:48:12 -0600 received badge  Popular Question (source)
2017-11-01 09:04:21 -0600 received badge  Notable Question (source)
2017-02-09 07:59:31 -0600 received badge  Popular Question (source)
2015-06-30 12:11:15 -0600 received badge  Famous Question (source)
2015-03-23 06:43:32 -0600 received badge  Notable Question (source)
2014-12-07 21:37:00 -0600 received badge  Popular Question (source)
2014-08-22 11:34:55 -0600 commented question Windows has triggered a breakpoint - OpenCV

There's no error with the code, but when I debug it, this problem occur.

Windows has triggered a breakpoint in myNewOpenCV.exe.

This may be due to a corruption of the heap, which indicates a bug in myNewOpenCV.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while myNewOpenCV.exe has focus.

The output window may have more diagnostic information.

2014-08-22 06:19:22 -0600 asked a question Windows has triggered a breakpoint - OpenCV

I don't know how to settle his problem. There's no error with the code.


le t

2014-08-20 10:09:43 -0600 commented answer How do I measure for the width and height of the object (OpenCV)?

Actually I just make this code as my reference. But actually I want to do is to calculate the height and width of the object. That's it. By the way, thank you for helping me!

2014-08-19 18:49:18 -0600 commented question How do I measure for the width and height of the object (OpenCV)?

Yes Steven. I want to calculate the object width and height from the bounding box.

2014-07-08 21:18:27 -0600 asked a question How do I measure for the width and height of the object (OpenCV)?

If I want to use this on my program, how do I implement it? I've no idea. Thank you for your attention.

w = sqrt( (p1.x-p0.x)*(p1.x-p0.x) + (p1.y-p0.y)*(p1.y-p0.y) );
h = sqrt( (p2.x-p1.x)*(p2.x-p1.x) + (p2.y-p1.y)*(p2.y-p1.y) );
2014-06-02 19:06:23 -0600 commented question How to measure the dimension of object with OpenCV?

Hi GiLevi, this http://www.youtube.com/watch?v=bcswZLwhTUI enough to I tell you on what I want to do. Basically the code above can run properly. But it has a lack of important function which is measurement function. Can you help me to solve this? Thank you in advance.

2014-06-02 02:12:18 -0600 asked a question How to measure the dimension of object with OpenCV?

Here I have the main code but I don't know how to code for the measurement function. Really need for someone help. Thank you in advance.

#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"
#include <opencv/cxcore.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace cv;
using namespace std;

int main(int, char**)
{
    Mat src;
    Mat src_gray;
    int thresh = 50;
    int max_thresh = 255;
    RNG rng (12345);

cv::Mat frame;
VideoCapture capture;
capture.open(0);

while (true)
{
    capture.read(frame);
    Mat threshold_output;
    vector<vector<Point>> contours;
    vector<Vec4i> hierarchy;

    cvtColor(frame, src_gray, CV_BGR2GRAY); //produce out2, a one-channel image (CV_BUC1)
    blur(src_gray, src_gray, Size(5,5));

    threshold(src_gray, threshold_output, thresh, max_thresh, CV_THRESH_BINARY_INV);

    findContours(threshold_output, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, Point(0,0));

    //Find the rotated rectangles
    vector<RotatedRect> minRect(contours.size());

    for(int i=0; i<contours.size(); i++)
    {
        minRect[i] = minAreaRect(Mat(contours[i]));
    }

    //Draw contours + rotated rectangles + ellipses
    Mat drawing = Mat::zeros(threshold_output.size(), CV_8UC3);

    for(int i=0; i<contours.size(); i++)
    {
        Scalar color = Scalar(rng.uniform(0,0), rng.uniform(0,0), rng.uniform(250,250));

        //countours
        drawContours(drawing, contours, i, color, 1,8, vector<Vec4i>(), 0, Point());

        //Rotated rectangle
        Point2f rect_points[4]; minRect[i].points(rect_points);

        for(int j=0; j<4; j++)
            line(frame, rect_points[j], rect_points[(j+1)%4], color, 1, 8);
    }

    //Sensor physical size
    cv::VideoCapture cap;

    if (!cap.isOpened())  // check if we succeeded
        CV_Assert("Can't open Web-Cam");

    double CamHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT);
    double CamWidth  = cap.get(CV_CAP_PROP_FRAME_WIDTH);

    // Function for display the object dimension
    int imgW = 650;
    int imgH = 50;
    int fontFace = FONT_HERSHEY_PLAIN;
    double fontScale = 1.5;
    int thickness = 2;
    Point textOrg(imgW/5, imgH/1.3);

    int value=10;
    string someText = format("Dimension: %d mm", value);            // Display the dimension
    putText(frame, someText, textOrg, fontFace, fontScale, Scalar::all(255), thickness,8);
    imshow("Object Measurement",frame);

    int c = cvWaitKey(10);  //Delay in milliseconds
    if ((char) c==72)

        break;
}

return 0;

}

2014-06-02 00:17:13 -0600 asked a question How to set camera resolution (webcam) with opencv?

I have a problem which I don't know how to create a function to set camera resolution on webcam with openCV. There's anyone can help me? Thank you in advance.

2014-06-01 22:50:40 -0600 commented question How to get auto generate measurement on object with openCV?

How to implement it on the code? Sorry, but I don't know how. Hope you can help me. Thank you in advance.

2014-06-01 19:51:34 -0600 commented answer How to get auto generate measurement on object with openCV?

Thank you for your attention. But how to implement this into a code? Because I've no idea on it. Thank you in advance.

2014-05-28 17:12:06 -0600 received badge  Student (source)
2014-05-28 08:46:49 -0600 commented question How to get auto generate measurement on object with openCV?
2014-05-28 05:19:51 -0600 commented question How to get auto generate measurement on object with openCV?

Yes. But sorry. I still didn't get the idea of how to measure the object..

2014-05-28 04:18:26 -0600 commented question How to get auto generate measurement on object with openCV?

I got that code from the link that u asked me to refer. The error is just undefined 'j'. But I don't know whether I arrange the code correct or not.

2014-05-28 02:07:33 -0600 commented question How to get auto generate measurement on object with openCV?

Hi haris, actually here is the code that I've referred just now. I got a lot of error. There's anything wrong from what I did?

    for(int i=0; i&lt;countours.size(); i++)
    {
        Scalar color = Scalar(rng.uniform(0,0), rng.uniform(0,0), rng.uniform(250,250));    //contour
        drawContours(drawing, contours, i, color, 1, 8, vector&lt;Vec4i&gt;(), 0, Point()); //rotated rectangle

        //Point2f rect_points[4]; 
        minRect[i].points)(rect_points);

        for(int j=0; j &amp;lt; 4; j++)
        {
            line(frame, rect_points[j], rect_points[(j+1)%4], color, 1, 8);
            rect_points[j][i]=rect_points[j];
        }
    }
2014-05-27 22:45:22 -0600 asked a question How to get auto generate measurement on object with openCV?

Here is a code where I want to implement the object measurement, but I don't have any idea on what function that I've to use and how to code it and how to make it auto generate. There's anyone can help me? Thank you in advanced.

cv::VideoCapture cap;

    if (!cap.isOpened())  // check if succeeded to connect to the camera
        CV_Assert("Can't open Web-Cam");

    double CamHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT);
    double CamWidth  = cap.get(CV_CAP_PROP_FRAME_WIDTH);

    //Display text on the screen function
    int imgW = 650;
    int imgH = 50;
    int fontFace = FONT_HERSHEY_PLAIN;
    double fontScale = 1.5;
    int thickness = 2;
    Point textOrg(imgW/5, imgH/1.3);

    int value=10;
    string someText = format("Dimension: %d ", value); //Display the dimension (output)
    putText(frame, someText, textOrg, fontFace, fontScale, Scalar::all(255), thickness, 8);
    imshow("Object Measurement",frame);;
2014-05-26 00:46:38 -0600 received badge  Scholar (source)
2014-05-26 00:20:46 -0600 commented answer How to put measurement function on the text?

It's work! Thank you so much.

2014-05-25 21:31:40 -0600 asked a question How to put measurement function on the text?

Hi, actually I want to put the measurement on the text. But I doesn't have any idea how to put it. There's anyone can help me? Here is the code that I want to implement the measurement function on it. I'm not sure whether the code is right or not. Thank you in advanced.

    int imgW = 650;
    int imgH = 50;

    Mat frame = Mat::zeros(imgH,imgW, CV_8UC1);
    int fontFace = FONT_HERSHEY_COMPLEX_SMALL;
    double fontScale = 1.5;
    int thickness = 2;
    Point textOrg(imgW/5, imgH/1.2);
    string someText = "Dimension: ";
    putText(frame, someText, textOrg, fontFace, fontScale, Scalar::all(255), thickness,8);
2014-05-24 20:27:27 -0600 asked a question How to get sensor physical size (openCV)?

Hi, actually I want to calculate/get for sensor physical size using webcam? There's any function in opencv? Thank you in advanced.

2014-05-22 11:15:32 -0600 asked a question How to measure the dimension of object with webcam video openCV?

Actually I want to build a system/application that can measure the dimension/size of the object by using OpenCV, but I doesn't have any idea how to code the measurement function. Here is the code.


#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"
#include <opencv/cxcore.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace cv;
using namespace std;

int main(int, char**)
{
    Mat src;
    Mat src_gray;
    int thresh = 100;
    int max_thresh = 255;
    RNG rng (12345);

cv::Mat frame;
VideoCapture capture;
capture.open(0);

while (true)
{
    capture.read(frame);
    Mat threshold_output;
    vector<vector<Point>> contours;
    vector<Vec4i> hierarchy;

    cvtColor(frame, src_gray, CV_BGR2GRAY); //produce out2, a one-channel image (CV_BUC1)
    blur(src_gray, src_gray, Size(5,5));

    threshold(src_gray, threshold_output, thresh, max_thresh, CV_THRESH_BINARY_INV);

    findContours(threshold_output, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, Point(0,0));

    //Find the rotated rectangles
    vector<RotatedRect> minRect(contours.size());

    for(int i=0; i<contours.size(); i++)
    {
        minRect[i] = minAreaRect(Mat(contours[i]));
    }

    //Draw contours + rotated rectangles + ellipses
    Mat drawing = Mat::zeros(threshold_output.size(), CV_8UC3);

    for(int i=0; i<contours.size(); i++)
    {
        Scalar color = Scalar(rng.uniform(0,0), rng.uniform(0,0), rng.uniform(250,250));

        //countours
        drawContours(drawing, contours, i, color, 1,8, vector<Vec4i>(), 0, Point());

        //Rotated rectangle
        Point2f rect_points[4]; minRect[i].points(rect_points);

        for(int j=0; j<4; j++)
            line(frame, rect_points[j], rect_points[(j+1)%4], color, 1, 8);
    }

    //Show in a window
    namedWindow("Object Measurement", CV_WINDOW_AUTOSIZE);
    imshow("Object Measurement",frame);

    int c = cvWaitKey(10);
    if ((char) c==72)

        break;
}

return 0;

}

2014-05-21 17:23:49 -0600 commented question How to display text on the windows (webcam windows) openCV?

Hi Daniil, thank you for your attention. Actually it's work! But video (webcam) doesn't appear. Thank you.

2014-05-21 08:47:00 -0600 commented question How to display text on the windows (webcam windows) openCV?

It's like this?

    Mat frame = Mat::zeros(imgH,imgW,CV_WINDOW_AUTOSIZE);
    int fontFace = FONT_HERSHEY_COMPLEX_SMALL;
    double fontScale = 1.5;
    int thickness = 2;
    Point textOrg(imgW/5, imgH/1.2);
    string someText = "Dimension: ";
    putText(frame, someText, textOrg, fontFace, fontScale, Scalar::all(255), thickness,8);

    for(;;)
    {
        imshow("Object Measurement", frame);
        if (waitKey(30) &gt; 0)
        break;
    }

I'm using this code, but it doesn't appear on the webcam video popup.

2014-05-21 04:32:52 -0600 commented question How to display text on the windows (webcam windows) openCV?

Thank you for your attention. By the way, I do not know how to code to put the text on the webcam video popup.

2014-05-21 01:41:05 -0600 commented answer How to display text on the windows (webcam windows) openCV?

Hi Martin, I have posted updated question with my full code. Kindly please take a look. Thanks for your consideration.

2014-05-21 01:36:46 -0600 asked a question How to display text on the windows (webcam windows) openCV?

Actually I want to display a text on the popup windows but I have no idea how to code it. There's anyone can help me? Thanks for your consideration. Here is my code.


#include "opencv/highgui.h"
#include "opencv/cv.h"
#include <opencv/cxcore.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace cv;
using namespace std;

int main(int, char**)
{
    Mat src;
    Mat src_gray;
    int thresh = 100;
    int max_thresh = 255;
    RNG rng (12345);
cv::Mat frame;
VideoCapture capture;
capture.open(0);

while (true)
{
    capture.read(frame);
    Mat threshold_output;
    vector<vector<Point>> contours;
    vector<Vec4i> hierarchy;

    cvtColor(frame, src_gray, CV_BGR2GRAY); //produce out2, a one-channel image (CV_BUC1)
    blur(src_gray, src_gray, Size(5,5));

    threshold(src_gray, threshold_output, thresh, max_thresh, CV_THRESH_BINARY_INV);

    findContours(threshold_output, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, Point(0,0));

    //Find the rotated rectangles
    vector<RotatedRect> minRect(contours.size());

    for(int i=0; i<contours.size(); i++)
    {
        minRect[i] = minAreaRect(Mat(contours[i]));
    }

    //Draw contours + rotated rectangles + ellipses
    Mat drawing = Mat::zeros(threshold_output.size(), CV_8UC3);

    for(int i=0; i<contours.size(); i++)
    {
        Scalar color = Scalar(rng.uniform(0,0), rng.uniform(0,0), rng.uniform(250,250));

        //countours
        drawContours(drawing, contours, i, color, 1,8, vector<Vec4i>(), 0, Point());

        //Rotated rectangle
        Point2f rect_points[4]; minRect[i].points(rect_points);

        for(int j=0; j<4; j++)
            line(frame, rect_points[j], rect_points[(j+1)%4], color, 1, 8);
    }

    //Show in a window
    namedWindow("Contours", CV_WINDOW_AUTOSIZE);
    imshow("Contours",frame);

    int c = cvWaitKey(10);
    if ((char) c==72)

        break;
}

return 0;

}

2014-05-20 23:49:08 -0600 commented answer How to display text on the windows (webcam windows) openCV?

Here is my code, but I've no idea where to put it and how to code it.

include "opencv/highgui.h"

include "opencv/cv.h"

include <opencv/cxcore.h>

include <iostream>

include <stdio.h>

include <stdlib.h>

using namespace cv; using namespace std;

int main(int, char**) { Mat src; Mat src_gray; int thresh = 100; int max_thresh = 255; RNG rng (12345);

cv::Mat frame;
VideoCapture capture;
capture.open(0);

while (true)
{
    capture.read(frame);
    Mat threshold_output;
    vector&lt;vector&lt;Point&gt;&gt; contours;
    vector&lt;Vec4i&gt; hierarchy;

    cvtColor(frame, src_gray, CV_BGR2GRAY); //produce out2, a one-channel image (CV_BUC1)
    blur(src_gray, src_gray, Size(5,5));

    threshold(src_gray, threshold_output, thresh, max_thresh, CV_THRESH_BINARY_INV);

    findContours(threshold_output, contour
2014-05-20 09:55:00 -0600 asked a question How to display text on the windows (webcam windows) openCV?

Actually I want to display a text on the popup windows but I have no idea how to code it. There's anyone can help me? Thanks for your consideration.

2014-05-14 10:15:15 -0600 asked a question Measuring the dimension of object with OpenCV.

Attached here is a formula of measuring object. But I don't know how to code it in OpenCV.C:\fakepath\formula.png

2014-05-14 08:10:50 -0600 asked a question How do I measure dimension of the object detected?

I want to measure the dimension of object detected, but I have no idea how to code and display the measurement on the windows.