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

Rasterize 2D Landmarks Method #670

Merged
merged 6 commits into from
Feb 10, 2016

Conversation

patricksnape
Copy link
Contributor

This method allows rasterizing of landmark groups onto an image.
Multiple landmark groups can be rasterized onto the same
image for efficiency. Currently two backends are provided, pillow
and matplotlib. The matplotlib backend is far more feature
complete, but slow! The pillow backend is much simpler but
an order of magnitude faster than the matplotlib backend.

@nontas check this out - it should be something you will like 😄

This is because scatter does some weird things with the axes
and makes it really impossible to generate a tight layout,
whereas plot seems to behave properly. From what I can
see the output is identical.
This method allows rasterizing of landmark groups onto an image.
Multiple landmark groups can be rasterized onto the same
image for efficiency. Currently two backends are provided, pillow
and matplotlib. The matplotlib backend is far more feature
complete, but slow! The pillow backend is much simpler but
an order of magnitude faster than the matplotlib backend.
@nontas
Copy link
Member

nontas commented Feb 8, 2016

That looks great @patricksnape !!
My only comment is that since this PR replaces plt.scatter with plt.plot for rendering points (and also correctly changes marker_size default value from 20 to 5), we should also change the marker_size documentation in our viewable classes (e.g. Image, PointCloud, PointGraph etc.). marker_size is no longer The size of the markers in points^2. but The size of the markers in points.

Change gaussian ellipse code to use plot as well to make
the behaviour consistent.
@nontas
Copy link
Member

nontas commented Feb 8, 2016

+1

@patricksnape patricksnape changed the title Rasterize 2d Landmarks Method Rasterize 2D Landmarks Method Feb 8, 2016
@patricksnape
Copy link
Contributor Author

@jabooth Want to check this too?

@jabooth
Copy link
Member

jabooth commented Feb 10, 2016

Works well! Only comment is that I think a fairly likely that users may wish to render all landmarks out, and atm that would require something like:

img.rasterize_landmarks_2d(group=img.landmarks.keys())

Saying that, in such cases you would need to know what order the keys are in to choose different colours etc for the landmarks. The API chosen here is consistent with what we have elsewhere in menpo, so let's get this in.

+1

patricksnape pushed a commit that referenced this pull request Feb 10, 2016
@patricksnape patricksnape merged commit dd60d42 into menpo:master Feb 10, 2016
@patricksnape patricksnape deleted the rasterize_2d_landmarks branch February 10, 2016 18:13
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.

None yet

3 participants