Giter Site home page Giter Site logo

mabelcalim / xcamera Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kivy-garden/xcamera

0.0 1.0 0.0 1.08 MB

Kivy widget for taking pictures with the camera, optimized for Android. It uses the native Android's APIs to take the pictures, thus ensuring good quality, high resolution, auto-focus, etc.

License: MIT License

Python 84.78% Shell 0.78% Makefile 14.44%

xcamera's Introduction

XCamera: Android-optimized camera widget

Github Actions Tests Github Actions Android Build Status Coverage Status PyPI version

XCamera is a widget which extends the standard Kivy Camera widget with more functionality. In particular:

  1. it displays a "shoot button", which the user can press to take pictures

  2. on Android, it uses the native APIs to take high-quality pictures, including features such as auto-focus, high resolution, etc.

  3. it includes a method to force landscape mode. On Android, it is often desirable to switch to landscape mode when taking pictures: you can easily do it by calling camera.force_landscape(), and later camera.resource_orientation() to restore the orientation to whatever it was before.

Screenshot:

screenshot

Notes:

  • On Android, the resolution property of the XCamera (and also of the plain Camera) widget controls the preview size: in other words, it only affects the quality of the preview, not the size of the pictures taken.

  • As it is now, the camera will shoot using the default setting for the picture size, which seems to be what the camera think it is "the best". In theory, we could add a method to retrieve the list of all possible picture sizes, and add a property to control it. It would also be nice to add a new button to allow the user to manually select the preferred size. Pull requests are welcome :)

Install & Usage

xcamera is available on PyPI. Therefore it can be installed via pip.

pip3 install xcamera

Once installed, the demo should be available in your PATH and can be ran from the command line.

xcamera

And the widget can be imported via:

from kivy_garden.xcamera import XCamera

Demo

A full working demo is available in src/kivy_garden/xcamera/main.py. You can run it via:

make run

Develop & Contribute

To play with the project, install system dependencies and Python requirements using the Makefile.

make

Then verify everything is OK by running tests.

make test

If you're familiar with Docker, the project can also run in a fully isolated container. First build the image.

make docker/build

Then you can run tests within the container.

make docker/run/test

Or the application itself.

make docker/run/app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.