Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I'm trying to auto scale an image by using the histogram of the image and scaling so that a user defined percentage (e.g. 98%) is contained within the scale limits.
Maybe my attempt isn't the best way, and it doesn't work if I want to include 98% of all the data.
Thanks for any help.
Jason
Solved! Go to Solution.
You have a couple of problems.
First, mn and mx are defined incorrectly.
Second, you have one equation and two unknowns. There are an infinite number of possible values of a and b that would include a given percentage of the data. You need to decide how to split the excluded percentage between the top and bottom of the range (the most obvious being half each), and solve for a and b based on those excluded percentages.
The lower guess value needs to be changed too.
You have a couple of problems.
First, mn and mx are defined incorrectly.
Second, you have one equation and two unknowns. There are an infinite number of possible values of a and b that would include a given percentage of the data. You need to decide how to split the excluded percentage between the top and bottom of the range (the most obvious being half each), and solve for a and b based on those excluded percentages.
The lower guess value needs to be changed too.
thanks Richard - very neat!
Jason
hope you can get what you want in scaling images . you can try other way, say with an image app to help you.
Hi, zhang.
Thanks for your nice sharing. I am also testing about the related image scaling projects offered by another imaging SDK. So far so good. And I will try your sharing later. We can communicate about it after that.
Best regards,
Arron