ArticlePDF Available

Abstract and Figures

V. Vysniauskas. Anti-aliased Pixel and Intensity Slope Detector H Electronics and Electrical Engineering. - Kaunas: Technologija, 2009. - No. 7(95). - P. 107-110. Each image dot can be associated with some image part, for example line, area where intensity changes or area with constant intensity. Image processing use these image parts. Image transferring into the digital domain in any words image digitizing, because of finite dot (pixel) size some pixels are partly closed with light and dark area. These pixels are called anti-aliased. Frequently these pixels are unwanted or impede to extract edge or blur magnified image or ripple edge in shrink image. When it is possible to detect that pixel, different algorithm can be applied for processing and image quality can be increased. A method to detect anti-aliased pixels and pixels which intensity change continuous (slope) is presented. Ill. 7, bibl. 5 (in English; summaries in English, Russian and Lithuanian).
Content may be subject to copyright.
107
ELECTRONCS AND ELECTRICAL ENGINEERING
ISSN 1392 – 1215 2009. No. 7(95)
ELEKTRONIKA IR ELEKTROTECHNIKA
MEDICINE TECHNOLOGY
T 115 MEDICINOS TECHNOLOGIJA
Anti-aliased Pixel and Intensity Slope Detector
V. Vyšniauskas
Siauliai University,
Vilniaus str. 141, LT – 76353 Siauliai, Lithuania
Abstract
A method to detect anti-aliased pixel and pixel that
render a slope of intensity gradient is described here. Anti-
aliased pixels make lines smoothed and image looks better.
Therefore, many computer text and image rendering
applications processing text and computer created images
to do them viewable like taken with a camera.
Anti-aliased pixels are a big problem for image
magnification. Image magnification methods use neighbor
pixels to interpolate lacking pixels values. Because the
same algorithm is applied to all pixels without analyzing
what every pixel represent, this generates magnification
blur. This phenomenon decreases object’s edge sharpness
like blurring or low pass filter.
However, anti-aliased pixel can be used to estimate
line position with subpixel accuracy [1], aliasing blur can
be decreased and image magnification quality will
increase. An anti-aliased pixel looks like intensity gradient
slope and is necessary to detect what pixel is slope and
what pixel is anti-aliased. There is a fast algorithm to
magnify image [2] where different algorithms are used on
four pixel groups to estimate better region magnification
quality. This method is very quick, simple to implement
and draws a very good result in relation with well-known
interpolation algorithms.
Aliasing phenomenon occurs because objects in
real world have continues, smooth curves and straight lines
in various directions, where digital pictures have discrete
points called pixels which are arranged rectangular [3-5].
Actually, an image sensor or monitor pixel has some small
physical size, so it have finite resolution, where real world
have infinite resolution. When high or infinite resolution
object is projected to finite low-resolution discrete mesh,
like image sensor, lines and curves become jagged. As
soon as we deviate from rectangular shapes, we begin to
see some unwanted artifacts. These unwanted artifacts,
often-called stairsteps or jaggies, are a form of aliasing.
They will appear whenever we attempt to represent a shape
that deviates from a rectangle. This is because the image
sensors and screens are rectangular as the pixels. This
problem can be partly solved by increasing grey level or
color level number, but this is only the deception of the
eye, the result is still the same, some stairs become only
lower intensity. This minimizes visible distortion artifacts.
Anti-aliasing phenomenon occurs when pixel is
partially covered with light and dark area. That pixel
intensity is proportional to light and dark area ratio. Anti-
aliasing obtains naturally when picture is taken on digital
camera. Anti-aliased image looks better, curves and lines
looks smooth.
In digital signal and image processing, anti-aliasing is
the technique of minimizing the distortion artifacts known
as aliasing when representing a high-resolution signal at a
lower resolution. Anti-aliasing is used in digital
photography and computer graphics [3-5]. Text and
digitally created image rendering on digital screen like
LCD or digital projector have problem with pixel aliasing
– image is jagged. Therefore, there are many methods to
make image anti-aliased.
Theoretically, anti-aliased pixels are on the image
edges, but not every edge pixel is anti-aliased. After some
experiments with the most popular edge filters, it was
found that some edge filters shift the edge at least by one
pixel position. Other edge filters generate edge more than
one pixel thickness and that is not usable for anti-aliased
pixel detection. Moreover, the main weakness of various
edge filters is threshold, which value mostly defined
manually. Additionally, threshold value depends not only
on whole image illumination, but also on image part
illumination, for example, shadow of object has less light
than common image. To get well-formed edge on
shadowed image it is necessary to define different
threshold values in shadow zone and in light zone.
Unfortunately, automated edge detection methods are
currently unformed.
Edge and anti-aliased pixels relation cannot be
superposed. Moreover, edge detection commonly require
manual turning, which is unsuitable for image
magnification that will be automatic, without any turning
or any interposition with human.
Image anti-aliasing technique
Image anti-aliasing filter use convolution as the most
of image-processing methods use. The simplest
convolution kernel
108
010
111
010
5
1
AA
K. (1)
The C code implementation of this convolution
algorithm is very simple and shows how it works.
int smooth_mpixel(int x, int y)
{int sum;
sum = get_mpixel(source, x, y);
if (sum == 255)
{// pixel is transparent, do not filter
return sum;
}
else
{sum += get_mpixel(source,x - 1,y);
sum += get_mpixel(source,x + 1,y);
sum += get_mpixel(source,x, y - 1);
sum += get_mpixel(source,x, y + 1);
return sum / 5;
}
}
void simple_smooth(int width, int height)
{int x, y;
for(y=1; y<height-1; y++)
{for(x=1; x<width-1; x++)
{set_mpixel(target,x,y,smooth_mpixel(x,y));
}
}
}
Fig. 1. Anti-aliased filter Fig. 2. Anti-aliased image
Each anti-aliased image (Fig. 2) pixel is calculated as
mean of five pixels (Fig. 1). This routine has an
asymmetry, which can be both an advantage and a
disadvantage: diagonal edges are blurred more than
horizontal or vertical edges. To show why, the filter matrix
was put in the following figure (Fig. 1) on a horizontal
edge, a vertical edge and an edge at 45 degrees. Assume
that in this figure, a white pixel has value one (1.0) and a
gray pixel has value zero (0.0). Anti-aliasing filter blur an
image and it looks slightly like an image from a digital
camera. However, in real camera anti-aliased pixel is only
one pixel that is between light and dark area. When there is
more than one pixel, they represent a ramp of image
intensity. In this situation, there are two anti-aliased pixels,
one on the top of ramp and other on the bottom of the
ramp.
Anti-aliased and intensity slope pixel detection
Most of mathematic methods are reciprocal, and anti-
aliased pixel can be detected with inverting previous
method. Coefficients for surround pixel values are
calculated from image
A
pixels as matrix:
876
105
234
AAA
AAA
AAA
, (2)
).,()1,1(
),,()1,(
),,()1,1(
),,(),1(
),,()1,1(
),,()1,(
),,()1,1(
),,(),1(
),,(
8
7
6
5
4
3
2
1
0
yxAyxAA
yxAyxAA
yxAyxAA
yxAyxAA
yxAyxAA
yxAyxAA
yxAyxAA
yxAyxAA
yxAA
(3)
After number of tests it was found, that anti-aliased
and slope pixels has some positive and negative and no
coefficients with zero value. Zero values means that pixel
is on the top or the bottom of intensity hop or on the
straight line.
Fig. 3. Scanning anti-aliased image line
Very simple situation (Fig. 3) shows how slope and
anti-aliased pixel detector works. When pixel lies on slope
or is anti-aliased, surround coefficients have positive and
negative values and when line intensity unvarying no more
than two zero values which direction is the same as line.
109
Fig. 4. Scanning anti-aliased image curve
The same algorithm can be applied for curves (Fig. 4)
with the same results. Curve shape lines sometimes have
more than one direction. Therefore, algorithm will be
supplemented with direction evaluation function.
Fig. 5. Real image with lines, curves and noise
Fig. 6. Anti-aliased and slope map (anti-aliased – black, slope –
gray, any –white)
Real pictures (Fig. 5) have flashes, shadows, noise
and digitization artifacts, which disturb simple algorithm
and it must be enhanced. Image (Fig. 6) shows anti-aliased
(black) ant slope (gray) pixels to show how this algorithm
works. The main feature, that matrix coefficients must
have with different signs have been supplemented with
direction evaluation. Image and digitization noise can be
recognized as anti-aliased or slope pixel. Some kind of
noise as “salt and pepper” noise commonly is only one
pixel noise, and this algorithm is insensitive for that kind
of noise, because all surrounded pixels intensity are lower
for “salt” pixels or higher for “pepper” pixels, than
difference of pixel intensity always have the same sign.
Fig. 7. Anti-aliased and slope pixel detection algorithm
For each pixel is checking surrounded pixels
difference with center pixel if it has positive and negative
values and no more than two zero values. Therefore, this
pixel is at least slope pixel. Then check if the pixel is anti-
aliased. Previously, pixel numbers were obtained with
maximal and minimal values. Later try these pixels as
center and check if these pixels are on top or bottom of
brightness landscape. A top or bottom pixel has more than
two zero values in difference matrix.
Testing and results
Other method to detect anti-aliased and slope pixels
was not found, therefore this method cannot be compared
with another method. Therefore, there was only optical
method to check how it works.
For artificial images, created with drawing tools, this
method works excellent. However, with real pictures,
taken with photo camera or unknown source, accuracy is
about 65 – 95 percent. One problem that decreases
accuracy is noise that come from image sensor. Image with
good lightning draw better results when pour lighted
images have more random noise and shows worse results.
110
The other source of errors is image compression artifacts
that are visible as intensity waves near edges – these
artificial waves are recognized by detector.
After number of tests it was defined, that pixel that
was unrecognized as anti-aliased was impacted with noise,
accordingly method, as it is designed work perfect.
Conclusion
After revising, a lot of literature another method to
detect anti-aliased pixel was not found. There are many
methods to make anti-aliased image from aliased. In many
application anti-aliased image is exactly what expected,
and feature for anti-aliased pixel detection is unnecessary.
Anti-aliased and slope pixel detector works perfect as
it was designed, but for better results for image
magnification purposes it must be improved. Small kernel
3x3 guarantee high processing speed, but cannot detect
continuous lines in noisy images.
References
1. Vyšniauskas Vytautas. Subpixel Edge Reconstruction using
Aliased Pixel Brightness // Electronics and Electrical
Engineering. – Kaunas: Technologija, 2008. – No. 8(88). – P.
43–46.
2. Vyšniauskas Vytautas. Triangle Based Image
Magnification. – Electronics and Electrical Engineering. –
Kaunas: Technologija, 2006. – No. 6(70). – P. 45–48.
3. Nixon M. S., Aguado A. S. Feature Extraction and Image
Processing. – Newnes. – 2002. – P. 40–45.
4. Lagendijk R. L., Biemond J. Basic Methods for Image
Restoration and Identification. Handbook of Image And
Video Processing. – Academic Press. – 2000. – P. 125–140.
5. Muresan D. D., Parks T. W. Demosaicing using Optimal
Recovery Image Processing // IEEE Transactions. – 2005. –
Vol. 14. – P. 267–278.
Received 2009 02 15
V. Vyšniauskas. Anti-aliased Pixel and Intensity Slope Detector // Electronics and Electrical Engineering. – Kaunas:
Technologija, 2009. – No. 7(95). – P. 107–110.
Each image dot can be associated with some image part, for example line, area where intensity changes or area with constant
intensity. Image processing use these image parts. Image transferring into the digital domain in any words image digitizing, because of
finite dot (pixel) size some pixels are partly closed with light and dark area. These pixels are called anti-aliased. Frequently these pixels
are unwanted or impede to extract edge or blur magnified image or ripple edge in shrink image. When it is possible to detect that pixel,
different algorithm can be applied for processing and image quality can be increased. A method to detect anti-aliased pixels and pixels
which intensity change continuous (slope) is presented. Ill. 7,bibl. 5 (in English; summaries in English, Russian and Lithuanian).
В. Вишняускас.Детектор пересечённых точек и точек на склоне яркости // Электроника и электротехника. Каунас:
Технология, 2009. – 7(95). – P. 107–110.
Каждая точка изображения может быть отнесена к какому нибуть объекту в нем, например,к линии, к зоне с
изменяющейся яркостью, или к зоне с постоянной яркостью. Эти части изображения используются при обработке. При
переводе изображения в дискретное пространство, или оцифровке из-за конечной величины точки появляются такие точки,
которые частично накрывают светлую и тёмную части изображения. Такие точки называются пересечёнными. Чаще всего они
мешают выделить контур, способствуют размыванию контуров при увеличении, или делают рябь на контурах при
уменьшении. Если определить такие точки, то к ним можно применить другой метод обработки и тем самым улучшить
качество изображения.Представлен метод обнаружения пересечённых точек и точек на склоне яркости. Ил. 7, библ. 5 (на
английском языке; рефераты на английском,русском и литовском яз.).
V. Vyšniauskas. Susiliejančiųir ryškumo šlaito taškųnustatymas // Elektronika ir elektrotechnika. – Kaunas: Technologija,
2009. – Nr. 7(95). – P. 107–110.
Kiekvienąvaizdo taškągalima priskirti kuriai nors vaizdo daliai, pavyzdžiui, linijai, ryškumo pokyčio sričiai ar sričiai, kurios
ryškumas nesikeičia. Šios vaizdo dalys naudojamos apdorojant vaizdus. Perkeliant vaizdus įdiskretinęerdvęarba, kitaip sakant, juos
skaitmeninant, dėl baigtinio taško dydžio atsiranda taškų, kuriuos išdalies uždengia šviesi ir tamsi vaizdo sritys. Tokie taškai vadinami
susiliejančiais. Dažnai, apdorojant vaizdus, jie ne tik nereikalingi, bet ir trukdo, pavyzdžiui, jie trukdo išskirti kontūrus arba kontūras
išskysta didinant vaizdąbei raibuliuoja jįmažinant. Nustačius tokius taškus ir apdorojant vaizdąpagal kitokius algoritmus, galima labai
pagerinti apdoroto vaizdo kokybę. Pateikiamas metodas, kuris leidžia aptikti susiliejančius taškus ir taškus, kuriuose kinta vaizdo
ryškumo intensyvumas. Il. 7, bibl. 5 (anglųkalba; santraukos anglų, rusųir lietuviųk.).
... Assuming manually edited data as ground truth, it is possible to measure total pixel match-mismatch ratio. When compared with a pixel matching software that implements pixel and intensity slope detector (Vysniauskas, 2009), 706 of 1367 predicted images are exactly matched with the ground truth. 535 of remaining 661 image has small (<2%) differences with the ground truth data. ...
Conference Paper
Full-text available
A Digital Terrain Model (DTM) is a representation of the bare-earth with elevations at regularly spaced intervals. This data is captured via aerial imagery or airborne laser scanning. Prior to use, all the above-ground natural (trees, bushes, etc.) and man-made (houses, cars, etc.) structures needed to be identified and removed so that surface of the earth can be interpolated from the remaining points. Elevation data that includes above-ground objects is called as Digital Surface Model (DSM). DTM is mostly generated by cleaning the objects from DSM with the help of a human operator. Automating this workflow is an opportunity for reducing manual work and it is aimed to solve this problem by using conditional adversarial networks. In theory, having enough raw and cleaned (DSM & DTM) data pairs will be a good input for a machine learning system that translates this raw (DSM) data to cleaned one (DTM). Recent progress in topics like 'Image-to-Image Translation with Conditional Adversarial Networks' makes a solution possible for this problem. In this study, a specific conditional adversarial network implementation "pix2pix" is adapted to this domain. Data for "elevations at regularly spaced intervals" is similar to an image data, both can be represented as two dimensional arrays (or in other words matrices). Every elevation point map to an exact image pixel and even with a 1-millimeter precision in z-axis, any real-world elevation value can be safely stored in a data cell that holds 24-bit RGB pixel data. This makes total pixel count of image equals to total count of elevation points in elevation data. Thus, elevation data for large areas results in sub-optimal input for "pix2pix" and requires a tiling. Consequently, the challenge becomes "finding most appropriate image representation of elevation data to feed into pix2pix" training cycle. This involves iterating over "elevation-to-pixel-value-mapping functions" and dividing elevation data into sub regions for better performing images in pix2pix.
Article
Full-text available
One of the most common image features used in machine vision are edges, and there is a substantial body of research oil various techniques for performing edge detection. Edges are useful in many applications as image comparing, recognition and other. Here is presented edge detection method with subpixel accuracy. Method is based on decision that different intensity and size areas influence pixel brightness with some relation function. Hear presented functions to calculate one dot of edge going through the pixel. Test results show that with 0.01 standard deviation is estimated 47% of dots, with 0.05 standard deviation is estimated 88% of dots and 94% with 0.06 standard deviation. Also it is defined, that linearity decrease is more than 5% when edge Cut triangle which area is less then 10% of pixel area. III. 7, bibl. 6 (in English; summaries in English, Russian and Lithuanian).
Article
Color images in single-chip digital cameras are obtained by interpolating mosaiced color samples. These samples are encoded in a single-chip charge-coupled device by sampling the light after it passes through a color filter array (CFA) that contains different color filters (i.e., red, green, and blue) placed in some pattern. The resulting sparsely sampled images of the three-color planes are interpolated to obtain the complete color image. Interpolation usually introduces color artifacts due to the phase-shifted, aliased signals introduced by the sparse sampling of the CFAs. This paper introduces a nonlinear interpolation scheme based on edge information that produces high-quality visual results. The new method is especially good at reconstructing the image around edges, a place where the visual human system is most sensitive.
Triangle Based Image Magnification.-Electronics and Electrical Engineering
  • Vyšniauskas Vytautas
Vyšniauskas Vytautas. Triangle Based Image Magnification.-Electronics and Electrical Engineering.Kaunas: Technologija, 2006.-No. 6(70).-P. 45-48.