tsdconseil / opencv-demonstrator

OpenCV demonstrator (GUI)
http://www.tsdconseil.fr/log/opencv/demo/index-en.html
GNU Lesser General Public License v3.0
141 stars 57 forks source link

Input image persises in showing the default image after changing to a different demonstration. #52

Closed applemuncy closed 6 years ago

applemuncy commented 8 years ago

It seems the output of the input image display does not update to the current input image. This predates recent changes.

juliena82 commented 8 years ago

Yes, your right,currently the input image(s) selection is reset to default image each time the demo is changed. Will be fixed soon....

applemuncy commented 8 years ago

"...currently the input image(s) selection is reset to default image each time the demo is changed." No, this is not the case. If I grab a corner to resize the window and drag out to resize, the correct image is displayed. So I think it is just a matter of using the correct method to make the gtk_image update to the new image. I'll see if I can learn enough gtkmm to get it working. But don't wait on me if you already know how.

applemuncy commented 8 years ago

ImageSelecteur::maj_selection() now puts bigmat into gtk_image so the the Source(s) selection window show the current source image.

It is now possible to remove an image in the stitch demo and redisplay.

juliena82 commented 8 years ago

Hi @applemuncy I would like your help so as to understand what exactly is the bug related to this issue, and the fix you have done.

First, I do not understand your description of the bug and so I am unable to reproduce it. It is and has always been possible to remove an image from the stich demo. Or not?

Secondly, I dont understand your fix either: you have done copy / paste of the following lines from maj_mosaique() to maj_selection():

  pixbuf = Gdk::Pixbuf::create_from_data(bigmat.data,
                                         Gdk::Colorspace::COLORSPACE_RGB,
                                         false,
                                         8,
                                         bigmat.cols,
                                         bigmat.rows,
                                         3 * bigmat.cols);
  gtk_image.set(pixbuf);

which, up to my knowledge, I don't understand. In fact, the goal of "maj_mosaique", is to update the full display of this window (the "mosaique" of images, or, as written in english, "mosaic"), so it checks if the total size of the display has changed, and only in this case, it redefines the GTK pixbuf.

On the contrary, the goal of "maj_selection()" is only to update the selection rectangle (green) around the currently selected image. So there is no need at all in this case to redefine the GTK pixbuf.

So can you elaborate on the bug you have seen and the fix you have tried to do. If I understand the bug, then maybe I can help you to do the good fix.