AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Find TP FN TN FP of 2 images

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Find TP FN TN FP of 2 images

Postby bhenchodify » Wed Mar 29, 2017 11:54 am

How would I go about finding if a pixel is in image A and image B.
I am working with Binary Images, so Black and White pixels only
For example, if the pixel is in image A and image B, then it should increment TP, if its in image B but not image A, then it should increment FP, and if it is in image A but not image B, then the FN should increment and all of the black pixels in image A and image B should incremne TN.
The language I am using is C#

I have done some sudo code which is below;
int TP;
int FP;
int TP;
int FN;


for (i = 0; i<N-1)
{
for j = 0 < M-1
{
G = Image A // total pixel count
S = Image B //total pixel count

if g = 1 and s = 1 //if both pixels are white
{
TP = TP+1
}
else if (g = 1 and S = 0) // if image A is white and B is black
{
FN = FN + 1
}
else if (g = 0 and s = 1) // if image A is black and image B is White
{
FP = FP + 1
}
else if (global = 0 and s = 0) // if both are black
{
TN = TN + 1
}
}
}



Any help is greatly appreciated. Thanks
bhenchodify
 
Posts: 1
Joined: Sun Mar 12, 2017 6:13 pm

Re: Find TP FN TN FP of 2 images

Postby andrew.kirillov » Wed Mar 29, 2017 2:36 pm

I would have a look at the source code of some image processing routine available in the framework. For example, Thresholding. It will give an idea of how to access/process pixels.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to AForge.NET Framework

cron