2015-12-07 17:53:17 -0600 | received badge | ● Enthusiast |
2015-12-04 16:41:11 -0600 | commented answer | High Dynamic Range Imaging using openCV on iOS producing bad output @berak - I think it has everything to do with iOS, but your are right, nothing to do with the camera. I've expanded on my answer. |
2015-12-04 16:38:30 -0600 | received badge | ● Editor (source) |
2015-12-04 04:49:11 -0600 | received badge | ● Self-Learner (source) |
2015-12-03 21:29:37 -0600 | answered a question | High Dynamic Range Imaging using openCV on iOS producing bad output Thanks foundry for pointing me in the right direction. The UIImage+OpenCV class extension is expecting 8-bits per colour channel, however the HDR functions are spitting out 32-bits per channel (which is actually what I want). Converting the image matrix back to 8-bits per channel for display purposes before converting it to a UIImage fixes the issue. Here is the resulting image: Here is the fixed function: Alternatively here is a fix for the - (id)initWithCVMat:(const cv::Mat&)cvMat method in the OpenCV+UIImage class extension based on one of the iOS tutorials in the iOS section on opencv.org: http://docs.opencv.org/2.4/doc/tutori... When creating a new CGImageRef with floating point data, it needs to be explicitly told that it expects floating point data, and the byte order of the image data from openCV needs to be reversed. Now iOS has the float data! It's a bit of a hacky fix, because the method still only deals with 8 bit or 32 bits per channel or alphas and doesn't take into account every kind of image that could be passed from Mat to UIImage. |
2015-12-01 06:28:45 -0600 | commented question | High Dynamic Range Imaging using openCV on iOS producing bad output Unfortunately the system won't let me post the answer and warns me new users can't answer their own question for two days. I think it's because I signed up on the forum today. |
2015-12-01 05:08:08 -0600 | commented question | High Dynamic Range Imaging using openCV on iOS producing bad output Yes. I've found a fix. As a new user, the system says I must wait 2 days to answer my own question. I'll post the answer soon. |
2015-11-30 19:38:08 -0600 | asked a question | High Dynamic Range Imaging using openCV on iOS producing bad output I've asked this question at on stack overflow but maybe someone in the openCV community has come across the same issue: http://stackoverflow.com/questions/34... I'm trying to use openCV 3 on iOS to produce an HDR image from multiple exposures that will eventually be output as an EXR file. I noticed I was getting garbled output when I tried to create an HDR image. Thinking it was a mistake in trying to create a camera response, I started from scratch and adapted the HDR imaging tutorial material on the openCV to iOS but it produces similar results. The following C++ code returns a garbled image: This is what the image looks like: I've analysed the image, tried various colour space conversions, but the data appears to be junk. The openCV framework is the latest compiled 3.0.0 version from the openCV.org website. The RC and alpha produce the same results, and the current version won't build (for iOS or OSX). I was thinking my next steps would be to try and get the framework to compile from scratch, or to get the example working under another platform to see if the issue is platform specific or with the openCV HDR functions themselves. But before I do that I thought I would throw the issue up on stack overflow to see if anyone had come across the same issue or if I am missing something blindingly obvious. I have uploaded the example xcode project to here: https://github.com/artandmath/openCVH... The HDR tutorial from openCV: http://docs.opencv.org/master/d3/db7/... Getting openCV to work with swift was with the help from user foundry on github |