Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Is it possible to compute the blue channel?

Is it possible to compute the blue channel?

Scheduled Pinned Locked Moved Graphics
questiongraphicstutoriallounge
9 Posts 3 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sonhospa
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • S Sonhospa

      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

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      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.

      image processing toolkits | batch image processing

      S 1 Reply Last reply
      0
      • C Chris Losinger

        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.

        image processing toolkits | batch image processing

        S Offline
        S Offline
        Sonhospa
        wrote on last edited by
        #3

        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?

        C 1 Reply Last reply
        0
        • S Sonhospa

          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?

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          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.. :)

          image processing toolkits | batch image processing

          S 1 Reply Last reply
          0
          • C Chris Losinger

            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.. :)

            image processing toolkits | batch image processing

            S Offline
            S Offline
            Sonhospa
            wrote on last edited by
            #5

            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?

            T C 2 Replies Last reply
            0
            • S Sonhospa

              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?

              T Offline
              T Offline
              Tim Craig
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • S Sonhospa

                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?

                C Offline
                C Offline
                Chris Losinger
                wrote on last edited by
                #7

                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.

                image processing toolkits | batch image processing

                S 1 Reply Last reply
                0
                • C Chris Losinger

                  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.

                  image processing toolkits | batch image processing

                  S Offline
                  S Offline
                  Sonhospa
                  wrote on last edited by
                  #8

                  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

                  C 1 Reply Last reply
                  0
                  • S Sonhospa

                    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

                    C Offline
                    C Offline
                    Chris Losinger
                    wrote on last edited by
                    #9

                    here's a quick thread on histogram stretching: http://stackoverflow.com/questions/1295057/i-need-to-do-a-histogram-stretch[^]

                    image processing toolkits | batch image processing

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups