Coder Social home page Coder Social logo

mmackh / maimagepickercontroller-of-instapdf Goto Github PK

View Code? Open in Web Editor NEW
517.0 517.0 131.0 30.21 MB

Fully customizable UIImagePicker replacement with flexible cropping, filters, perspective correction, rotation etc.

Home Page: http://instapdf.me

Objective-C 2.63% Objective-C++ 2.02% C++ 85.56% C 9.80%

maimagepickercontroller-of-instapdf's People

Contributors

mmackh 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maimagepickercontroller-of-instapdf's Issues

Wrong detect and crop image

I replace [imagePicker setSourceType:MAImagePickerControllerSourceTypeCamera]; to [imagePicker setSourceType:MAImagePickerControllerSourceTypePhotoLibrary]; in initButton function. Image in photo is detected not look like image that capture from camera and wrong crop

duplicate symbol _appDelegate in:

duplicate symbol _appDelegate in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerControllerAdjustViewController.o

duplicate symbol _GlobalGrayColor in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerControllerAdjustViewController.o

duplicate symbol _GlobalGreenColor in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerControllerAdjustViewController.o

duplicate symbol _GlobalSeperatorColor in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerControllerAdjustViewController.o

duplicate symbol _appDelegate in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerFinalViewController.o

duplicate symbol _GlobalGrayColor in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerFinalViewController.o

duplicate symbol _GlobalGreenColor in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerFinalViewController.o

duplicate symbol _GlobalSeperatorColor in:

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAOpenCV.o

/Users/developer/Library/Developer/Xcode/DerivedData/Build/Intermediates/opencvdemo.build/Debug-iphonesimulator/opencvdemo.build/Objects-normal/i386/MAImagePickerFinalViewController.o

ld: 8 duplicate symbols for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Memory Warning

First of all, thank you for this wonderful library! I am trying to implement it, but everytime the captureSession start running, or the image is cropped, I get a memory warning (on both iPhone 4s and 5) and often some crashes. The normal RAM usage is around 2-3 MB, when the MAImagePickerController is called the memory jumps to 32MB and then to over 90 when the image is cropped.

Could not instantiate class named NSLayoutConstraint

Hi, I just downloaded this project on my newest Xcode 4.6. I built it for iOS 5.0 and tested it out on iPhone 4S running iOS 5.0 but as soon as the app is launched I get this error.

Does this mean that this project only supported on ios6 ?

2013-04-24 19:07:14.929 instaoverlay[4350:707] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x371838bf 0x324f31e5 0x371837b9 0x371837db 0x3203e3a1 0x3203e50f 0x3203e277 0x31fcf3fd 0x31f3f9cb 0x31e1eea1 0x31d9478b 0x31d92f9d 0x31d85941 0x31df7541 0x2ad5 0x31d937eb 0x31d8d3bd 0x31d5b921 0x31d5b3bf 0x31d5ad2d 0x32db5e13 0x37157553 0x371574f5 0x37156343 0x370d94dd 0x370d93a5 0x31d8c457 0x31d89743 0x2819 0x27a0)
terminate called throwing an exception

64 bit support

The example project doesn't include 64 bit support. How can I do that? If I add 64 bit architecture then I get compile errors left and right.

Using this control I am unable to submit a binary to app store.

screen shot 2015-07-17 at 10 44 21 am

screen shot 2015-07-17 at 10 54 58 am

How to add only cropper in my app?

Hi, I am using this project but I need the only cropper like this.
The main issue with this is it's not releasing memory after cropping and it increases regularly. This issue occurs more frequently in a high-end device like 6s Plus, 7 Plus etc and sometimes I get rotated (90 degrees) image.
Can you please suggest how to use the only cropper, because you used open cv for image cropping.

MAImagePickerController-of-InstaPDF camera part height issue

First thanks for your MAImagePickerController-of-InstaPDF code. Its use full for document capture. I have tested in this code working fine. I have changed camera heightand x position in the below code
" CGRect layerRect = CGRectMake(0, 150, self.view.bounds.size.width, self.view.bounds.size.height - 220);"
then i have captured image then see view page it will show full size . i means its not captures image with camera height size. Can you please how to i will resolve this . Please help me. Waiting for your message

OCR reading issue

It worked really well. Thanks a lot. But when I did some OCR on the documents by Tesseract, the results were really weird (as it still showed up perfectly on ImageView control).
I decided to save the image before any image processing (right after it's taken in MAImagePickerController) then did OCR reading, it worked again!
I think there must be something in the image processing section that I haven't figured it out.
It also works with the final adjusted image if I go to Photos, do some minor edits and press "Save".

Please forgive my lack of skills. Thanks again for your fantastic work!
ok
er

Memory usage is summed up, Receive Memory warning , image size is doubled and app crashes

my app consumes 80 MB above memory after perspective correction. After logging,i found image size was approximately doubled (original size:1936X2592 and perspective corected size:2566X3494). This consumed memory was not relased completely ,only release upto 50MB and internally release somtimes only. So memory usage was summed up for each image's perspective correction and app crashes in device with 512MB ram.Reason was below operation. I don't understand reason to use these operations.

CGFloat w1 = sqrt( pow(anchorPts[2].x - anchorPts[3].x , 2) + pow(anchorPts[2].x - anchorPts[3].x, 2));
CGFloat w2 = sqrt( pow(anchorPts[1].x - anchorPts[0].x , 2) + pow(anchorPts[1].x - anchorPts[0].x, 2));

CGFloat h1 = sqrt( pow(anchorPts[1].y - anchorPts[2].y , 2) + pow(anchorPts[1].y - anchorPts[2].y, 2));
CGFloat h2 = sqrt( pow(anchorPts[0].y - anchorPts[3].y , 2) + pow(anchorPts[0].y - anchorPts[3].y, 2));

CGFloat maxWidth = (w1 < w2) ? w1 : w2;
CGFloat maxHeight = (h1 < h2) ? h1 : h2;

Finally i figure out this was causing memory problem and app crashes..I changes size of perspectively corrected image to original image size. And memory reduces by half. and also app don't crashes.Changes I made

  • (void)correctPerspective{
    // Define the destination image
    cv::Mat original = [OpenCV cvMatFromUIImage:self.pickedImg];

    CGFloat scaleFactor =[self.imgDoc contentScale];
    vector anchorPts;

      CGPoint pt=[boundary.allPoints[0] CGPointValue];
       anchorPts.push_back(Point2f(pt.x/scaleFactor,pt.y/scaleFactor));
    
      pt=[boundary.allPoints[2] CGPointValue];
      anchorPts.push_back(Point2f(pt.x/scaleFactor,pt.y/scaleFactor));
    
       pt=[boundary.allPoints[4] CGPointValue];
      anchorPts.push_back(Point2f(pt.x/scaleFactor,pt.y/scaleFactor));
    
      pt=[boundary.allPoints[6] CGPointValue];
      anchorPts.push_back(Point2f(pt.x/scaleFactor,pt.y/scaleFactor));
    

    cv::Point2f src[4], dst[4];
    src[0].x = anchorPts[0].x;
    src[0].y = anchorPts[0].y;
    src[1].x = anchorPts[1].x;
    src[1].y = anchorPts[1].y;
    src[2].x = anchorPts[2].x;
    src[2].y = anchorPts[2].y;
    src[3].x = anchorPts[3].x;
    src[3].y = anchorPts[3].y;

    dst[0].x = 0;
    dst[0].y = 0;
    dst[1].x = original.cols - 1;
    dst[1].y = 0;
    dst[2].x = original.cols - 1;
    dst[2].y = original.rows - 1;
    dst[3].x = 0;
    dst[3].y = original.rows - 1;

    cv::Mat undistorted= cv::Mat( cvSize(original.cols,original.rows), CV_8UC1);

    cv::warpPerspective(original, undistorted, cv::getPerspectiveTransform(src, dst), undistorted.size());

    original.release();

    finalImg=[OpenCV UIImageFromCVMat:undistorted];
    undistorted.release();

}

iPhone 5 camera Grid doesn't appear

Hi,
there is a little issue on iPhone 5 working with Images.xcassets catalog. The grid image didn't appear on my iPhone 5.

I modified the file MAImagePickerController.m from:

gridImage = [UIImage imageNamed:@"[email protected]"];

to:

gridImage = [UIImage imageNamed:@"camera-grid-1136"];

And it works.
bye

P.S. Thank you for you code Maximilian ;-)

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.