mmackh / maimagepickercontroller-of-instapdf Goto Github PK
View Code? Open in Web Editor NEWFully customizable UIImagePicker replacement with flexible cropping, filters, perspective correction, rotation etc.
Home Page: http://instapdf.me
Fully customizable UIImagePicker replacement with flexible cropping, filters, perspective correction, rotation etc.
Home Page: http://instapdf.me
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
Would be great to use this as an alternative to UIImagePickerController and would be awesome to work in Universal.
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)
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.
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
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.
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
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!
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();
}
Hello,
in your Readme you're missing the 'MediaPlayer' Framework as a dependency. Otherwise compiling will break with an error for MPVolumeView.
Only a small "error", but it would complete your framework dependency list.
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 ;-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.