setting min, max from histogram

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

setting min, max from histogram

donny008
hello

i would like to set the min and max values for brightness of an image by
making some calculations from the values like mean and standard deviation
obtained from the histogram of the image. i wrote the macro in this way

run("Brightness/Contrast...");
    getStatistics(mean, min, max, std, histogram);

    setMinAndMax(mean*0.6666,201);

and this not work. could somehow help me to successfully modify this.

thank you one and all for the help in advance

regards

--
Donny George
Reply | Threaded
Open this post in threaded view
|

Re: setting min, max from histogram

Gluender-2
>hello
>
>i would like to set the min and max values for brightness of an image by
>making some calculations from the values like mean and standard deviation
>obtained from the histogram of the image. i wrote the macro in this way
>
>run("Brightness/Contrast...");
>     getStatistics(mean, min, max, std, histogram);
>
>     setMinAndMax(mean*0.6666,201);
>
>and this not work. could somehow help me to successfully modify this.
>
>thank you one and all for the help in advance
>
>regards
>
>--
>Donny George


I've replied to your question immediately after your first post to the list.

------------------------

Here is my reply again:

The macro functions manual says:
getStatistics(area, mean, min, max, std, histogram)

so

getStatistics(area, mean);
print(mean);

should do the trick.

HTH
--

                   Herbie

          ------------------------
          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: setting min, max from histogram

donny008
In reply to this post by donny008
On Thu, Apr 16, 2009 at 11:27 AM, Gluender <[hidden email]> wrote:

> hello
>>
>> i would like to set the min and max values for brightness of an image by
>> making some calculations from the values like mean and standard deviation
>> obtained from the histogram of the image. i wrote the macro in this way
>>
>> run("Brightness/Contrast...");
>>    getStatistics(mean, min, max, std, histogram);
>>
>>    setMinAndMax(mean*0.6666,201);
>>
>> and this not work. could somehow help me to successfully modify this.
>>
>> thank you one and all for the help in advance
>>
>> regards
>>
>> --
>> Donny George
>>
>
>
> I've replied to your question immediately after your first post to the
> list.
>
> ------------------------
>
> Here is my reply again:
>
> The macro functions manual says:
> getStatistics(area, mean, min, max, std, histogram)
>
> so
>
> getStatistics(area, mean);
> print(mean);
>
> should do the trick.
>
> HTH
> --
>
>                  Herbie
>
>         ------------------------
>         <http://www.gluender.de>
>


thankyou and sorry i didnt see ur post earlier

i modified it and i could print the values correctly but i am not able to
make a calculation with it so that i can modify the brightness

run("Brightness/Contrast...");
    getStatistics(mean, min, max, std, histogram);
    print(""+mean+", "+min+", "+max+", "+std+"");
    setMinAndMax("+mean+"*0.6666,201);

could you help me with the syntax for the mulplication

thnkyou again

Donny George
Reply | Threaded
Open this post in threaded view
|

Re: setting min, max from histogram

Gluender-2
>On Thu, Apr 16, 2009 at 11:27 AM, Gluender <[hidden email]> wrote:
>
>>  hello
>>>
>>>  i would like to set the min and max values for brightness of an image by
>>>  making some calculations from the values like mean and standard deviation
>>>  obtained from the histogram of the image. i wrote the macro in this way
>>>
>>>  run("Brightness/Contrast...");
>>>     getStatistics(mean, min, max, std, histogram);
>>>
>>>     setMinAndMax(mean*0.6666,201);
>>>
>>>  and this not work. could somehow help me to successfully modify this.
>>>
>>>  thank you one and all for the help in advance
>>>
>>>  regards
>>>
>>>  --
>>>  Donny George
>>>
>>
>>
>>  I've replied to your question immediately after your first post to the
>>  list.
>>
>>  ------------------------
>>
>>  Here is my reply again:
>>
>>  The macro functions manual says:
>>  getStatistics(area, mean, min, max, std, histogram)
>>
>>  so
>>
>>  getStatistics(area, mean);
>>  print(mean);
>>
>>  should do the trick.
>>
>>  HTH
>>  --
>>
>>                   Herbie
>>
>>          ------------------------
>>          <http://www.gluender.de>
>>
>
>
>thankyou and sorry i didnt see ur post earlier
>
>i modified it and i could print the values correctly but i am not able to
>make a calculation with it so that i can modify the brightness
>
>run("Brightness/Contrast...");
>     getStatistics(mean, min, max, std, histogram);
>     print(""+mean+", "+min+", "+max+", "+std+"");
>     setMinAndMax("+mean+"*0.6666,201);
>
>could you help me with the syntax for the mulplication
>
>thnkyou again
>
>Donny George

Your "print" statement definitely wont work correctly.
Why did you modify my suggestion to make it work no longer?

--

                   Herbie

          ------------------------
          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: setting min, max from histogram

Gabriel Landini
In reply to this post by donny008
This was pointed out to you already by Gluender:
> run("Brightness/Contrast...");
>     getStatistics(mean, min, max, std, histogram);

You got it wrong there, you need:

getStatistics(pixels, mean, min, max, std, histogram);

The first value needs to be *pixels*, not mean. They way you wrote it, you
were returning the number of pixels into the mean variable.

>     setMinAndMax("+mean+"*0.6666,201);

And that  is wrong again:
You need
 setMinAndMax(mean*0.6666, 201);

No quotations and no "+".

G.