# Calc Grain of Image? (Difference between two Pictures)

Hi There,

I am now working nearly 1 Months with the iOS Library of OpenCV and I got to a point where I need your help!

Here are two Examples of the Images I am currently scanning with the Camera of the iPhone. This is the Image that should be nearly 0% Percent, Maybe somewhere 10%. This Image should be somewhere near 100% Percent.

Problem: I now have to calculate a value to get a difference between the two of them. I tried working over threshold and mean but the Problem is the Camera of the iPhone. The values/colors are somehow different each time I try to make a scanning try.

Because the solution has to be somewhere legit, there can not be a way different result each time I scan the circle.

Question: So I thought i would be perfect to somehow calculate the grain of the image? Because the Image of nearly 100% is way more granulated than 0%. And so the Color of the Image would not be that important. Or is this the wrong way?

Hope you can help me! :) Thanks!

EDIT: 50% Image edit retag close merge delete

Difference between what? How do you define the 'grain' of an image? Percentage of what? Are you using some kind of texture descriptors? Or is your question about choosing such texture descriptors?

I nearly completly new to OpenCV. I never used it before, this one Project. So My Question is how to find a Value for those two Images. In Reality i Know the Picture Above is really low (near 0% - Completly Black would be 0%) and the Picture Down is a High Value near 100%. So my Question is, how can i find a Calculation to Scan such Objects and Get a Values from 0 to 100%. I already made it to scan those Circles. Now i am working on the Calculation, Because I need an Output for the User and therefore a Value between 0 and 100% would be good. Is this explaniation helpful?

I added a 50% Version also as Image in the Post above.

1

This is a texture problem. There are many texture descriptors that could be used here. It really depends on what the percentage should represent and what you want to do with it later. Maybe the simple approach of calculating the contrast of the image or the variance of the pixel values or the gradient strengths could work.

Sort by » oldest newest most voted

Thanks. That are exactly the things i need! I will give it a try.

more

Official site

GitHub

Wiki

Documentation