Jump to content

Histogram and Average color


Toady
 Share

Recommended Posts

Posted Image

Posted Image

This application uses the two UDF's I made for a class of mine. One to calculate a histogram array

from a screen region and the other to calculate an average color of a screen region.

NOTE: This program is just an example of how to use the two UDF's.

Two UDF's are _Get2DHistogram() and _GetAverageColor()

histogram.au3

Edited by Toady

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

Of course you dont... only people who deal with this stuff would use it.

I guess. Only thing I've ever seen a histogram in is in photoshop (which I use frequently) and other image editing programs. And AutoIt is the worst possible language for making those (except maybe batch) so I don't know how someone would use these within the bounds of autoit. I would be much obliged however if you could elighten me seeing as you are obviously extremly advanced in the subject.

[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Link to comment
Share on other sites

I guess. Only thing I've ever seen a histogram in is in photoshop (which I use frequently) and other image editing programs. And AutoIt is the worst possible language for making those (except maybe batch) so I don't know how someone would use these within the bounds of autoit. I would be much obliged however if you could elighten me seeing as you are obviously extremly advanced in the subject.

One of my projects in a class I'm taking called Experimental Design required me to program these, so I chose AutoIT to do it because of its simplicity. I was nice enough to give everyone these UDFs along with an example program. Im sure someone with enough interest and an imagination will find these UDF's useful.

Edited by Toady

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

I haven't tried using yours just yet, but I was just starting to write something like this, so you've saved me some trouble.

I have an electron microscope which displays a preview window of the sample on screen, and you adjust contrast/brightness/etc. using analog controls on the instrument. Then you do a slow scan image capture (30 to 60 seconds) for higher quality images and pull the image into Photoshop and adjust the levels.

This will allow me to use the analog controls to produce an image which has the best use of the available gamut, so I do not have to stretch the levels so much in Photoshop.

Thanks.

P.S. I may just write my own for fun anyway, but this lets me get something that at least works much quicker.

Link to comment
Share on other sites

I haven't tried using yours just yet, but I was just starting to write something like this, so you've saved me some trouble.

I have an electron microscope which displays a preview window of the sample on screen, and you adjust contrast/brightness/etc. using analog controls on the instrument. Then you do a slow scan image capture (30 to 60 seconds) for higher quality images and pull the image into Photoshop and adjust the levels.

This will allow me to use the analog controls to produce an image which has the best use of the available gamut, so I do not have to stretch the levels so much in Photoshop.

Thanks.

P.S. I may just write my own for fun anyway, but this lets me get something that at least works much quicker.

Wow, that sounds pretty cool. The udf's will work fine in your case then.

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

error :

C:\Dokumente und Einstellungen\AndiT\Desktop\Neu AutoIt v3 Script (4).au3 (101) : ==> Subscript used with non-Array variable.: 
Global $histos = "Average color = " & "0x" & $avg_color & @CRLF & @CRLF & "Total Pixels: " & $histo[0] & @CRLF 
Global $histos = "Average color = " & "0x" & $avg_color & @CRLF & @CRLF & "Total Pixels: " & $histo^ ERROR
My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity
Link to comment
Share on other sites

error :

C:\Dokumente und Einstellungen\AndiT\Desktop\Neu AutoIt v3 Script (4).au3 (101) : ==> Subscript used with non-Array variable.: 
Global $histos = "Average color = " & "0x" & $avg_color & @CRLF & @CRLF & "Total Pixels: " & $histo[0] & @CRLF 
Global $histos = "Average color = " & "0x" & $avg_color & @CRLF & @CRLF & "Total Pixels: " & $histo^ ERROR
Yes, read the directions... You must click the top left of the region then click the bottom right of the region.

Do not do it the other way around or it will crash like this.

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...