Method to analyze pixels

Discussions about image processing and document imaging.
Post Reply
BenV
Posts: 21
Joined: Thu Dec 02, 2010 4:54 pm

Method to analyze pixels

Post by BenV » Tue Jan 04, 2011 6:09 pm

Hey there

Is there a way to count the number of black pixels in an area? For example: In a 400 X 300 B/W image, I would like to count the number of black pixels in an area that's 15 by 15 pixels and in the bottom right corner. Is this possible? I have been looking in the Pixel Access methods but found nothing. I did try the GetPixelIntegerArray() or something like that but I can't figure out the values it puts in the array.

Elodie
Posts: 38
Joined: Fri Sep 03, 2010 10:50 am

Re: Method to analyze pixels

Post by Elodie » Tue Jan 04, 2011 7:56 pm

Hi Ben,

You can easiliy do that using the CountColor method.

Just set the region of interest using the SetROI method, then call CountColor() method which will returns the number if pixel with the specified color.

See: https://www.gdpicture.com/guides/gdpicture/v7/html/con ... Color.html

Kind regards.

BenV
Posts: 21
Joined: Thu Dec 02, 2010 4:54 pm

Re: Method to analyze pixels

Post by BenV » Wed Jan 05, 2011 9:18 am

Oke, thanks. Totally overlooked that method.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests