KronTalk

Chronos => Software Dev => Topic started by: tesla500 on August 03, 2018, 01:02:25 PM

Title: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: tesla500 on August 03, 2018, 01:02:25 PM
This beta update adds a greatly improved demosaic for in-camera h264 saving. This brings the quality of saved MP4 files near that of externally processed RAW files. We've been using this regularly without issues, but as always with beta software, don't use it for anything mission critical where you can't recreate a shot.

This replaces the old bilinear demosaic with one based on AHD (Adaptive Homogeneity Directed), with some modifications for fewer color artifacts around single-pixel objects, and lower resource utilization.

Installation
This update must be installed over V0.3.0, if you have not installed that, follow the instructions on the software update page (https://www.krontech.ca/software-updates.html). Once you're on V0.3.0, you can download the attached update, the installation instructions are exactly the same as for V0.3.0 update linked above. Once installed, the application revision will remain the same but the FPGA revision will be 3.9

Let us know how it works!
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: Nikon1 on August 03, 2018, 01:21:01 PM
Thanks a lot for further improofing the Image Quality.
Keep up the good Work.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: JamesB on August 03, 2018, 07:29:26 PM
Here are my image and video tests on the new Demosaic Patch.  Highly recommended install.  There are some slim black borders on the top and bottom of h.264 not on RAW which are being fixed by the team already. Other than that the patch is solid.  Should be ready for wide release soon.  Thanks, Krontech Software team! 

http://www.hispeedcams.com/chronos-1-4-new-firmware-improves-h-264-image-quality/
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: jasonfish on August 03, 2018, 09:37:22 PM
Did you happen to do any comparisons before and after the patch?
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 04, 2018, 08:49:20 AM
I installed the update without problems and did try to take a comparison, however i nudged the focus and therefore the test was invalidated :(
I just trust you guys and I'm not going to revert the update...
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: JamesB on August 06, 2018, 02:46:19 PM
Did you happen to do any comparisons before and after the patch?
No, but shot a lot with the regular h.264. I had no available time to apply the update at separate locations.  There is a big difference in quality for the demosaic now.  Before it was dancing moire and aliasing everywhere fine detail was observed, now it is about 70% of what the RAW offers.  I will still shoot RAW for maximum quality where I need it but for just playing around the h.264 would do well. 

WHen direct DNG saving is ready it will also save the conversion step which is kind of a pain.   Maybe the DNG could be compressed to save space also.  Right now a typical session in RAW with the camera is about 30GB worth of data. Where it could really be 3GB if it was JPG like.    I wouldn't be opposed to a JPG saving feature either as long as the conversion is adequate.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 17, 2018, 06:18:30 PM
i am having a problem with install
im on version 3 firmware
i can back up calibration data but then it says no software update found, tried ejecting and repluging lots of times
any ideas?
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: nik282000 on August 17, 2018, 06:40:41 PM
Are you using the same usb stick that you had for previous updates? I have found that only out of the pile I own will work for updates even though they all work for backing up callibration and saving video.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 17, 2018, 06:48:49 PM
Are you using the same usb stick that you had for previous updates? I have found that only out of the pile I own will work for updates even though they all work for backing up callibration and saving video.
ill try another i think its same one
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 17, 2018, 06:58:13 PM
just tried three diffrent ones with no sucess,
i have used one of these to do my updates in the past
do you guys just put the extracted folder on the usb stick? camupdate folder?
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 18, 2018, 01:33:24 AM
do you guys just put the extracted folder on the usb stick? camupdate folder?
Yep. Just the camupdate folder extracted from the download zip to the root of an USB stick. You might also try an USB harddisk. If i remember correctly I also had trouble using some older thumbdrives and only some of them work.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 21, 2018, 10:08:16 AM
hmm ok, ill keep trying to find more ones to try...
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: nik282000 on August 22, 2018, 08:12:00 AM
If you want I can send you an image of my updated SD card. You would need to restore your callibration data (mine is part of the SD image). It's ~700mb but I think Google drive will share stuff that big.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 22, 2018, 10:04:32 AM
im not sure how that would help? can you explain?
thanks
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: nik282000 on August 22, 2018, 10:31:00 AM
Every time updated my Chronos I would take out the OS SD card and make an .img file, that way I could always restore an image if I broke something. If you can't get your camera to update you could use one of my backup .img files, write it to a microsd card and put it in your camera, then you would have the up to date software. You would also have to restore your calibration data because my backups contain my calibration.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 22, 2018, 10:39:02 AM
If you want I can send you an image of my updated SD card. You would need to restore your callibration data (mine is part of the SD image). It's ~700mb but I think Google drive will share stuff that big.
Or just use the image provides on the official website:
https://www.krontech.ca/software-updates.html
scoll all the way to the bottom
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: nik282000 on August 22, 2018, 12:11:09 PM
That image is for the v0.1 software.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 22, 2018, 01:03:51 PM
oops, you're right. I thought they've updated it. however it would still give you a known clean state to start from.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: tesla500 on August 22, 2018, 01:59:07 PM
The card image mentioned above is V0.1, you can directly update to V0.3.0, then apply the demosaic update.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 23, 2018, 05:01:19 PM
The card image mentioned above is V0.1, you can directly update to V0.3.0, then apply the demosaic update.
i am on version 3.0 and it won't let me do software update, i have tried 4 diffrent usb's now
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: tesla500 on August 23, 2018, 11:39:55 PM
Can you successfully save video to those USB drives on the camera?
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 24, 2018, 05:20:57 PM
Can you successfully save video to those USB drives on the camera?
i have never tried to save to usb drive, but i can try now, i always used sd card
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 24, 2018, 06:07:07 PM
Yeah it saves onto memory stick
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 28, 2018, 11:05:27 AM
Can you successfully save video to those USB drives on the camera?
any ideas, still stuck
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 28, 2018, 01:26:42 PM
the updatescript is not that complicated, you could maybe put the required files on a working sd card and then connect to the camera via ssh. From there on you could manually update things from the sd card without the cam software.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 28, 2018, 05:46:47 PM
the updatescript is not that complicated, you could maybe put the required files on a working sd card and then connect to the camera via ssh. From there on you could manually update things from the sd card without the cam software.
not that complicated is relative, haha. whats a ssh? im not a computer guy
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 29, 2018, 08:56:51 AM
the updatescript is not that complicated, you could maybe put the required files on a working sd card and then connect to the camera via ssh. From there on you could manually update things from the sd card without the cam software.
not that complicated is relative, haha. whats a ssh? im not a computer guy
SSH is a way to connect your camera to a computer and then execute commands via a terminal in text-form. It's really powerfull but has a steep learning courve.
If you can tell me the EXACT mounting point of your SD-card (something like "/dev/mmcblk0p2"; can be seen in the save dialog) I could modify the updatescript to run from there for you. You'd probably still need to start it manually as the camapp software is likely not going to see it on there but at least you won't have to do all the commands by hand.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on August 31, 2018, 02:25:12 PM
on my 6 or 7th memory stick and several tries per stick finally got it to 3.9, wow that was harder than expected but now got it, into the waterhousing it goes!
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: NiNeff on August 31, 2018, 10:30:41 PM
glad you made it!
@devs can we get updating via Ethernet in the future? Should make things easier.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: DDR on September 06, 2018, 09:50:07 PM
Mm, ethernet updating would be nice…
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on September 13, 2018, 04:27:51 PM
https://youtu.be/D_warh0769A
https://youtu.be/LC4eDRO1LBc
https://youtu.be/dEMmd77-bcc
https://youtu.be/n6enhSUrnIE
https://youtu.be/zvkWmqVBw6Q
https://youtu.be/D34RX6pkfUY
https://youtu.be/QYgnWtTq5a8
https://youtu.be/37M7HgppSWw
https://youtu.be/ftj7AQ1P4as
https://youtu.be/qBZQrX7E8Eg
https://youtu.be/Jd0WSUxtyOk
https://youtu.be/2NqeikBD_bo
https://youtu.be/XT1M2nba5E0
https://youtu.be/54hHnRff-LI
https://youtu.be/CCTZO21c81o
some test waves this am with new firmware i think my focus was a bit close so need to try again
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: patrickrebstock on September 15, 2018, 12:34:10 AM
take a look at the image issues on high contrast moving water with the new firmware, pretty funky stuff going on, can this be worked on?
https://youtu.be/ywW78_fZfL0
focus still off its biased too close
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: Nikon1 on September 16, 2018, 03:57:03 AM
take a look at the image issues on high contrast moving water with the new firmware, pretty funky stuff going on, can this be worked on?
https://youtu.be/ywW78_fZfL0
focus still off its biased too close
Well, that is just how Bayer-Sensor work.
They have a pattern of Red Green and Blue Color Filters over the individual Pixels of the Sensor, to be able to produce a color image from an sensor which actually just captuers brightness information for each individual pixel.
The Problem with that is, that the software (which then later tries to make a color-Image from that Only-Brightness-Information and the information of the Pattern,) Can get easily confused by single very bright pixels.
So if an very bright reflection on the water appears and it only takes up one single pixel in the final image, how would the software know if it was white or the color of the individual Pixel, for example Red?
I kind of allready explained this exact problem in an other thread " i am professional colorist..."
For most of todays Video-Cameras this is not a problem. Because they have sensors with much higher Resoultion than what the final Video would be. For example a 24Megapixel Sensor which captures FullHD or 4K video. Final Video still is just 2MP or 8MP, and that is way less than the original 24MP from the sensor. So there is room for heavy interpolation to get an more accurate result for the real brightness and color-value of each pixel.
For highspeed-Cameras like the chronos that is mostly not the case. Since those cameras allready push the limit of what is technicaly possible, there is no room for downscaling and interpolation like this.
So capturing stuff like this, shown in your test, is tricky in any case with that camera.
.
Your best bet would propably be to try using RAW and an different debayer algorithm or Debayering software. some of them could give better results than this for that special scene. Otherwise you will most likely end up with lots of  those colorfull pixels all over your footage. Not sure, tho if you could get rid of all of them with this Method, but i guess, worth a try anyways.
Only other thing i could think of, is to add an physical anti-Alliasing filter in front of the Chronos-Sensor. That will solve the problem about the colorfull pixels mostly but will make your result more unsharp.
.
For more Information about all this just look up information about debayering / demosaicing and Bayer-Sensors in general, should answer most of your questions.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: tesla500 on September 17, 2018, 06:47:51 PM
The issue with colored pixels that patrickrebstock is seeing is due (mostly) to a known bug in the new demosaic, see the post after this one for more info.

Nikon1 is still correct, this is an intrinsic issue with bayer pattern sensors, but it's not anywhere near as bad as the video Patrick posted makes it seem. Right now, for difficult scenes like this, the best you can do is save raw and use a very good demosaic such as Rawtherapee's Amaze algorithm, which handles these single pixels better, although our demosaic is pretty good compared to most (once the bug is worked out).

The "proper" solution requires a hardware change; an OLPF (optical low pass filter) placed in front of the image sensor, where the IR filter is. This deliberately blurs the image slightly before it hits the image sensor, smearing the sharp single pixel objects over adjacent pixels, which allows the normal demosaic interpolation to get the true color of the drops instead of the false color you're seeing. After demosaic, a digital sharpening filter undoes the blurring effect of the OLPF. I'm currently looking into having these made, they'd eventually make it into new production cameras, and also be available as a user installable upgrade for existing owners.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: Loial on September 17, 2018, 06:48:33 PM
take a look at the image issues on high contrast moving water with the new firmware, pretty funky stuff going on, can this be worked on?
https://youtu.be/ywW78_fZfL0
focus still off its biased too close

Oh, ya, sorry - I'm currently working on it. It was a problem I noticed a few weeks ago right after releasing the new demosaic update but I had no way to actually reproduce it without sunlight against water and even then it was just only barely noticeable (the above video is no longer barely noticeable and is a great representation of the issue).

Today I just found a way to recreate it in the office and am working on where the issue is within the demosaic - use a non-white light and saturate the sensor.

The new demosaic for initial testing showed better single-pixel white lite handling than most others I tested; rather proud of that. The problem shown above is a situation where some of the math within the FPGA is corrupted, probably due to a rollover of a variable used in the demosaic.

Thanks very much for the example and as soon as I have a fix we'll release an update with it.

Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: Nikon1 on September 18, 2018, 12:08:12 AM
The "proper" solution requires a hardware change; an OLPF (optical low pass filter) placed in front of the image sensor, where the IR filter is. This deliberately blurs the image slightly before it hits the image sensor, smearing the sharp single pixel objects over adjacent pixels, which allows the normal demosaic interpolation to get the true color of the drops instead of the false color you're seeing. After demosaic, a digital sharpening filter undoes the blurring effect of the OLPF. I'm currently looking into having these made, they'd eventually make it into new production cameras, and also be available as a user installable upgrade for existing owners.
Yes, that was what i wanted to say, but since im not an Native English-Speaker i dont know the exact term for it. I thought it was Called anti-Alliasing-Filter.
So sorry for the confusion here, i was referring to an Low pass filter.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: Loial on September 18, 2018, 12:29:55 AM
Good news - I was able to reproduce the issue in simulation and easily tracked down the variables that were causing issues. I've fixed them but the changes need to make their way back into the main code. We should be able to make an update that removes this artifact in the next couple days.
Title: Re: AHD demosaic beta update - Much better sharpness for in-camera h264 saving
Post by: JamesB on September 25, 2018, 07:18:58 PM
Good that a fix was found, this also applies for any bright lit metallic object with specular highlights!