Giter Site home page Giter Site logo

mukyasa / mmcamscanner Goto Github PK

View Code? Open in Web Editor NEW
783.0 53.0 186.0 52.68 MB

Simulation of CamScanner app With Custom Camera and Crop Rect Validation

License: Other

Objective-C 70.69% Objective-C++ 20.07% C 8.64% Swift 0.60%
opencv-library opencv crop-rect-validation tesseract-ocr custom-camera simulation ios objective-c crop-image

mmcamscanner's Introduction

MMCamScanner

Simulation to CamScanner app With Custom Camera and Crop Rect Validation


MMCamScanner

Video preview Here

ChangeLog(31/7/2015)

  • Crop Feature Tweaked for more control in horizontal and vertical dragging.
  • NOW , Landscape and Potrait both images can be used in scanning the objects in images.
  • Addded Image Filters (Gray Scale, Magic Color ,Black and White)
  • Left Rotate and Right Rotate

Framework Add the Frameworks to see the Demo

OpenCV:http://opencv.org/
Tesseract OCR:https://github.com/gali8/Tesseract-OCR-iOS

Thanks to Stackoverflow for solving queries related to OpenCV

Credits

Excellent Square Detection Code Ref:Here and Here

OpenCV Tutorials:Here

Custom Camera Project Ref:Here
(LoganWright)

Crop Rect Validation Vector Ref:Here (Mysterious Trousers)

Also Thanks to this Project from where it is Inspired From

Maximilian Mackh :Here

This Project Contains

1.Custom Camera(Support Potrait Only Now) with Zoom Slider,Pinch Zoom,Tap to Focus features also.
2.Custom Ripple View Controller Animation.
3.OpenCV square Detection in Image for detecting objects.
4.OpenCV perpespective and warptransform for CROP feature.
5.Crop Validation for checking INVALID RECT.
6.Memory Efficient Camera(Thanks to SimpleCam Project).
7.Tesseract OCR.

My Other Repositories

MMPaper:
https://github.com/mukyasa/MMPaper

MMTextFieldEffects:
https://github.com/mukyasa/MMTextFieldEffects

MMGooglePlayNewsStand:
https://github.com/mukyasa/MMGooglePlayNewsStand

MMPaperPanFlip:
https://github.com/mukyasa/MMPaperPanFlip

MMTransitionEffect:
https://github.com/mukyasa/MMTransitionEffect

Contact Me

Mukesh Mandora

Contact: [email protected]

Twitter: http://twitter.com/mandymuku

LinkedIn: https://in.linkedin.com/in/mukeshmandora

Github:https://github.com/mukyasa

License

MMCamScanner is available under the Apache license. See the LICENSE file for more info.

mmcamscanner's People

Contributors

mukyasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmcamscanner's Issues

Convert in swift 3

Hello, nice work !

but can i transform this app in swift 3 ?

thanks for your reply.

Data Encryption

Dear ,

Thank you for your support.

I just want to know that is this library using any Data Encryption processing (like "AES", "3DES", "RSA", "DH" etc), if yes could you please give some information about it, if possible.

Thanks in advance.

Can not recognize some image

Hi, Thanks to your great project. It works fine for normally rectangle image. But if there's something overlays it a little bit, it will recognize fail, like below image:

1

And I tried on camscanner app, it works!
Would you please tell me how to fix this? thx~

Library Not found

ld: library not found for -lstdc++.6.0.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)

-- Getting above error, i am not getting , how to resolve this issue..
Anyhow if i resolve above issue, i am getting TesseractOCR framework not found issue even framework were added..

hello, I have a trouble

MMCamScanner[35084:1889935] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.

也是第一次允许安装的时候,点击拍照,出现,界面卡顿,全是黑色的,出现不了相机的界面

我该怎么办????求帮助!!!!!

Xcode 9 error

hello !
I used Xode9 Cant building your Project
this are many errors , my used language is OC,
2017-12-14 5 01 16 please give me some suggest

Error on captureStillImageAsynchronouslyFromConnection

[_stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error)

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x174056170 {Error Domain=NSOSStatusErrorDomain Code=-16800 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-16800), NSLocalizedDescription=The operation could not be completed}

When is the working "Pod" version is expected?

Currently after cloning it is needed to convert to new swift syntax and add 3rd party libs. I saw there is an announcement of supporting pods. When is that expected to be (I want to start with evaluating project).

Thanks! It looks like a great work by the way!

How to download and install

Please advice how to download and install TesseractOCR and OpenCV....please give step by step
I try but getting error #import <TesseractOCR/TesseractOCR.h> and #include <opencv2/imgproc/imgproc.hpp> file not found

Getting crash when failed to identify edges.

Hi, Sometimes app getting failed to identify the edge and its getting crash. In Log is displays Missing 1, Missing 2 ( NSLog(@"MISSING %i", i);), then its crash. Below I have included Log.

The app was working fine before updating to swift2.3 to swift 3 (i have created bridge header) and Xcode to 8.3.2.

Crash due to signal: SIGSEGV(SEGV_MAPERR) at 10874c020
0   CoreGraphics                    argb32_mark + 12452
1   CoreGraphics                    RIPLayerBltShape + 1084
2   CoreGraphics                    ripc_Render + 284
3   CoreGraphics                    ripc_DrawRects + 324
4   CoreGraphics                    CGContextFillRects + 104
5   CoreGraphics                    CGContextFillRect + 52
6   myApp                           -[MMCropView drawRect:] (MMCropView.m:258)
7   myApp                           -[CropViewController detectEdges] (CropViewController.mm:302)
8   myApp                           -[CropViewController viewWillAppear:] (CropViewController.mm:57)
9   UIKit                           -[UIViewController _setViewAppearState:isAnimating:] + 632
10  UIKit                           -[UIViewController __viewWillAppear:] + 156
11  UIKit                           __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 1088
12  UIKit                           _runAfterCACommitDeferredBlocks + 292
13  UIKit                           _cleanUpAfterCAFlushAndRunDeferredBlocks + 528
14  UIKit                           _afterCACommitHandler + 132
15  CoreFoundation                  __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
16  CoreFoundation                  __CFRunLoopDoObservers + 372
17  CoreFoundation                  __CFRunLoopRun + 956
18  CoreFoundation                  CFRunLoopRunSpecific + 424
19  GraphicsServices                GSEventRunModal + 100
20  UIKit                           UIApplicationMain + 208
21  myApp                           main (LocaleMapperServiceImpl.swift:20)
22  libdyld.dylib                   start + 4

Is there any way to handle it or fix it? Please let me know if you need any additional information. Thank you.

Installation fails

I have added both frameworks. There might be lot of changes in new iOS versions. Can you look into the step of installation and make it easy for us to integrate your awesome lib ? :). Have spent lot of time , but cant get it to working. Thanks!

Swift Compile Error

I'm using xcode 8.2.1
but your code is not supporting my devices it's not showing the simulators. I changed deployment target also.

Command /Applications/Xcode 8.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

Command /usr/bin/ditto failed with exit code 1

Please help me ASAP. I have an urgent requirement.

Thanks,
Nandu K

Memory issue

The memory does not get deallocated and keeps on increasing until the app crashes.

CGFloat scaleFactor = [_sourceImageView contentScale];
CGPoint ptBottomLeft = [_cropRect coordinatesForPoint:1 withScaleFactor:scaleFactor];
CGPoint ptBottomRight = [_cropRect coordinatesForPoint:2 withScaleFactor:scaleFactor];
CGPoint ptTopRight = [_cropRect coordinatesForPoint:3 withScaleFactor:scaleFactor];
CGPoint ptTopLeft = [_cropRect coordinatesForPoint:4 withScaleFactor:scaleFactor];

        CGFloat w1 = sqrt( pow(ptBottomRight.x - ptBottomLeft.x , 2) + pow(ptBottomRight.x - ptBottomLeft.x, 2));
        CGFloat w2 = sqrt( pow(ptTopRight.x - ptTopLeft.x , 2) + pow(ptTopRight.x - ptTopLeft.x, 2));
        
        CGFloat h1 = sqrt( pow(ptTopRight.y - ptBottomRight.y , 2) + pow(ptTopRight.y - ptBottomRight.y, 2));
        CGFloat h2 = sqrt( pow(ptTopLeft.y - ptBottomLeft.y , 2) + pow(ptTopLeft.y - ptBottomLeft.y, 2));
        
        CGFloat maxWidth = (w1 < w2) ? w1 : w2;
        CGFloat maxHeight = (h1 < h2) ? h1 : h2;
        
        
        
        cv::Point2f src[4], dst[4];
        src[0].x = ptTopLeft.x;
        src[0].y = ptTopLeft.y;
        src[1].x = ptTopRight.x;
        src[1].y = ptTopRight.y;
        src[2].x = ptBottomRight.x;
        src[2].y = ptBottomRight.y;
        src[3].x = ptBottomLeft.x;
        src[3].y = ptBottomLeft.y;
        
        dst[0].x = 0;
        dst[0].y = 0;
        dst[1].x = maxWidth - 1;
        dst[1].y = 0;
        dst[2].x = maxWidth - 1;
        dst[2].y = maxHeight - 1;
        dst[3].x = 0;
        dst[3].y = maxHeight - 1;
        
        cv::Mat undistorted = cv::Mat( cvSize(maxWidth,maxHeight), CV_8UC4);
        cv::Mat original = [MMOpenCVHelper cvMatFromUIImage:_adjustedImage];
        
        cv::warpPerspective(original, undistorted, cv::getPerspectiveTransform(src, dst), cvSize(maxWidth, maxHeight));
        
        _sourceImageView.image=[MMOpenCVHelper UIImageFromCVMat:undistorted];

TesseractOCR Undefined symbols for architecture arm64:

Hi, Thanks to your great project. It works fine for normally rectangle image In Simulator. But in the when we are unable to build into iPhone. Getting Belo Issues.

ld: warning: ignoring file /Users/XXXX/Desktop/MMCamScanner/TesseractOCR.framework/TesseractOCR, file was built for archive which is not the architecture being linked (arm64): /Users/XXXX/Desktop/MMCamScanner/TesseractOCR.framework/TesseractOCR
Undefined symbols for architecture arm64:
"OBJC_CLASS$_G8RecognitionOperation", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64 referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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.