JoeHowse / iOSWithOpenCV

These are the projects for my book, iOS Application Development with OpenCV 3.
https://www.packtpub.com/application-development/ios-application-development-opencv
54 stars 18 forks source link

picture not showing on UIIMageView and buildtime issues #2

Closed pikaaboo closed 8 years ago

pikaaboo commented 8 years ago

First, well documented book. Thank you. In your first project "coolpig", within the updateImage method, we use MatToUIImage and directly display the generated UIImage in imageView. My imageView is showing a blank white screen. I put a NSLog into the method to check if its working, and its indeed being called every 2 seconds.

Note: I used my own .jpg image and not the default coolPig.png. Also, I didn't build the extra modules. I downloaded the prebuilt framework from opencv.org.

There are also 24 buildtime issues... "Documentation issues" eg: "Not a Doxygen trailing comment" matx.hpp and "Empty paragraph passed to '@param' command" core.hpp

pikaaboo commented 8 years ago

Turns out you can only use the .png image. I can see the UIImageview show the picture now. The documentation issues still persist. I have built your code but they seem to not have these documentation issues. I have about 30 of these issues for project2.

JoeHowse commented 8 years ago

Hi @pikaaboo! Thanks for reading the book and reporting these issues.

I think your project might have the -Wdocumentation compiler flag enabled. This will produce warnings if comments are not in the expected format. I suggest disabling it (or just ignoring the warnings). OpenCV's headers seem to contain some comments that are not fully Doxygen-compliant. It's an issue with OpenCV rather than the book's projects, so you could report it over in the official OpenCV repo (https://github.com/opencv/opencv/issues) if you want to pursue it further.

To disable the -Wdocumentation flag, go to the project's Build Settings pane, find the Apple LLVM 8.0 - Warnings - All Languages section, and set the Documentation Comments option to No.

I will do some tests with JPG images and will respond soon about this.

pikaaboo commented 8 years ago

Thanks for the reply. Disabling the flag removed the warnings. I wasn't sure if these documentation issues were caused by my openCV framework setup since your code did not have any build time warnings (got me a bit concerned). I see that you have done the same with your project file. Thanks for looking into the JPG issue. Also, if it helps, I'm guessing there is a problem while multiplying the origiralMat with randomColor. As a test, I used cv::cvtcolor(originalMat,updatedmat, CV_BGRA2GRAY) and later was able to view the grayscale version of the JPG image in UIImageview. One step that didn't seem to work was cv::multiply.

JoeHowse commented 8 years ago

I'm glad to hear that disabling the flag removed the warnings.

JPGs are working in my tests. Could you attach the file that is not working for you?

pikaaboo commented 8 years ago

Thank you for reviewing. I had re-tested the image with your code and it works. I should have done some mistake while replicating the project. Also, thanks for helping me resolve this problem.