Skip to content
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

Will the Sony model work for dual camera iPhone? #94

Open
JasonVann opened this issue Sep 29, 2019 · 15 comments
Open

Will the Sony model work for dual camera iPhone? #94

JasonVann opened this issue Sep 29, 2019 · 15 comments

Comments

@JasonVann
Copy link

I don't have a iPhone 6s handy, but I heard some people are getting good results with iPhone 6s. If I try Sony model with raw images taken with iPhone with two or three cameras, (iPhone 8 or iPhone 11), will the result be roughly the same as with iPhone 6s? Thanks!

@gaseosaluz
Copy link

When using the Sony model, I have had good/equivalent results when using iPhone 6s and Xs images. No real differences in the results.

@l0stpenguin
Copy link

@gaseosaluz i have tried with RAW images from my iphone X and changed the black level but got terrible results. Here are the details:
#75 (comment)

Do you have any idea what might the issue be?

@gaseosaluz
Copy link

@mevinDhun I looked at the details in #75 and I can't off the top of my head figure out what the problem you have could be. I have not worked on this in a while, but I still have my code. Maybe you can find a way to send me the RAW image and I can try to find time run it in my setup?

@l0stpenguin
Copy link

@gaseosaluz here is a link to the dng sample:
https://drive.google.com/drive/folders/1toiGYKQ1WeCiqbXB4rH24-wsH3VvfBT3?usp=sharing

In my tests, i have calculated the black level rather than hardcoding it:

im = raw.raw_image_visible.astype(np.float32)
black_level = raw.black_level_per_channel[0]
im = np.maximum(im - black_level, 0) / (16383 - black_level)  # subtract the black level

In case you can't find time to try, please share your modified code which could be helpful.
Thanks.

@gaseosaluz
Copy link

@mevinDhun I will try to get to this as soon as I can. It may be the weekend. Unfortunately I don’t have my code in a public repo, but if I need to share it I will see what I can do about it.

@gaseosaluz
Copy link

@mevinDhun I found a few minutes to run your image through my code. Unfortunately I did not get good results either. At this point I don't think that the problem is related to the black level. I will keep your picture handy and when I have some time I will try to run the code through a debugger and see if I find anything.

A quick question - when you took the underexposed image, did you make sure that you held the camera steady (or had it in a tripod or something holding it steady?). I ask because I noticed that my corrected image appeared to show signs of the camera being 'shaken' when the picture was taken. I have had problems with these type of images before. I don't know if this is the problem but I thought I would mention it.

In any case, sorry I was not able to help. If I do figure something out I will post here.

@l0stpenguin
Copy link

@gaseosaluz That picture was taken handheld, so it might have some camera shake. Let's assume it is a faulty picture. But i have tried with another one where i place the phone against a wall to ensure minimal shake. Here is the DNG taken from Halide camera app:
https://drive.google.com/open?id=1x0PrDS0fWtpmXgM4EgdPycbKG5hAgqdd

Running it through the model outputs this (which looks very bad):
10004_00_0 05s_650

At this point, i'm very confused since i could not get any decent results but the paper stated it should work on iphone camera sensors.

@gaseosaluz
Copy link

@mevinDhun Ok, I will try to run this new picture tonight. I am also puzzled because I have gotten decent results from pictures form an iPhone 6S and iPhone Xs. I took the pictures with the VSCO app, but I am not sure it is app dependent. Again, if I have better news, I will post here

@littleqing0914
Copy link

When using the Sony model, I have had good/equivalent results when using iPhone 6s and Xs images. No real differences in the results.

Can I test the pictures taken by my camera or mobile phone directly? How should I do?

@gaseosaluz
Copy link

gaseosaluz commented Mar 17, 2020 via email

@l0stpenguin
Copy link

@gaseosaluz it would be really useful if you could provide the coreml model. I am an ios developer and i would like to try to run it on mobile. Probably i will have to use Accelerate framework to replicate numpy matrix operations in swift.

@edchepen
Copy link

edchepen commented Mar 17, 2020 via email

@mouryareddy
Copy link

Hi @gaseosaluz
Can you post your black_level_per_channel and maximum pixel value in your raw picture , I see the image posted by @l0stpenguin black_level_per_channel is 528 and max pixel value is 609 similiar to mine and got bad results

@vivek-varma
Copy link

@l0stpenguin if you resolved the issue, can you share the code for removing black layer in swift. I also want to port the model into iPhone.

@vivek-varma
Copy link

@gaseosaluz how did test the coreML model. Any script for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants