3

i have a project similar to what iphone scanner apps do (docscanner, scannerpro, etc). but i'm new to opencv and objective-c. the app is supposed to detect and remove the edges/background of a document/paper taken a photo of using an iphone.

i've seen this DETECT the Edge of a Document in iPhoneSDK which is what i want to do. i've seen what canny does but all it shows are edges of all shapes in the image, not the paper i want to separate.

i think this is what i'm supposed to do: OpenCV C++/Obj-C: Detecting a sheet of paper / Square Detection but i can't make it work in xcode.

and i don't know how to do it (being a newbie). i've looked hard everywhere and couldn't find a way to detect edges of a document and crop them from the image. or maybe i found something but i didn't understand. i'm supposed to code it in xcode and objective-c.

Community
  • 1
  • 1
alfredt
  • 39
  • 1
  • 3
  • when i try to use the second link's code in Xcode, i get errors: - no matching constructor for initialization of 'Point' - use of undeclared identifiers 'angle', 'cosine', 'maxcosine', 'squares' – alfredt Jul 19 '12 at 20:09
  • 1
    Karl's answer to the second question shows exactly how to do this. It sounds like your issue is more one of not being able to compile OpenCV properly. If so, you should probably rework your question to reflect this. – Brad Larson Jul 19 '12 at 20:57
  • opencv is properly compiled. i can build some opencv xcode projects and they work fine. – alfredt Jul 23 '12 at 17:07
  • The compiler errors you are getting are specific to the code in that answer. Note that the `angle()` function is defined in the code provided by the question above the answer, so you'll need to include that code in your application for the answer's function to compile. – Brad Larson Jul 23 '12 at 17:10
  • i noticed that and i've corrected/included that in the code. but i still get a "no matching function for call to `angle`", though i've placed the definition of the function in the code. – alfredt Jul 23 '12 at 18:33
  • this part gets the error: `cosine = fabs(angle(approx[j%4], approx[j-2], approx[j-1]))`. i tried replacing and renaming the function, and also checked if i missed parameters and i haven't. – alfredt Jul 23 '12 at 18:48
  • Just to be clear, you've implemented the `angle()` function as listed by moosgummi in that question, and you're still seeing compile errors in the above code? – Brad Larson Jul 23 '12 at 19:06
  • yes. other definitions of `angle` are just as struct members, so it shouldn't conflict with any included libraries, right? – alfredt Jul 23 '12 at 19:16
  • i think i saw what's missing. i'll comment more if anything comes up. thanks for replying. do post tips (opencv, xcode, coding in general) if you have some. thanks. – alfredt Jul 23 '12 at 19:54

0 Answers0