GithubHelp home page GithubHelp logo

stollcri / squared Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 203.5 MB

An iOS app for squaring rectangular images without cropping or scaling

License: BSD 3-Clause "New" or "Revised" License

Objective-C 6.98% C 73.28% C++ 19.74%

squared's Introduction

Squared (Squared Pics)

Squared, or Squared Pics as it is known in the App Store, is an iOS app for squaring rectangular images without cropping or scaling. It does this by running a seam carving type of algorithm; the algorithm was adjusted (quality reduced) so that it can work on an iPhone in as close to real-time as possible. The algorithm works as follows:

  • An image is loaded by the user
  • The image is resized so that its largest dimension is no larger than 1000 pixles
    • For best results the original image would be used, but that increases run-time
    • The limit is presently hard defined, but it should be device dependent
  • Faces are detected in the image using Apple provided frameworks
  • Edges are detected in the image (the image's "energies") using a Sobel filter
  • The energies under faces are increased to decrease the likelyhood of them being changed
  • A seam matrix is created to determine the paths of least resistance
  • Seams are itteretively removed from the image
    • The seams of lowest value are discoverd
    • If there is a tie for the lowest value, then one is randomly choosen to prevent a clustering of seam cuts
  • At a defined interval the seam matrix is recalculated
    • For best results this would be done after every seam is removed, but that increases run-time
    • The interval is presently hard defined (via #define), but it should be device dependent
  • The resulting image is displayed

Squared App

The App is a very simple single-view application which allows people to open an image, process it, and then save or share it (using the sharing action sheet).

Squared Image Editing Extension

The image editing extension is launched from within the standard Photos app via its editing section. It performs the same functions as the app (they both call the same code: the SeamCarvingBridge class calls the SeamCarving C files), but rather than using the share sheet it saves changes back to the phtos app.

squared's People

Contributors

stollcri avatar

Watchers

James Cloos avatar  avatar

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.