-
Notifications
You must be signed in to change notification settings - Fork 1.7k
MMAL: ISP: Is there a way to change the demosaic filter values? #880
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
Comments
I'm afraid that there are no external controls possible for the demosaic block itself. It looks like the filter is fixed by the hardware, and the other parameters cause me to hesitate over IP release issues (it's Broadcom's IP and not Pi Towers'). What I suspect you really want to tweak is the colour conversion matrix (CCM) immediately following the demosaic - that defaults to the values used on the IMX219, which obviously isn't suitable in all situations.
(This is also active when feeding YUV or RGB in, and needs to convert the input to accordingly. Probably best to leave alone in those situations as the pipe is configured differently in each case. At some point I'll get it all nice and consistent, but not yet). The other bit that needs to be exposed is the white balance gains. They get applied to the red and blue channels post lens shading but prior to demosaic. Digital gain also falls into that block I think. |
Thanks! I tried to apply custom CCM to It's a little sad that the demosaic filter cannot be changed. Could you tell me the filter parameters (or the size of the filter) so I can tweak the values on CPU side? And thank you for telling me the internal pipeline order! |
Everything can be different for different ISP instances. The whole ISP is tile based and the control software has a simple scheduling algorithm for which tiles to do next. The full pipe config is attached to the tiles rather than being a global. Sorry, I really can't give details of the demosaic algorithm as it is not just a simple static filter. It's a 5x5 context, but that's about all I can say. The documentation is 3 pages of fairly terse maths that it'd take me a good couple of hours to understand! A slightly more complete list of the pipeline stages is documented at http://picamera.readthedocs.io/en/latest/fov.html#background-processes, although that omits the CCM after demosaic, and doesn't mention the low res resizer and output. I've been busy on other things recently but do intend to get most of those exposed, at least with a fairly coarse control. |
Thanks for a lot of information! BTW, are issues about |
If it's that killing the app whilst streaming kills the GPU, then it's known. It's a double free that I haven't tracked down. If you add Report it, and I'll look at it at some point. |
Thank you! I'll raise another issue. Thank you again! |
I said there was a bug in rawcam, but it turned out that it was my mistake (invalid values are set to IMX219's width and height registers). Sorry for that. Now my library is working! Thank you for your great frameworks and supports! |
I'm thankful to you Pi Towers for enabling users to use the ISP for raw image demosaicing via MMAL. It is faster than CPU. I really appreciate it!
However, I have a question: Is there a way to change the demosaic filter values?
The default filter is fixed, and borrowing values from other color components. So the output image is mostly greenish and it is difficult to collate colors of images.
Thanks.
The text was updated successfully, but these errors were encountered: