pose2sim icon indicating copy to clipboard operation
pose2sim copied to clipboard

Should have to click one more time when doing calibration by pointing on an images

Open ANaaim opened this issue 10 months ago • 13 comments

Hi,

When we are doing the extrinsic calibration by clicking on a image when the last point is clicked the data is directly send back in the code. Some misclick can happen so the user should have to click one more time or any other method no ?

best regards

ANaaim avatar Apr 08 '24 13:04 ANaaim

Maybe one more click would make sense! It would be nice if returning the data would have to be triggered, but could be done either with an additional click, or by pressing enter, escape, or Y. Would you have time to implement it?

davidpagnon avatar Apr 08 '24 13:04 davidpagnon

As I request annoying stuff, I should make it ^^

ANaaim avatar Apr 08 '24 14:04 ANaaim

Would probably look like something like this :

                    # Question to check if user ok 
                    user_input = input("Are you satisfied with this point? (yes/no): ")
                    if user_input.lower() == "yes":
                        # retrieve objp_confirmed and plot 3D
                        objp_confirmed = [objp[count]]
                        ax_3d.scatter(*objp[count], marker='o', color='g')
                        fig_3d.canvas.draw()
                    elif user_input.lower() == "no":
                        # Remove lastpoint from image
                        new_xydata = scat.get_offsets()[:-1]
                        scat.set_offsets(new_xydata)
                        plt.draw()
                        # Remove last point from imgp_confirmed
                        imgp_confirmed = imgp_confirmed[:-1]
                        if len(objp) != 0:
                            if count >= 0:
                                count -= 1
                            # Remove last point from objp_confirmed
                            objp_confirmed = objp_confirmed[:-1]
                            # remove from plot 
                            if len(ax_3d.collections) > len(objp):
                                ax_3d.collections[-1].remove()
                                fig_3d.canvas.draw()

ANaaim avatar Apr 08 '24 14:04 ANaaim

Should be after

ANaaim avatar Apr 08 '24 14:04 ANaaim

It's not annoying, it is just time consuming 😁

You write "are you satisfied with this keypoint", does it mean that there would need to be a confirmation after each keypoint, or only after the last one? The second option would probably be better.

Would it require the user to type in the console? I'm afraid that they won't think of looking there, unless there is a pop-up window appearing.

I wonder if just clicking once more or typing a key would not be more straightforward?

davidpagnon avatar Apr 08 '24 14:04 davidpagnon

yes i was fast for generating this I will use a tkinter like this : image

ANaaim avatar Apr 08 '24 14:04 ANaaim

And just for the last point.

ANaaim avatar Apr 08 '24 14:04 ANaaim

That looks great 👍

davidpagnon avatar Apr 08 '24 14:04 davidpagnon

Some problem with the tkinter, during it you can still click on the image... not very good... I am looking for a solution.

ANaaim avatar Apr 08 '24 15:04 ANaaim

It would be better if the image were locked, but even if you cannot find a solution this is already an improvement as is

davidpagnon avatar Apr 09 '24 07:04 davidpagnon

Found a way to lock the image. Using a Boolean to follow if we are in the prompt asking. If yes I skip any element done in the in_click function.

ANaaim avatar Apr 10 '24 04:04 ANaaim

Great, I'll let you update your pull request when you have time!

davidpagnon avatar Apr 10 '24 14:04 davidpagnon

It is already in the PR. It was a additional comment.

ANaaim avatar Apr 12 '24 17:04 ANaaim