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: vtk version handling in ImageViewer (PCLVisualizer) #998

Closed
wants to merge 1 commit into from
Closed

Conversation

mdkus
Copy link
Contributor

@mdkus mdkus commented Nov 13, 2014

Hi,
during testing some image viewer tools with VTK 5.8 I got false positions of several context items on image viewer screen. I think the vtk version handling wasn't correct, so I did some rework on it.

@VictorLamoine
Copy link
Contributor

On a side note I'm currently investigating problems related to the use of VTK6 with the ImageViewer, #910.

@mdkus
Copy link
Contributor Author

mdkus commented Nov 15, 2014

Hi Victor,
#910 is an interesting issue. I tested under Windows7, 32-Bit, VS2010, VTK 5.8, actual trunk.

I haven't tested VTK 6.X yet (what means to use 'win_->Render ()' instead of 'image_viewer_->Render ()' in 'ImageViewer.cpp'). I should do that...

@taketwo
Copy link
Member

taketwo commented Nov 21, 2014

Hmm, I didn't have a chance to test your changes, but the version checking seems to be somewhat inconsistent. In the hpp the pivot version of vtk is 5.10, whereas in the cpp file it is 5.7. Shouldn't it be the same?

@mdkus
Copy link
Contributor Author

mdkus commented Nov 22, 2014

Yes, you're right. How can we avoid this? I used latest pcl trunk to make the code changes for the pull request...

@taketwo
Copy link
Member

taketwo commented Nov 22, 2014

If you provide a code snippet that showcases the problems that you are getting, I can try it with vtk5.10.

@mdkus
Copy link
Contributor Author

mdkus commented Nov 22, 2014

The test case was:

tool/demo: "pcl_pcd_select_object_plane" with input file: "trunk/test/milk_cartoon_all_small_clorox.pcd" (pcl latest trunk, vtk 5.8)

=> after shift-clicking on an object (milk bottle) in cloud viewer the result was a wrong y-position of the context item in image viewer to mark the object as overlay on the image (i.e. rectangle):

image_viewer_->addRectangle (...), apps/src/pcd_select_object_plane.cpp, line 493

@taketwo
Copy link
Member

taketwo commented Nov 22, 2014

After clicking on each of the objects in sequence, I get the following image:

image-viewer

The frame is clearly misaligned. After I changed 7 to 10 in image_viewer.hpp as you proposed, the result is as follows:

viewer2

Is this the output that I am supposed to get? If yes, then what kind of problem you are trying to address with the changes in image_viewer.cpp file?

@mdkus
Copy link
Contributor Author

mdkus commented Nov 23, 2014

Hi Sergey,
yes this is the right output. The rectangles are at the right y-position.

For completeness I checked out the positions of the output of all other context item functions for lines, circles, text and so on ( image_viewer.cpp ). These other context items were misaligned as well with vtk5.8, so I changed the code in the same way as in image_viewer.hpp.

@taketwo
Copy link
Member

taketwo commented Nov 23, 2014

But why don't you use the same condition

#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 10))

as in hpp then?

@mdkus
Copy link
Contributor Author

mdkus commented Nov 24, 2014

You're right, that would be better. But recently I testet vtk6 and found that the items are misaligned as well. Therefore i propose a complete workaround. I'll make a new pull request then. You can close this.

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.

3 participants