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鈥檒l 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

Projects
None yet
3 participants
@patricksnape
Contributor

patricksnape commented Feb 6, 2016

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 馃槃

patricksnape added some commits Feb 6, 2016

Change marker rendering to plot rather than scatter
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.
Add 2D landmark rasterize method to images
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

This comment has been minimized.

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.

Fix docs about marker_size
Change gaussian ellipse code to use plot as well to make
the behaviour consistent.
@nontas

This comment has been minimized.

Member

nontas commented Feb 8, 2016

+1

@patricksnape patricksnape changed the title from Rasterize 2d Landmarks Method to Rasterize 2D Landmarks Method Feb 8, 2016

@patricksnape

This comment has been minimized.

Contributor

patricksnape commented Feb 8, 2016

@jabooth Want to check this too?

@jabooth

This comment has been minimized.

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 added a commit that referenced this pull request Feb 10, 2016

@patricksnape patricksnape merged commit dd60d42 into menpo:master Feb 10, 2016

4 checks passed

OS X MenpoBot Jenkins build passed No test results found.
Details
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@patricksnape patricksnape deleted the patricksnape:rasterize_2d_landmarks branch Feb 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment