[Image-SIG] Example Code for Displaying Pictures--I'm Stumped
Wayne Watson
sierra_mtnview at sbcglobal.net
Wed Nov 25 17:21:50 CET 2009
David, I have many video files, but only want to process them one at a
time. The format is unique, but simple. Basically, 640x480 b/w bmp
images one right after the other. The program should read one image,
then allow the user to produce a histogram of the image displayed. Now
he moves to the next one of interest, and does the same. I started down
this path some months ago, but got side tracked. I did make some
progress, so I think I'll review that, and just see if I can finish it
off. I would think it really isn't a complicated program. In fact, I
would think such a common need, without the histograms, that it should
be available as a possible example of how to read simple video files.
I'll stick to Win Python. I've used C and Linux before, but don't see a
need to go back to it here.
David Kirtley wrote:
> Well, I really had intended it to be a guide and unless you have the
> gnuplot python stuff also, it would not run directly.
>
> What exactly are you trying to do? From what I understood, you have a
> bunch of image files and want to do histograms for each of them.
> (Unless you are trying to do them from video which is problematic. I
> personally saved the video I was working as a set of individual image
> files. Getting them from a video stream is a lot harder and has many
> difficulties- many man-made because of licensing and patents on video
> compression. I have not done it directly and would not want to mess
> with it. It is really nasty.)
>
> Also, that code is pretty old (I think 2.2 or maybe even older Python)
> the new glob stuff
> files = glob.glob(os.path.join('','*.out'))
> will make it easy to get a list of the files in the directory.
>
> So the basic strategy would be :
>
> Get the list of files to process with the glob -- Who chooses these names? ;)
>
> (Not perfect code, just rough idea.....)
>
> for file in file_list:
> image = Image.open(file)
> histogram = Image.chops.histogram -- don't remember where the
> histogram stuff is off the top of my head
> make the comparison
> save the results
>
>
>
> If you are going to be doing some in depth analysis of the data, you
> prob will want to use Numpy and deal with them as arrays.
>
> On Wed, Nov 25, 2009 at 9:44 AM, Wayne Watson
> <sierra_mtnview at sbcglobal.net> wrote:
>
>> I thought I'd try executing your code under Win Python, but it objected to
>> indentation, tabs. I tried substituting 4 blanks for them, but that didn't
>> work out. Suggestions?
>>
>> David Kirtley wrote:
>>
>>> http://www.cs.panam.edu/~dkirtley/video/
>>>
>>> Should not need too much modification for what you want to do.
>>>
>>> David Kirtley
>>>
>>> On Tue, Nov 24, 2009 at 7:59 PM, Wayne Watson
>>> <sierra_mtnview at sbcglobal.net> wrote:
>>>
>>>
>>>> A few hours ago someone posted some sample Python code somewhere in
>>>> several
>>>> of the python lists pictures. I looked at it and thought that looks
>>>> pretty
>>>> interesting. Now I can't find it. Does anyone know of that post? Typical
>>>> I
>>>> use Image-SIG, Pmw-Toolkit Python Tutor, Tkinter, VisPython lists but I
>>>> don't see it.
>>>>
>>>> My interest is that I would like to step through a video file of b/w
>>>> images,
>>>> 640x480, and stop along the way to make histograms to determine noise
>>>> characteristics of the camera that took the video.
>>>>
>>>> --
>>>> Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
>>>>
>>>> (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
>>>> Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
>>>> 350 350 350 350 350 350 350 350 350 350
>>>> Make the number famous. See 350.org
>>>> The major event has passed, but keep the number alive.
>>>>
>>>> Web Page: <www.speckledwithstars.net/>
>>>>
>>>> _______________________________________________
>>>> Image-SIG maillist - Image-SIG at python.org
>>>> http://mail.python.org/mailman/listinfo/image-sig
>>>>
>>>>
>>>>
>>>
>> --
>> Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
>>
>> (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
>> Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
>> 350 350 350 350 350 350 350 350 350 350
>> Make the number famous. See 350.org
>> The major event has passed, but keep the number alive.
>>
>> Web Page: <www.speckledwithstars.net/>
>>
>> _______________________________________________
>> Image-SIG maillist - Image-SIG at python.org
>> http://mail.python.org/mailman/listinfo/image-sig
>>
>>
>
>
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
350 350 350 350 350 350 350 350 350 350
Make the number famous. See 350.org
The major event has passed, but keep the number alive.
Web Page: <www.speckledwithstars.net/>
More information about the Image-SIG
mailing list