קובץ:Detection cercle image fortement bruitee.png

תוכן הדף אינו נתמך בשפות אחרות.
מתוך ויקיפדיה, האנציקלופדיה החופשית

Detection_cercle_image_fortement_bruitee.png(366 × 365 פיקסלים, גודל הקובץ: 24 ק"ב, סוג MIME‏: image/png)

ויקישיתוף זהו קובץ שמקורו במיזם ויקישיתוף. תיאורו בדף תיאור הקובץ המקורי (בעברית) מוצג למטה.

תקציר

תיאור
English: Detection of a circle in a very noisy picture.

The picture is a fuzzy circle: the intensity is a gaussian function of the difference between the distance to the center C(2;2) and the radius r = 2 of the nominal circle. A random background is added. The intensity ranges from 6 to 172, for a 256-level grey scale.

The points that exceed a given intensity (threshold = 140) are extracted and represented as green crosses. The circle fitting is performed on these points. We use the Kåsa and Coope linear method (method of the algebraic distance).
Français : Détection d'un cercle dans une image très bruitée.

L'image est un cercle flou : l'intensité est une fonction gaussienne de la différence entre la distance au centre C(2 ; 2) et le rayon r = 2 du cercle nominal. Nous ajoutons un fond bruité. L'intensité va de 6 à 172, pour une échelle de gris à 256 niveaux.

Nous extrayons les points qui dépassent une intensité donnée (seuil = 140) ; ils sont représentés par des croix vertes. Nous effectuons une régression circulaire sur ces points. Nous utilisons la méthode linéaire de Kåsa et Coope (méthode de la distance algébrique).
תאריך יצירה
מקור נוצר על־ידי מעלה היצירה
יוצר Cdang

Scilab source

English: English version by default.
Français : Version française, si les préférences de votre compte sont réglées (voir Special:Preferences).

Program that creates the picture. This program generates three files:

  • X_noisy_circle.txt : xscale ;
  • Y_noisy_circle.txt : y scale ;
  • image_noisy_circle.txt : list of the intensities.

It is possible to adjust:

  • the fuzziness of the circle: sigmafuz variable;
  • the background noise: varbkg variable;
  • the signal/noise ration (contrast): intensity and meanbkg variables.
// **********
// Initialisation
// **********

clear;
clf;
chdir('mypath/');

// **********
// Constants
// **********

// image
xmin = -1;
xmax = 5;
ymin = -1;
ymax = 5;
step = 0.1;

// circle
circcenter = [2;2]; // center of the circle
radius = 2; // radius of the circle
sigmafuz = 1; // variance of the gaussian blur (width)
intensity = 128; // 256 levels of grey (1-256)

// background, 256 levels of grey (1-256)
varbkg = 20; // variance of the background noise
meanbkg = 64; // mean of the background

// **********
// Functions
// **********

function [y] = gauss(x, expectation, std_dev)
    y = 1/(std_dev*sqrt(2*%pi))*exp(-((x - expectation)/std_dev)^2/2);
endfunction

// **********
// Main program
// **********

// coordinates
X = (xmin:step:xmax)';
Y = (ymin:step:ymax)';
sizeX = size(X, '*');
sizeY = size(Y, '*');

// picture background
base = ones(sizeX, sizeY);
background = meanbkg*base + varbkg*rand(base, 'normal')

// circle drawing
circle = zeros(base);
for i = 1:sizeX
    for j = 1:sizeY
        dist_center = sqrt((X(i)-circcenter(1))^2 + (Y(j)-circcenter(2))^2);
        circle(i,j) = intensity*gauss(dist_center, radius, sigmafuz);
    end
end

// total image
image = floor(circle + background);

// display
isoview(xmin, xmax, ymin, ymax)
cmap = graycolormap(256);
xset('colormap', cmap);
grayplot(X, Y, image);

// saving
write('X_noisy_circle.txt', X, '(F4.1)');
write('Y_noisy_circle.txt', Y, '(F4.1)');
write('image_noisy_circle.txt', image, '(I3)');

Program that processes the data.

You can adjust:

  • the detection threshold: threshold variable.
// **********
// Initialisation
// **********

clear;
clf;
chdir('mypath/')

// **********
// Constants
// **********

threshold = 140; // threshold of detection on 256 levels of grey

// **********
// functions
// **********

// Recomposition of the picture matrix
function [matrixpic] = picture_matrix(sizeX, sizeY, vector)
    // sizeX, sizeY : dimensions of the picture, in nb of pts (integers)
    // vector : list of intensities (sizeX*sizeY)
    // matrice : intensities in a sizeX x sizeY matrix
    for i = 1:sizeX
        for j = 1:sizeY
            matrixpic(i,j) = vector((i - 1)*sizeX + j);
        end
    end
endfunction

// Threshold detection
function [X, Y] = detection(Xpicture, Ypicture, intensite, threshold)
    // Xpicture, Ypicture : scales (vectors)
    // intensité : grey levels (matrix)
    // threshold : detection threshold (scalar)
    // X, Y : coordinnates of the points which intensity is above the threshold
    // (vectors)
    sizeX = size(Xpicture,'*');
    sizeY = size(Ypicture,'*');
    k = 1;
    for i = 1:sizeX
        for j = 1:sizeY
            if (intensite(i,j) > = threshold) then
                X(1,k) = Xpicture(i);
                Y(1,k) = Ypicture(j);
                k = k+1;
            end
        end
    end
endfunction

// initial variable substitution

function [d] = varsubst(A)
    // A : m*n matrix
    // n : nb of points ; m : dimension of the space (2 in a plane)
    // each column has the coordinates of the experimental points
    // d : n*1 matrix
    [m, n] = size(A);
    for i = 1:n
        d(i, 1) = norm(A(:,i)).^2;
    end
endfunction

// rLinear circle fitting

function [C, r, R] = circle_fitting(X, Y)
    // X, Y: experimental points (line vectors)
    // C : coordinnates of the center of the circle (vector)
    // r : circle radius (scalar)
    A = [X ; Y];
    d = varsubst(A);
    // xstar = 2*xcenter
    // ystar = 2*ycenter
    // zstar = r^2 - (xcenter^2 + ycenter^2)
    [xystar, zstar, sigma] = reglin(A, d');
    C = 0.5*xystar;
    r = sqrt(zstar + C(1)^2 + C(2)^2);
    R = sigma;
endfunction

// **********
// Main program
// **********

// Data reading

raw_picture = read('image_noisy_circle.txt', -1, 1); // intensity
Xdef = read('X_noisy_circle.txt', -1, 1);
Ydef = read('Y_noisy_circle.txt', -1, 1);
xmin = min(Xdef); xmax = max(Xdef);
ymin = min(Ydef); ymax = max(Ydef);
sizeX = size(Xdef, '*');
sizeY = size(Ydef, '*');

// intensities -> matrixs
picture = picture_matrix(sizeX, sizeY, raw_picture);

// Display of the noisy picture
isoview(xmin, xmax, ymin, ymax);
cmap = [graycolormap(256);
    0, 255, 0; // green
    225, 0, 0]; // red
xset('colormap', cmap);
grayplot(Xdef, Ydef, picture);

// detection of the pixels above the threshold
[Xcercle, Ycercle] = detection(Xdef, Ydef, picture, threshold);
plot(Xcercle, Ycercle, 'g+');

// regression
[center, radius, mismatch] = circle_fitting(Xcercle, Ycercle);

// writing

text = 'C('+string(center(1))+' ; '+string(center(2))+') ;...
    r = '+string(radius);

// fond blanc (4x le même texte décalé)
xstring(-0.48, 4.5, text);
txt = gce(); txt.font_foreground = 256; // white colour (cmap)
xstring(-0.52, 4.5, text);
txt = gce(); txt.font_foreground = 256;
xstring(-0.5, 4.52, text);
txt = gce(); txt.font_foreground = 256;
xstring(-0.5, 4.48, text);
txt = gce(); txt.font_foreground = 256;

xstring(-0.5, 4.5, text);
txt = gce(); txt2.font_foreground = 1; // black colour (cmap)

// Drawing the model

plot(center(1), center(2), 'r+')
diametre = 2*radius;
xarc(center(1) - radius, center(2) + radius,...
    diametre, diametre,...
    0, 360*64)
b = gce(); // circle
b.foreground = 258; // red colour (cmap)

// Display of parameters

print(%io(2), center)
print(%io(2), radius)
print(%io(2), mismatch)

רישיון

אני, בעל זכויות היוצרים על היצירה הזאת, מפרסם אותה בזאת תחת הרישיונות הבאים:
GNU head מוענקת בכך הרשות להעתיק, להפיץ או לשנות את המסמך הזה, לפי תנאי הרישיון לשימוש חופשי במסמכים של גנו, גרסה 1.2 או כל גרסה מאוחרת יותר שתפורסם על־ידי המוסד לתוכנה חופשית; ללא פרקים קבועים, ללא טקסט עטיפה קדמית וללא טקסט עטיפה אחורית. עותק של הרישיון כלול בפרק שכותרתו הרישיון לשימוש חופשי במסמכים של גנו.
w:he:Creative Commons
ייחוס שיתוף זהה
הקובץ הזה מתפרסם לפי תנאי רישיונות קריאייטיב קומונז ייחוס-שיתוף זהה 3.0 לא מותאם, 2.5 כללי, 2.0 כללי ו־1.0 כללי.
הנכם רשאים:
  • לשתף – להעתיק, להפיץ ולהעביר את העבודה
  • לערבב בין עבודות – להתאים את העבודה
תחת התנאים הבאים:
  • ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
  • שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור.
הנכם מוזמנים לבחור את הרישיון הרצוי בעיניכם.

כיתובים

נא להוסיף משפט שמסביר מה הקובץ מייצג

פריטים שמוצגים בקובץ הזה

מוצג

היסטוריית הקובץ

ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.

תאריך/שעהתמונה ממוזערתממדיםמשתמשהערה
נוכחית17:12, 10 בדצמבר 2012תמונה ממוזערת לגרסה מ־17:12, 10 בדצמבר 2012‪365 × 366‬ (24 ק"ב)Cdang{{Information |Description ={{en|1=margins removed}} |Source ={{own}} |Author =Cdang |Date = |Permission = |other_versions = }}
15:50, 10 בדצמבר 2012תמונה ממוזערת לגרסה מ־15:50, 10 בדצמבר 2012‪460 × 610‬ (18 ק"ב)Cdang{{Information |Description ={{en|1=Detection of a circle in a very noisy picture. The picture is a fuzzy circle: the intensity is a gaussian function of the difference between the distance to the center C(2;2) and the radius ''r'' = 2 of the nomina...

אין בוויקיפדיה דפים המשתמשים בקובץ זה.

שימוש גלובלי בקובץ

אתרי הוויקי השונים הבאים משתמשים בקובץ זה:

מטא־נתונים