Ask Your Question

David_Lavy's profile - activity

2018-01-12 09:17:41 -0600 received badge  Enthusiast
2018-01-10 11:41:38 -0600 commented answer How to obtain an 'approximate' true color from an image in different lightning conditions?

Thank you for your reply. I think the wall example is a bit extreme, and I should've been a bit clearer. In my specific

2018-01-08 13:02:34 -0600 asked a question How to obtain an 'approximate' true color from an image in different lightning conditions?

How to obtain an 'approximate' true color from an image in different lightning conditions? I'm working on an app that ca

2018-01-05 09:22:18 -0600 commented answer Problem using xphoto::LearningBasedWB

Thank you! That solved the problem.

2018-01-05 09:22:03 -0600 marked best answer Problem using xphoto::LearningBasedWB

Hi,

I'm trying to run the tutorial provided here. The training model works just fine. However, when I do the testing I always get a segmentation fault. And this is due to using the learning based model.

I went and created a simple test using the .yml file created from the training test here. Uploaded any picture and I get the same segmentation error. Debugging the code it seems the error is in this line:

wb->balanceWhite(img, img_out);

But I have no idea why this error shows up. Any help is appreciated.

Thanks!

2018-01-03 09:03:08 -0600 commented question Problem using xphoto::LearningBasedWB

Here it is: https://drive.google.com/file/d/1_5PUUb_VsSC18nMzsy_DYzWNnO926UI9/view?usp=sharing

2018-01-02 13:49:11 -0600 commented question Problem using xphoto::LearningBasedWB

Something that I'm realizing is that I think the WhiteBalance pointer is not using the yml I'm referencing. If I switch

2018-01-02 13:36:57 -0600 commented question Problem using xphoto::LearningBasedWB

The same "Segmentation fault (core dumped)"

2018-01-02 13:27:22 -0600 asked a question Problem using xphoto::LearningBasedWB

Problem using xphoto::LearningBasedWB Hi, I'm trying to run the tutorial provided here. The training model works just

2017-07-31 23:28:49 -0600 received badge  Famous Question (source)
2016-03-17 02:28:58 -0600 received badge  Notable Question (source)
2015-12-18 03:00:48 -0600 received badge  Famous Question (source)
2015-08-03 08:00:48 -0600 received badge  Notable Question (source)
2015-05-12 10:05:27 -0600 received badge  Popular Question (source)
2014-10-10 12:24:16 -0600 received badge  Popular Question (source)
2013-08-24 12:48:31 -0600 asked a question Issues building openni_capture.cpp

Hi,

I just installed OpenCV-2.5 with no problems. I want to build an app using Kinect, and I tried the example is in the documentation openni_capture.cpp, however when I compile it, it gives me the following errors:


/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp: In function ‘float getMaxDisparity(cv::VideoCapture&)’:
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:82:35: error: ‘CAP_OPENNI_DEPTH_GENERATOR_BASELINE’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:83:35: error: ‘CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp: In function ‘void parseCommandLine(int, char, bool&, bool&, int&, bool, std::string&, bool&)’:
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:145:21: error: ‘Error’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp: In function ‘int main(int, char)’:
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:194:23: error: ‘CAP_OPENNI’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:210:40: error: ‘CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:210:80: error: ‘CAP_OPENNI_VGA_30HZ’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:213:80: error: ‘CAP_OPENNI_SXGA_15HZ’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:216:80: error: ‘CAP_OPENNI_SXGA_30HZ’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:220:80: error: ‘CAP_OPENNI_QVGA_30HZ’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:223:80: error: ‘CAP_OPENNI_QVGA_60HZ’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:226:17: error: ‘Error’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:234:49: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:235:49: error: ‘CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:236:49: error: ‘CAP_PROP_OPENNI_FRAME_MAX_DEPTH’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:237:49: error: ‘CAP_PROP_FPS’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:238:49: error: ‘CAP_PROP_OPENNI_REGISTRATION’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:239:22: error: ‘CAP_OPENNI_IMAGE_GENERATOR_PRESENT’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:243:46: error: ‘CAP_OPENNI_IMAGE_GENERATOR’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:269:71: error: ‘CAP_OPENNI_DEPTH_MAP’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:276:75: error: ‘CAP_OPENNI_DISPARITY_MAP’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:292:76: error: ‘CAP_OPENNI_VALID_DEPTH_MASK’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:295:71: error: ‘CAP_OPENNI_BGR_IMAGE’ was not declared in this scope
/home/david/Documents/Qt_workspace/test_OpenCV_NI/openni_capture.cpp:298:72: error: ‘CAP_OPENNI_GRAY_IMAGE’ was not declared in this scope
make[2]:  [CMakeFiles/test_opencvkinect.dir/openni_capture.cpp.o] Error 1
make[1]:  [CMakeFiles/test_opencvkinect.dir/all] Error 2
make: ** [all] Error 2

I found ... (more)

2012-12-14 09:04:40 -0600 commented answer How to use Callback to draw a rectangle in a video?

Thank you, I modified the last part of the main function and I indicated it in my post as an update, my problem now is, when I run the program it doesn't stream the video since the beginning, it only shows the first frame until I click on the screen, and then streams the video, how can I modify so it can stream the video right after I run my program?

2012-12-14 00:03:44 -0600 asked a question How to use Callback to draw a rectangle in a video?

Hi, I'm trying to select a rectangle in a video, but when I run my code nothing shows up; this is the code I'm using:

cv::Mat frame;
const char* src_window = "Select ROI";

int drag = 0, select_flag = 0;

cv::Point point1, point2;    
bool callback = false;
void mouseHandler(int event, int x, int y, int flags, void* param);

int main(int argc, char** argv) {

cv::VideoCapture cap;

if( argc == 1 || (argc == 2 && strlen(argv[1]) == 1 && isdigit(argv[1][0])))
        cap.open(argc == 2 ? argv[1][0] - '0' : 0);
else if( argc == 2 )
    cap.open(argv[1]);

if( !cap.isOpened() )
{
    std::cout << "Could not initialize capturing...\n";
    return 0;
}

cap >> frame;

cv::namedWindow(src_window,CV_WINDOW_AUTOSIZE);
//cv::imshow(src_window,frame);
//cv::setMouseCallback(src_window,mouseHandler,0);

for (;;) {
    cap >> frame;
    if( frame.empty() )
            break;

    if (callback == false) {
        cv::setMouseCallback(src_window,mouseHandler,0);
    }
    else {
    cv::imshow(src_window,frame);
    }
}
    cv::waitKey(0);
    return 0;
}

void mouseHandler(int event, int x, int y, int flags, void* param)
{
if (event == CV_EVENT_LBUTTONDOWN && !drag && !select_flag)
{
    /* left button clicked. ROI selection begins */
    point1 = cv::Point(x, y);
    drag = 1;
}

if (event == CV_EVENT_MOUSEMOVE && drag && !select_flag)
{
    /* mouse dragged. ROI being selected */
    cv::Mat img1 = frame.clone();
    point2 = cv::Point(x, y);
    cv::rectangle(img1, point1, point2, CV_RGB(255, 0, 0), 3, 8, 0);
    cv::imshow(src_window, img1);
}

if (event == CV_EVENT_LBUTTONUP && drag && !select_flag)
{
    cv::Mat img2 = frame.clone();
    point2 = cv::Point(x, y);
    drag = 0;
    select_flag = 1;
    cv::imshow(src_window, img2);
    callback = true;
}
}

I don't know what can I be doing wrong. Thanks for your help.

UPDATE: Thanks to Vladislav Vinogradov now I can stream the video, but when I run the program it shows the first frame and stays like that until I click on the image, then starts the streaming, how can I modify this part so the streaming occurs since the beginning?

cap >> frame;

cv::namedWindow(src_window,CV_WINDOW_AUTOSIZE);
cv::imshow(src_window,frame);

for (;;) {
    if (callback) {
        cap >> frame;
        if( frame.empty() )
                break;
        cv::imshow(src_window,frame);
    }
    else {
        cap >> frame;
        cv::setMouseCallback(src_window,mouseHandler,0);
    }
    cv::waitKey(5);
}
2012-11-28 03:14:53 -0600 received badge  Student (source)
2012-11-19 13:24:35 -0600 asked a question Multiply cv::Mat and std::vector<cv::Point2f>

Hi,

So I have a matrix cv::Mat M (NxN) and a vector of Points std::vector< cv::Point2f > Vec (Nx2).

How can I perform a multiplication between these two elements: M x Vec = P, and have a final vector std::vector< cv::Point2f > P (Nx2)??

Thank you!

2012-11-19 11:13:40 -0600 asked a question Fusion 2 vector of float into 1 vector of cvPoint2f

Hi,

Let's say I have two vectors std::vector< float > pX,pY. Is there any way I can fusion those 2 vectors into one single std::vector< cv::Point2f > points, where the vector pX is the X elements and pY the Y elements of the vector points? I know I can use a for loop, but I wanted to know a more matricial, or simpler function can achieve this.

Thanks!

2012-11-02 09:50:14 -0600 received badge  Editor (source)
2012-11-02 02:27:14 -0600 asked a question XML/YML Tutorial Persistence failed

Hi, I have a problem doing the first part of the tutorial XML/YML Persistence (C API))

It fails with the error:

OpenCV Error: Unspecified error (Incorrect element name {:) in operator<<, file /tmp/buildd/ros-fuerte-opencv2-2.4.2-0oneiric-20120908-1631/modules/core/src/persistence.cpp, line 5239 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/buildd/ros-fuerte-opencv2-2.4.2-0oneiric-20120908-1631/modules/core/src/persistence.cpp:5239: error: (-2) Incorrect element name {: in function operator<<in function="" operator&lt;&lt;<="" p="">

The same issue was explained here but it only says the issue is fixed now, although doesn't say how was it fixed. I need help with this.

Thank you!

P.S. I'm using OpenCV 2.4.2 from ROS and Ubuntu 11.10

2012-11-02 02:19:46 -0600 received badge  Scholar (source)
2012-10-18 10:19:27 -0600 asked a question Using OpenCV of ROS in Qt Creator

Hi, so I've installed ROS Fuerte in my PC, and now I want to use the OpenCV libraries from it in a Qt project. I don't know how to do it ... Before I had ROS Electric and by only adding:

unix {    
CONFIG += link_pkgconfig
PKGCONFIG += opencv
}

To my .pro file was enough to start using OpenCV, but this doesn't work now. Do you have any idea how to do it? Thanks.

Additional Info:

  • Ubuntu version 11.10
  • OpenCV version 2.4.2
  • ROS Fuerte
  • Qt 4.7.3