-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically Stitching images #2
Comments
Michael, i have looked at your demo project. There are at least two issues causing you problems
I found your project fairly confusing, you should try to clean it up and simplify it. Your storyboard view controller instantiation is not correct for example (get rid of those UINavigationControllers, you don't need them). In answer to your questions...
The pipeline is detailed here: http://docs.opencv.org/modules/stitching/doc/introduction.html As I am using the highest-level stich method, I am relying totally on openCV's default pipeline to deliver the resulting stitch. As the doc says:
It is possible to treat parts of the pipeline separately to get a higher degree of control over the process. The methods are all documented here. |
Thank you very much for your answers foundry. I appreciate the time and thought you put in. I have just tried compressing the images to 720 by 960 in order to have the images be the same resolution as the ones in the original project. I tested the project on an Iphone 4 and Iphone 6. While this ensured that memory warnings did not show up in the Iphone 4, it appeared to have not stopped the issue of the images not stitching properly. I believe your second point is of note: there must be some issue saving or loading the images. In my CameraViewController I save the images to my camera roll and to a location in the file system. When I pass those images in the file system to the CVViewController as the array of UIImages in my file system, the stitching method does not work. However, when I take the images from my camera roll and download them to my computer and load them into my project through the copy bundle resources section, the stitching algorithm can easily stitch any of the images I put (even the ones at 2448 by 3264). The only major difference between the two images is when I log their contents appears to be the imageAsset section (the top one is dragged into the project and copy resource bundle, the bottom one is loaded from the stored files): Perhaps the problem might be associated with the fact that I used imageWithContentsOfFile as opposed to imageNamed. imageNamed caches the image which might result in significant performance boost if the stitching algorithm references the image often? I have several more questions as a result
Again I would like to thank you very much for your time and effort. |
I believe I've managed to resolve the issue! It was a foolish error on my part (as these things tend to be). I want to thank you again sincerely for your time foundry. Your comments helped me to start looking in the right direction |
Hi Michael. I'm glad you found a solution. By the way, I just noticed you posted a question on Stack Overflow which you self-answered. You should accept your reply so the question is closed. Good luck with openCV! |
Michael, I have at last managed to diagnose the real cause of this issue. Images taken natively with the iOS cameras are not stored in the correct orientation (they are rotated during display only). For a fix, I have added a category on UIImage to check the |
I have test four images with 3200*2400 , and use |
Hello foundry,
Thank you very much for the image stitching code. It is informative and works on the provided images.
I am having difficulty, however, with dynamically taking photos and stitching them together. When I take two images using my iphone camera and pass those images as the imageArray in CVViewController, it tries to stitch the images but returns a null image:
2015-06-04 11:18:30.312 CVOpenStitch[2631:498516] stitchedImage (null)
2015-06-04 11:18:30.313 CVOpenStitch[2631:498516] scrollview contentSize {0, 0}
I'm not sure why it is incapable of stitching the images together.
-Thank you very much for your time
Michael Gofron
The text was updated successfully, but these errors were encountered: