Is it possible to compute the blue channel?
-
Hi everybody, I'm here in the graphics corner coz it's much more of a general graphics question which starts like "Is it possible...?" or "Does the approach make sense"? We're restoring an ancient movie, which has severe damage on the blue layer over a huge number of frames. One of the ideas for restoration is to safe a non-damaged frame/image from every scene as reference, erase the blue layer from all the frames and compute it newly for the damaged frames, based on the reference image from the same scene. Seems to make sense, but how to implement such a task in a VB program? How would I extract the blue histogram from the reference image and implant it into the other frames in VB? Any advice and/or better idea is very welcome! Thank you in advance Michael
-
Hi everybody, I'm here in the graphics corner coz it's much more of a general graphics question which starts like "Is it possible...?" or "Does the approach make sense"? We're restoring an ancient movie, which has severe damage on the blue layer over a huge number of frames. One of the ideas for restoration is to safe a non-damaged frame/image from every scene as reference, erase the blue layer from all the frames and compute it newly for the damaged frames, based on the reference image from the same scene. Seems to make sense, but how to implement such a task in a VB program? How would I extract the blue histogram from the reference image and implant it into the other frames in VB? Any advice and/or better idea is very welcome! Thank you in advance Michael
Michael Schäuble wrote:
Seems to make sense, but how to implement such a task in a VB program?
it's hard to answer that without knowing how you are storing your image data. the format you use to hold the image data will determine what you have to do to get at the blue channel.
-
Michael Schäuble wrote:
Seems to make sense, but how to implement such a task in a VB program?
it's hard to answer that without knowing how you are storing your image data. the format you use to hold the image data will determine what you have to do to get at the blue channel.
Hi Chris, thanks for your time. The files are in 10-bit DPX format (linear RGB), which is basically an uncompressed bitmap format and unsupported from GDI+. By now I read it into a RGB Array and throw 2 bits in order to have it displayed, so I have a System.Drawing.Image object I can access and e.g. put it into a picture box. Is that the additional information you needed or did I misunderstand you?
-
Hi Chris, thanks for your time. The files are in 10-bit DPX format (linear RGB), which is basically an uncompressed bitmap format and unsupported from GDI+. By now I read it into a RGB Array and throw 2 bits in order to have it displayed, so I have a System.Drawing.Image object I can access and e.g. put it into a picture box. Is that the additional information you needed or did I misunderstand you?
if you have the RGB array, you should be able to simply copy the B data out of it, right? maybe i'm misunderstanding now.. :)
-
if you have the RGB array, you should be able to simply copy the B data out of it, right? maybe i'm misunderstanding now.. :)
Maybe I didn't make it clear enough... I don't want to extract the blue channel. What I want is to 1. detect some kind of 'blue level' in a reference picture (only one, non-damaged frame) 2. transfer it to a complete series of other frames/images (the whole scene), from which the (damaged) blue channel had been erased before. Like when you re-adjust the color levels in a histogram in order to get natural colors - but automatically, using a reference instead of user interaction. Is that clearer?
-
Maybe I didn't make it clear enough... I don't want to extract the blue channel. What I want is to 1. detect some kind of 'blue level' in a reference picture (only one, non-damaged frame) 2. transfer it to a complete series of other frames/images (the whole scene), from which the (damaged) blue channel had been erased before. Like when you re-adjust the color levels in a histogram in order to get natural colors - but automatically, using a reference instead of user interaction. Is that clearer?
Even if you have the blue data from an undamaged frame, how are you going to decide which pixels in the damaged frames to apply it to? The pixels will move around as the scene progresses. (I'm assuming the blue data in the damaged frames is total garbage) If you could partition each frame into regions and match the regions between frames, you might apply the blue by region and maybe adjust it based on correlation with the red and green channels with some hand adjustment if needed and that "if" is more like "probably". Have you researched how they apply the colors to old black and white movies? I know in the early days they did that by identifying regions and hand selecting colors which were then automatically propagated forward with hand touchups. Hopefully, that has progressed since the last time I read anything about it.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
-
Maybe I didn't make it clear enough... I don't want to extract the blue channel. What I want is to 1. detect some kind of 'blue level' in a reference picture (only one, non-damaged frame) 2. transfer it to a complete series of other frames/images (the whole scene), from which the (damaged) blue channel had been erased before. Like when you re-adjust the color levels in a histogram in order to get natural colors - but automatically, using a reference instead of user interaction. Is that clearer?
what if you simply copy the blue channel from an undamaged frame to the next N frames? it won't match perfectly, but it might be better than nothing. otherwise, yes, you could generate a histogram from the blue channel of an undamaged frame, then try to force the blue channel in subsequent frames into a similar distribution (find black % and white % from the good frame and then stretch the bad frames to match those %s). that would be pretty simple.
-
what if you simply copy the blue channel from an undamaged frame to the next N frames? it won't match perfectly, but it might be better than nothing. otherwise, yes, you could generate a histogram from the blue channel of an undamaged frame, then try to force the blue channel in subsequent frames into a similar distribution (find black % and white % from the good frame and then stretch the bad frames to match those %s). that would be pretty simple.
Chris, this sounds exactly what I imagined ...! And 'that would be pretty simple' sounds extremely teasing :laugh:. The blue channel isn't completely damaged, it's more or less stained in the blue resulting from fungus that affected irregular regions on the upper/outside layer of some frames. Playing the movie, it looks a bit like ghosts swirling around. Since there seems to be a way on the basic ideas path, I'll try to find some code samples when I have some extra time again. Or do you even have a link or snippet available that leads in the right direction? Thanks for now, and have a nice day Mick
-
Chris, this sounds exactly what I imagined ...! And 'that would be pretty simple' sounds extremely teasing :laugh:. The blue channel isn't completely damaged, it's more or less stained in the blue resulting from fungus that affected irregular regions on the upper/outside layer of some frames. Playing the movie, it looks a bit like ghosts swirling around. Since there seems to be a way on the basic ideas path, I'll try to find some code samples when I have some extra time again. Or do you even have a link or snippet available that leads in the right direction? Thanks for now, and have a nice day Mick
here's a quick thread on histogram stretching: http://stackoverflow.com/questions/1295057/i-need-to-do-a-histogram-stretch[^]