Ask Your Question

Update opencv viz3d window after calling spin() (event loop)

asked 2017-05-22 15:08:42 -0500

Esraa gravatar image

I made a program based on the user inputs some widgets appear inside viz3d window. the problem is I want the widget's pose to get updated real time so the program should do the following: 1- take inputs from the user from GUI 2- pop up a window with the wanted widget. 3- the user can ask for more widgets to add 4-update the window with the new widgets i can't figure out a way to update viz3d window any widget I add after calling window. spin() or window.spinonce() doesn't appear

edit retag flag offensive close merge delete


Do you know this code ?

LBerger gravatar imageLBerger ( 2017-05-23 09:16:00 -0500 )edit

yeah, what if after I created all the widgets and started the event loop, the user wanted to change any previous inputs did he(the user) need to close the window and run the program again ? or can he/she alter the existed widgets? (Given that the user uses GUI to enter the inputs which doesn't close when viz3d window appears) Thanks alot and forgive me i'm a bit new to opencv viz.

Esraa gravatar imageEsraa ( 2017-05-23 10:53:24 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-05-23 13:40:25 -0500

LBerger gravatar image

Copy and paste example given in this link there is no problem :

void ClavierViz(const viz::KeyboardEvent    &k,void *c)
    int *i=(int*)c;
    if (k.code=='1')
    else if (k.code == '2')
        *i = *i + 1;


int indCam=0,indRef=indCam;
fen3D.registerKeyboardCallback(ClavierViz, &indCam);
    if (indRef==indCam)
        if (indCam>= path.size())
        else if (indCam <0)
            indCam = path.size()-1;
} while (!fen3D.wasStopped());
edit flag offensive delete link more


Thanks a lot, but can you explain it a bit, I'm sorry I can't get it

Esraa gravatar imageEsraa ( 2017-05-23 14:21:42 -0500 )edit

@Esraa Have you solved your problem ?

LBerger gravatar imageLBerger ( 2017-05-24 08:31:54 -0500 )edit

Question Tools

1 follower


Asked: 2017-05-22 15:08:42 -0500

Seen: 410 times

Last updated: May 23 '17