Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: misaligned context items in ImageViewer #1049

Merged
merged 1 commit into from
Dec 22, 2014
Merged

fix: misaligned context items in ImageViewer #1049

merged 1 commit into from
Dec 22, 2014

Conversation

mdkus
Copy link
Contributor

@mdkus mdkus commented Dec 19, 2014

This is the announced workaround for the misaligned context items (#998). The issue of the workaround is a change in vtk version handling.

tool/demo for testing: "pcl_pcd_select_object_plane" with input file: "trunk/test/milk_cartoon_all_small_clorox.pcd"

first test: vtk 5.8

before:
imageviewer - vtk5 8 - before
after:
imageviewer - vtk5 8 - after

second test: vtk 6.2, actual trunk
before:
imageviewer - vtk6 2 - before
after:
imageviewer - vtk6 2 - after

@taketwo
Copy link
Member

taketwo commented Dec 20, 2014

I wonder why as soon as I click an object the 2d image disappears and only the green overlay frame is visible (as shown in the screenshots I posted in the previous thread). On your samples background is visible...

@mdkus
Copy link
Contributor Author

mdkus commented Dec 20, 2014

Hi,
forgotten to send a pull request with code changes for background visibility. See also #1051.

@taketwo
Copy link
Member

taketwo commented Dec 20, 2014

With the other patch I am now able to see the background. Nevertheless, the overlays are still misaligned for me (vtk6.1).

Here is what I get without this pull request:

image

And this is after applying this pull request:

image

Clearly, the result has improved significantly in that the frames are not upside down anymore and click locations are properly positioned. However, the overlays are still misaligned with the background.

Do you have any idea what might be wrong? Additional piece of information to consider: when I resize the window (double the height), this is the view I get:

image

Seems like both the translation in scale are wrong...

@mdkus
Copy link
Contributor Author

mdkus commented Dec 21, 2014

I think, the problem is, that vtk context items are not auto-scaled when resizing the window. With vtk 5.8++, this is not the problem since the image isn't auto-scaled as well:

with vtk5.8 before window resizing:
imageviewer - vtk5 8 - before resize

with vtk5.8 after window resizing:
imageviewer - vtk5 8 - after resize

With the introduction of 'vtkImageSlice' (vtk6), we get the problem of an auto-scaled image, which is in fact a textured polygon with other vtk core resize properties than 'vtkActor2D' has, which was used in earlier versions of ImageViewer (image_viewer.cpp, line 45):

code fragment

Now we have a mixtured resize behaviour:

with vtk6 before window resizing:
imageviewer - vtk6 2 - before resize

with vtk6.2 after window resizing:
imageviewer - vtk6 2 - after resize

I suggest to try to get pcl context items auto-scaled as well for the use with vtk6. If this is not possible, we might have to take back the introduction of 'vtkImageSlice' with its benefits of hardware texture rendering...

@taketwo
Copy link
Member

taketwo commented Dec 22, 2014

Let's consider that a separate issue then. I'll merge this one; please submit another patch if you find time to fix it. Thanks!

taketwo added a commit that referenced this pull request Dec 22, 2014
fix: misaligned context items in ImageViewer
@taketwo taketwo merged commit f8854d5 into PointCloudLibrary:master Dec 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants