Accueil > > > TRANSFORMÉE DE HOUGH: DÉTECTION DE DROITES
TRANSFORMÉE DE HOUGH: DÉTECTION DE DROITES
Information sur la source
Description
Ce programme permet de mieux comprendre le fonctionnement de la transformée de Hough.
Cette transformée permet de changer d'espace de représentation. Un point dans l'espace (X,Y) sera transformée en sinusoïde dans l'espace (R,Theta) et inversement un point dans le plan (R, Theta) sera une droite dans le plan (X,Y).
Ce qui est intéressant, c'est que la succession de point formant une droite dans le plan (X,Y) formera des sinusoïdes qui seront concurrente en un point.
Cette transformé permet donc de détecter les droites dans une image.
Source
-
- //*****************************************************************************************
- //Author MORARD Vincent
- //Date : 28/06/07
- //Contact: vincent.morard@cpe.fr
- //WebSite: pistol.petesampras.free.fr
- //*****************************************************************************************
-
- //Includes----------------------------------------------------------------------------------
- #include "windows.h"
- #include "cmugraphics.h"
- #include "math.h"
- #include <vector>
- using namespace std;
-
- //Define------------------------------------------------------------------------------------
- #define SPACE_X1 100
- #define SPACE_Y1 10
- #define SPACE_X2 300
- #define SPACE_Y2 210
-
- #define SPACE_CENTER_X 200
- #define SPACE_CENTER_Y 110
-
- #define HOUGH_X1 50
- #define HOUGH_Y1 230
- #define HOUGH_X2 350
- #define HOUGH_Y2 510
-
- #define HOUGH_CENTER_X 50
- #define HOUGH_CENTER_Y 370
- const double Pi = 3.141592653589793238462643383279;
-
- //Struct---------------------------------------------------------------------------------
- struct Transform
- {
- double X,Y,Theta,R;
- bool Inv_Transform;
- };
-
-
- //Header's function-----------------------------------------------------------------------
- void DrawAxis(window &F,int Graph=-1);
- void DrawCosinus(window &F,double R,double Theta);
- void DrawLine(window &F,double X,double Y,double Theta);
- void UpdateHough(window &F,vector<Transform> Vect);
- void UpdateSpace(window &F,vector<Transform> Vect);
- void ButtonDownAction(window &F,vector<Transform> *Vect,int MouseX,int MouseY,bool Final=0);
- void UpdateCoord(window &F,vector<Transform> *Vect);
- void DrawInterface(window &F,bool *Reset,bool *Exit,bool *Click);
-
-
- //*******************************************************************************************
-
- int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
-
- {
- bool Exit=false;
- bool Reset=true;
- bool Click=false;
- int Cpt=0;
- window F(390,600,0,0); //create a 390 width and 600 Height window
- //at the position (0,0)
- F.SetWaitClose(false); //Close the window when we exit
- F.SetBuffering(true); //Allow double buffering
- F.ChangeTitle("Hough tranform");//Change title
-
- vector<Transform>Vect; //Vector to stock all the parameters
- Vect.resize(0); //init vector
-
-
- do
- {
- if(++Cpt==100)
- {
- MSG msg;
- if(!GetMessage(&msg, NULL, 0, 0))//On recoit le message de fin =>on a appuyé sur la croix
- exit(1);
- Cpt=0;
- }
- if(Reset) //if Reset : we redraw axis
- {
- Reset=false;
- DrawAxis(F);
- Vect.resize(0); //And we resize to 0 the vector
- }
- UpdateCoord(F,&Vect); //To update the points and theres transforms
- DrawInterface(F,&Reset,&Exit,&Click); //Button
- F.UpdateBuffer();
- Sleep(20); //The process gives back the hand to an another process
- //during 20 ms
- }
- while(!Exit);
- exit(0);
- return 0;
- }
-
- //This function checks the mouse's event and calls the appropriate function
- void UpdateCoord(window &F,vector<Transform>*Vect)
- {
- int MouseX,MouseY;
- bool Click=false;
-
- F.GetMouseCoord(MouseX,MouseY);
- if(MouseY>540)
- return;
- //If the user clicks on the screen, he will see the result of Hough tranform in real time
- while(F.GetButtonState(LEFT_BUTTON,MouseX,MouseY)==BUTTON_DOWN)
- {
-
- ButtonDownAction(F,Vect,MouseX,MouseY); //temporary action
- F.UpdateBuffer();
-
- Sleep(30);
- Click=true;
- }
- if(Click) //if we click the result keeps on the sreen
- ButtonDownAction(F,Vect,MouseX,MouseY,1);
- }
-
-
- //This function takes back the coord of the mouse in the graph
- //and calls the function to make a transformation into Hough's space.
- void ButtonDownAction(window &F,vector<Transform> *Vect,int MouseX,int MouseY,bool Final)
- {
- Transform Hough; //this structure allow us to stock all the parameters of the Hough's transform
- //X and Y , R and theta
-
- //if the mouse is over the graph 1
- if(MouseX > SPACE_X1 && MouseX < SPACE_X2 && MouseY > SPACE_Y1 && MouseY < SPACE_Y2)
- {
- //We just have to tranform MouseX and MouseY to have the coord of the position of
- //the mouse on the graph
- Hough.X = MouseX-SPACE_CENTER_X;
- Hough.Y = SPACE_CENTER_Y-MouseY;
- //With X and Y we are able to get R and Theta in polar coord
- //R=sqrt(X² + Y²)
- //tan(Theta) = Y/X
- Hough.R = sqrt((double)(Hough.X*Hough.X+Hough.Y*Hough.Y));
- Hough.Theta = atan((double)Hough.Y/Hough.X)+Pi/2;
- if(Hough.X>0)
- Hough.Theta+=Pi;
- Hough.Inv_Transform = 0; //Hough transform
-
- Vect->push_back(Hough); //we push the new point
- UpdateHough(F,*Vect); //and we update the transform
- if(!Final)
- Vect->pop_back(); //if we still click, we pop the new point
- else
- {
- F.SetPen(RED); //if we stop clicking, we draw a circle on the screen
- F.SetBrush(RED);
- F.DrawCircle(MouseX,MouseY,3,FRAME);
-
- }
-
-
- }
- else if(MouseX >= HOUGH_X1 && MouseX < HOUGH_X2 && MouseY > HOUGH_Y1 && MouseY < HOUGH_Y2)
- {
- double Pas=Pi/(HOUGH_X2-HOUGH_X1);
- //We have got easily R and Theta
- Hough.Theta = (MouseX-HOUGH_CENTER_X)*Pas;
- Hough.R = HOUGH_CENTER_Y-MouseY;
- //And we convert R and Theta in cartesien coord
- Hough.Y = Hough.R*cos(Hough.Theta);
- Hough.X = -Hough.R*sin(Hough.Theta);
- Hough.Inv_Transform = 1; //Hough reverse
-
- Vect->push_back(Hough);
- UpdateSpace(F,*Vect);
- if(!Final)
- Vect->pop_back();
- else
- {
- F.SetBrush(GREEN);
- F.SetPen(GREEN);
- F.DrawCircle(MouseX,MouseY,3,FILLED);
- }
- }
- }
-
- void UpdateHough(window &F,vector<Transform> Vect)
- {
-
- DrawAxis(F,2);
- F.SetPen(GREEN);
- F.SetBrush(GREEN);
- int Size=Vect.size();
- for(int i=0;i<Size;i++)
- {
- if(! Vect[i].Inv_Transform )
- DrawCosinus(F,Vect[i].R,Vect[i].Theta);
- else
- F.DrawCircle(Vect[i].Theta*(HOUGH_X2-HOUGH_X1)/Pi+HOUGH_CENTER_X,HOUGH_CENTER_Y-Vect[i].R,3);
-
- }
-
- }
- void UpdateSpace(window &F,vector<Transform> Vect)
- {
-
- DrawAxis(F,1);
- F.SetPen(RED);
- F.SetBrush(RED);
- int Size=Vect.size();
- for(int i=0;i<Size;i++)
- if(Vect[i].Inv_Transform )
- DrawLine(F,Vect[i].X,Vect[i].Y,Vect[i].Theta);
- else
- F.DrawCircle(Vect[i].X+SPACE_CENTER_X,SPACE_CENTER_Y-Vect[i].Y,3);
-
-
- }
-
- void DrawCosinus(window &F,double R,double Theta)
- {
- int Width=HOUGH_X2-HOUGH_X1;
- int Height=HOUGH_Y2-HOUGH_Y1;
- double x,y;
- double Pas=Pi/Width;
- F.SetPen(GREEN);
- F.SetBrush(GREEN);
- //for each pixel of the graph, we evaluate the y coord with cosinus
- for(double i=HOUGH_X1;i<HOUGH_X2;i++)
- {
- x=i-HOUGH_CENTER_X;
- x*=Pas; //conversion into radian
- y=R*cos(x-Theta);
- F.DrawPixel(i,HOUGH_CENTER_Y-y);
- }
- }
-
-
- //This function is able to draw a line with one point and one angle
- void DrawLine(window &F,double X,double Y,double Theta)
- {
- //Vecteur is the direction
- double Vecteur=tan(Theta);
-
- X+=SPACE_CENTER_X;
- Y=SPACE_CENTER_Y-Y;
- if(X>SPACE_X2 || X<SPACE_X1 || Y>SPACE_Y2 || Y<SPACE_Y1)
- return;
-
- int LastX=X;
- int LastY=Y;
- double i,j;
-
- F.SetPen(RED);
- F.SetBrush(RED);
- for(i=X;i<=SPACE_X2;i+=0.5)
- {
- if((j=Y-Vecteur*(i-X))>SPACE_Y2 || j<SPACE_Y1)
- break;
-
- LastX=i; //We get the coord of the point whith cut the graph's window
- LastY=j;
- }
- F.DrawLine((int)X,(int)Y,LastX,LastY);
- LastX=X;
- LastY=Y;
-
- //We do the same thing in the other way
- for(i=X;i>=SPACE_X1;i-=0.5)
- {
- if((j=j=Y-Vecteur*(i-X))>SPACE_Y2 || j<SPACE_Y1)
- break;
-
- LastX=i;
- LastY=j;
- }
- F.DrawLine((int)X,(int)Y,LastX,LastY);
-
-
- }
-
-
- void DrawInterface(window &F,bool *Reset,bool *Exit,bool *Click)
- {
- int MouseX,MouseY;
- F.SetFont(20,BOLD,SWISS);
- F.SetPen(WHITE);
- F.SetBrush(WHITE);
- F.DrawRectangle(100,540,400,590);
-
-
- F.SetPen(NAVYBLUE,2);
- //F.DrawRectangle(210,545,270,575);
- F.DrawString(110,550,"Reset");
- F.DrawString(220,550,"Quit");
-
- if(F.GetButtonState(LEFT_BUTTON,MouseX,MouseY)==BUTTON_DOWN)
- {
- if(MouseX>=80 && MouseX<180 && MouseY>545 && MouseY<575)
- *Click=true;
- if(MouseX>=210 && MouseX<270 && MouseY>545 && MouseY<575)
- *Click=true;
- }
- else if (*Click)
- {
- *Click=false;
- if(MouseX>=80 && MouseX<180 && MouseY>545 && MouseY<575)
- *Reset=true;
- if(MouseX>=210 && MouseX<270 && MouseY>545 && MouseY<575)
- *Exit=true;
-
-
- }
- else
- *Click=false;
-
- }
-
- void DrawAxis(window &F,int Graph)
- {
-
- F.SetBrush(WHITE);
- F.SetFont(15,BOLD,SWISS);
- if(Graph!=2) //We do not draw again graph 2
- {
- F.SetPen(DARKRED,3);
- F.DrawRectangle(SPACE_X1,SPACE_Y1,SPACE_X2,SPACE_Y2);
- F.SetPen(BLACK);
- //y-axis
- F.DrawLine(SPACE_CENTER_X,SPACE_Y1,SPACE_CENTER_X,SPACE_Y2);
- //x-axis
- F.DrawLine(SPACE_X1,SPACE_CENTER_Y,SPACE_X2,SPACE_CENTER_Y);
- //Arrows
- F.DrawLine(SPACE_CENTER_X-5,SPACE_Y1+9,SPACE_CENTER_X,SPACE_Y1);
- F.DrawLine(SPACE_CENTER_X+5,SPACE_Y1+9,SPACE_CENTER_X,SPACE_Y1);
- F.DrawLine(SPACE_X2-5,SPACE_CENTER_Y+3,SPACE_X2,SPACE_CENTER_Y);
- F.DrawLine(SPACE_X2-5,SPACE_CENTER_Y-3,SPACE_X2,SPACE_CENTER_Y);
- //Legende
- F.DrawString(SPACE_CENTER_X,SPACE_Y1-16,"y");
- F.DrawString(SPACE_X2+10,SPACE_CENTER_Y,"x");
- }
- if(Graph!=1) //We do not draw again graph 1
- {
- F.SetPen(DARKGREEN,3);
- F.DrawRectangle(HOUGH_X1,HOUGH_Y1,HOUGH_X2,HOUGH_Y2);
- F.SetPen(BLACK);
- //y-axis
- F.DrawLine(HOUGH_CENTER_X,HOUGH_Y1,HOUGH_CENTER_X,HOUGH_Y2);
- //x-axis
- F.DrawLine(HOUGH_X1,HOUGH_CENTER_Y,HOUGH_X2,HOUGH_CENTER_Y);
- //Arrows
- F.DrawLine(HOUGH_CENTER_X-5,HOUGH_Y1+9,HOUGH_CENTER_X,HOUGH_Y1);
- F.DrawLine(HOUGH_CENTER_X+5,HOUGH_Y1+9,HOUGH_CENTER_X,HOUGH_Y1);
- F.DrawLine(HOUGH_X2-5,HOUGH_CENTER_Y+3,HOUGH_X2,HOUGH_CENTER_Y);
- F.DrawLine(HOUGH_X2-5,HOUGH_CENTER_Y-3,HOUGH_X2,HOUGH_CENTER_Y);
- //Legende
- F.DrawString(HOUGH_CENTER_X,HOUGH_Y1-16,"Theta");
- F.DrawString(HOUGH_X2+8,HOUGH_CENTER_Y,"R");
- }
-
- }
//*****************************************************************************************
//Author MORARD Vincent
//Date : 28/06/07
//Contact: vincent.morard@cpe.fr
//WebSite: pistol.petesampras.free.fr
//*****************************************************************************************
//Includes----------------------------------------------------------------------------------
#include "windows.h"
#include "cmugraphics.h"
#include "math.h"
#include <vector>
using namespace std;
//Define------------------------------------------------------------------------------------
#define SPACE_X1 100
#define SPACE_Y1 10
#define SPACE_X2 300
#define SPACE_Y2 210
#define SPACE_CENTER_X 200
#define SPACE_CENTER_Y 110
#define HOUGH_X1 50
#define HOUGH_Y1 230
#define HOUGH_X2 350
#define HOUGH_Y2 510
#define HOUGH_CENTER_X 50
#define HOUGH_CENTER_Y 370
const double Pi = 3.141592653589793238462643383279;
//Struct---------------------------------------------------------------------------------
struct Transform
{
double X,Y,Theta,R;
bool Inv_Transform;
};
//Header's function-----------------------------------------------------------------------
void DrawAxis(window &F,int Graph=-1);
void DrawCosinus(window &F,double R,double Theta);
void DrawLine(window &F,double X,double Y,double Theta);
void UpdateHough(window &F,vector<Transform> Vect);
void UpdateSpace(window &F,vector<Transform> Vect);
void ButtonDownAction(window &F,vector<Transform> *Vect,int MouseX,int MouseY,bool Final=0);
void UpdateCoord(window &F,vector<Transform> *Vect);
void DrawInterface(window &F,bool *Reset,bool *Exit,bool *Click);
//*******************************************************************************************
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
bool Exit=false;
bool Reset=true;
bool Click=false;
int Cpt=0;
window F(390,600,0,0); //create a 390 width and 600 Height window
//at the position (0,0)
F.SetWaitClose(false); //Close the window when we exit
F.SetBuffering(true); //Allow double buffering
F.ChangeTitle("Hough tranform");//Change title
vector<Transform>Vect; //Vector to stock all the parameters
Vect.resize(0); //init vector
do
{
if(++Cpt==100)
{
MSG msg;
if(!GetMessage(&msg, NULL, 0, 0))//On recoit le message de fin =>on a appuyé sur la croix
exit(1);
Cpt=0;
}
if(Reset) //if Reset : we redraw axis
{
Reset=false;
DrawAxis(F);
Vect.resize(0); //And we resize to 0 the vector
}
UpdateCoord(F,&Vect); //To update the points and theres transforms
DrawInterface(F,&Reset,&Exit,&Click); //Button
F.UpdateBuffer();
Sleep(20); //The process gives back the hand to an another process
//during 20 ms
}
while(!Exit);
exit(0);
return 0;
}
//This function checks the mouse's event and calls the appropriate function
void UpdateCoord(window &F,vector<Transform>*Vect)
{
int MouseX,MouseY;
bool Click=false;
F.GetMouseCoord(MouseX,MouseY);
if(MouseY>540)
return;
//If the user clicks on the screen, he will see the result of Hough tranform in real time
while(F.GetButtonState(LEFT_BUTTON,MouseX,MouseY)==BUTTON_DOWN)
{
ButtonDownAction(F,Vect,MouseX,MouseY); //temporary action
F.UpdateBuffer();
Sleep(30);
Click=true;
}
if(Click) //if we click the result keeps on the sreen
ButtonDownAction(F,Vect,MouseX,MouseY,1);
}
//This function takes back the coord of the mouse in the graph
//and calls the function to make a transformation into Hough's space.
void ButtonDownAction(window &F,vector<Transform> *Vect,int MouseX,int MouseY,bool Final)
{
Transform Hough; //this structure allow us to stock all the parameters of the Hough's transform
//X and Y , R and theta
//if the mouse is over the graph 1
if(MouseX > SPACE_X1 && MouseX < SPACE_X2 && MouseY > SPACE_Y1 && MouseY < SPACE_Y2)
{
//We just have to tranform MouseX and MouseY to have the coord of the position of
//the mouse on the graph
Hough.X = MouseX-SPACE_CENTER_X;
Hough.Y = SPACE_CENTER_Y-MouseY;
//With X and Y we are able to get R and Theta in polar coord
//R=sqrt(X² + Y²)
//tan(Theta) = Y/X
Hough.R = sqrt((double)(Hough.X*Hough.X+Hough.Y*Hough.Y));
Hough.Theta = atan((double)Hough.Y/Hough.X)+Pi/2;
if(Hough.X>0)
Hough.Theta+=Pi;
Hough.Inv_Transform = 0; //Hough transform
Vect->push_back(Hough); //we push the new point
UpdateHough(F,*Vect); //and we update the transform
if(!Final)
Vect->pop_back(); //if we still click, we pop the new point
else
{
F.SetPen(RED); //if we stop clicking, we draw a circle on the screen
F.SetBrush(RED);
F.DrawCircle(MouseX,MouseY,3,FRAME);
}
}
else if(MouseX >= HOUGH_X1 && MouseX < HOUGH_X2 && MouseY > HOUGH_Y1 && MouseY < HOUGH_Y2)
{
double Pas=Pi/(HOUGH_X2-HOUGH_X1);
//We have got easily R and Theta
Hough.Theta = (MouseX-HOUGH_CENTER_X)*Pas;
Hough.R = HOUGH_CENTER_Y-MouseY;
//And we convert R and Theta in cartesien coord
Hough.Y = Hough.R*cos(Hough.Theta);
Hough.X = -Hough.R*sin(Hough.Theta);
Hough.Inv_Transform = 1; //Hough reverse
Vect->push_back(Hough);
UpdateSpace(F,*Vect);
if(!Final)
Vect->pop_back();
else
{
F.SetBrush(GREEN);
F.SetPen(GREEN);
F.DrawCircle(MouseX,MouseY,3,FILLED);
}
}
}
void UpdateHough(window &F,vector<Transform> Vect)
{
DrawAxis(F,2);
F.SetPen(GREEN);
F.SetBrush(GREEN);
int Size=Vect.size();
for(int i=0;i<Size;i++)
{
if(! Vect[i].Inv_Transform )
DrawCosinus(F,Vect[i].R,Vect[i].Theta);
else
F.DrawCircle(Vect[i].Theta*(HOUGH_X2-HOUGH_X1)/Pi+HOUGH_CENTER_X,HOUGH_CENTER_Y-Vect[i].R,3);
}
}
void UpdateSpace(window &F,vector<Transform> Vect)
{
DrawAxis(F,1);
F.SetPen(RED);
F.SetBrush(RED);
int Size=Vect.size();
for(int i=0;i<Size;i++)
if(Vect[i].Inv_Transform )
DrawLine(F,Vect[i].X,Vect[i].Y,Vect[i].Theta);
else
F.DrawCircle(Vect[i].X+SPACE_CENTER_X,SPACE_CENTER_Y-Vect[i].Y,3);
}
void DrawCosinus(window &F,double R,double Theta)
{
int Width=HOUGH_X2-HOUGH_X1;
int Height=HOUGH_Y2-HOUGH_Y1;
double x,y;
double Pas=Pi/Width;
F.SetPen(GREEN);
F.SetBrush(GREEN);
//for each pixel of the graph, we evaluate the y coord with cosinus
for(double i=HOUGH_X1;i<HOUGH_X2;i++)
{
x=i-HOUGH_CENTER_X;
x*=Pas; //conversion into radian
y=R*cos(x-Theta);
F.DrawPixel(i,HOUGH_CENTER_Y-y);
}
}
//This function is able to draw a line with one point and one angle
void DrawLine(window &F,double X,double Y,double Theta)
{
//Vecteur is the direction
double Vecteur=tan(Theta);
X+=SPACE_CENTER_X;
Y=SPACE_CENTER_Y-Y;
if(X>SPACE_X2 || X<SPACE_X1 || Y>SPACE_Y2 || Y<SPACE_Y1)
return;
int LastX=X;
int LastY=Y;
double i,j;
F.SetPen(RED);
F.SetBrush(RED);
for(i=X;i<=SPACE_X2;i+=0.5)
{
if((j=Y-Vecteur*(i-X))>SPACE_Y2 || j<SPACE_Y1)
break;
LastX=i; //We get the coord of the point whith cut the graph's window
LastY=j;
}
F.DrawLine((int)X,(int)Y,LastX,LastY);
LastX=X;
LastY=Y;
//We do the same thing in the other way
for(i=X;i>=SPACE_X1;i-=0.5)
{
if((j=j=Y-Vecteur*(i-X))>SPACE_Y2 || j<SPACE_Y1)
break;
LastX=i;
LastY=j;
}
F.DrawLine((int)X,(int)Y,LastX,LastY);
}
void DrawInterface(window &F,bool *Reset,bool *Exit,bool *Click)
{
int MouseX,MouseY;
F.SetFont(20,BOLD,SWISS);
F.SetPen(WHITE);
F.SetBrush(WHITE);
F.DrawRectangle(100,540,400,590);
F.SetPen(NAVYBLUE,2);
//F.DrawRectangle(210,545,270,575);
F.DrawString(110,550,"Reset");
F.DrawString(220,550,"Quit");
if(F.GetButtonState(LEFT_BUTTON,MouseX,MouseY)==BUTTON_DOWN)
{
if(MouseX>=80 && MouseX<180 && MouseY>545 && MouseY<575)
*Click=true;
if(MouseX>=210 && MouseX<270 && MouseY>545 && MouseY<575)
*Click=true;
}
else if (*Click)
{
*Click=false;
if(MouseX>=80 && MouseX<180 && MouseY>545 && MouseY<575)
*Reset=true;
if(MouseX>=210 && MouseX<270 && MouseY>545 && MouseY<575)
*Exit=true;
}
else
*Click=false;
}
void DrawAxis(window &F,int Graph)
{
F.SetBrush(WHITE);
F.SetFont(15,BOLD,SWISS);
if(Graph!=2) //We do not draw again graph 2
{
F.SetPen(DARKRED,3);
F.DrawRectangle(SPACE_X1,SPACE_Y1,SPACE_X2,SPACE_Y2);
F.SetPen(BLACK);
//y-axis
F.DrawLine(SPACE_CENTER_X,SPACE_Y1,SPACE_CENTER_X,SPACE_Y2);
//x-axis
F.DrawLine(SPACE_X1,SPACE_CENTER_Y,SPACE_X2,SPACE_CENTER_Y);
//Arrows
F.DrawLine(SPACE_CENTER_X-5,SPACE_Y1+9,SPACE_CENTER_X,SPACE_Y1);
F.DrawLine(SPACE_CENTER_X+5,SPACE_Y1+9,SPACE_CENTER_X,SPACE_Y1);
F.DrawLine(SPACE_X2-5,SPACE_CENTER_Y+3,SPACE_X2,SPACE_CENTER_Y);
F.DrawLine(SPACE_X2-5,SPACE_CENTER_Y-3,SPACE_X2,SPACE_CENTER_Y);
//Legende
F.DrawString(SPACE_CENTER_X,SPACE_Y1-16,"y");
F.DrawString(SPACE_X2+10,SPACE_CENTER_Y,"x");
}
if(Graph!=1) //We do not draw again graph 1
{
F.SetPen(DARKGREEN,3);
F.DrawRectangle(HOUGH_X1,HOUGH_Y1,HOUGH_X2,HOUGH_Y2);
F.SetPen(BLACK);
//y-axis
F.DrawLine(HOUGH_CENTER_X,HOUGH_Y1,HOUGH_CENTER_X,HOUGH_Y2);
//x-axis
F.DrawLine(HOUGH_X1,HOUGH_CENTER_Y,HOUGH_X2,HOUGH_CENTER_Y);
//Arrows
F.DrawLine(HOUGH_CENTER_X-5,HOUGH_Y1+9,HOUGH_CENTER_X,HOUGH_Y1);
F.DrawLine(HOUGH_CENTER_X+5,HOUGH_Y1+9,HOUGH_CENTER_X,HOUGH_Y1);
F.DrawLine(HOUGH_X2-5,HOUGH_CENTER_Y+3,HOUGH_X2,HOUGH_CENTER_Y);
F.DrawLine(HOUGH_X2-5,HOUGH_CENTER_Y-3,HOUGH_X2,HOUGH_CENTER_Y);
//Legende
F.DrawString(HOUGH_CENTER_X,HOUGH_Y1-16,"Theta");
F.DrawString(HOUGH_X2+8,HOUGH_CENTER_Y,"R");
}
}
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Transformée de Hough [ par elo29 ]
Bonjour, Je travaille avec visual C++ et je debute dans le traitement d'image et en programmation C++. Je dois effectuer la detection de cercles dans
Transformée de Hough ... Help me :( [ par ouafaa ]
Bonjour a tout le mondedans le cadre d'un projet, je suis ramenée à detecter une elipse dans une
Transformée Inverse de Hough [ par s1a1j2 ]
Bonjour Tout le monde,Je cherche la transformée de Hough directe et surtout la transformée inverse Hough. J'espère trouver un code simple en Langage C
Transformée de Hough 3D [ par alice69230 ]
Bonjour,Quelqu'un saurait-il où trouver le code pour faire la transformée de Hough 3D d'un ensemble de points?Merci d'avance!
detection de lignes a l'aide de la transformée de Hough sous matlab [ par mberkani ]
j'utilise matlab pour traiter une video de route , j'ai un pb de programmation concernant la detection des bordures de la route en utilisant la transf
détection de route dans une image de rue [ par wnxbcvqmsldkfjgh ]
Bonjour,J'ai un projet dans lequel je dois détecter une route dans une image de rue, contenant bâtiments, piétons, voitures... Savez-vous si on peut t
Mise en couleur d'image sur une page HTML [ par stephane85700 ]
bonjour, Je débute dans la création de site, et j'aimerai un peu de vos lumières pour avancer.Je souhaiterais pouvoir créer une page ou il serait poss
traitement d'image [ par salma2011 ]
Slt tt le monde,je cherche un théme pour ma representation de PFE avec powerpoint,j'ai comme sujet le traitement d'image avec vc++,,qq1 peut m'aider??
Probleme avec filtre image en c [ par simomiso ]
Bonjour,tout d'abords un GRAND MERCI a tous ceux ki ont participé ds la conception de ce site.En fait j'ai un proble avec un filtre image avec matrice
demande d'aide sur c++builder(segmentation sequence video) [ par fcbomar2007 ]
slt mes frere,je suis un etudiant en informatiquej'ai un projet de fin d'étudequi se présentedans un petit logiciel ,c'est la segmentation séquence v
|
Derniers Blogs
[FRAMEWORK 4] LES TASKS ET LE THREAD UI[FRAMEWORK 4] LES TASKS ET LE THREAD UI par fathi
Je viens de passer quelques temps au TechDay's et j'ai pu voir pas mal de session intéressante. Par contre une chose m'a un peu étonné lors de certaines de ces sessions qui abordaient les améliorations du framework .NET (donc le 4.5) : en gros, bea...
Cliquez pour lire la suite de l'article par fathi WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui m'ont suivi. Je profite de ce poste, pour faire le re...
Cliquez pour lire la suite de l'article par JeremyJeanson TECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PCTECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PC par ROMELARD Fabrice
Speakers: Thierry Rapatout, Antoine Petit et Xavier Trebbia Cette session entre dans le cadre des RDV Décideurs des TechDays 2012, elle est liée à la consumérisation de l'IT et la mise en place du "DeskTop as a Service" dans de plus en ...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLETECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLE par ROMELARD Fabrice
Speakers: Julien Marechal, Gautier Confiant, Sébastien MEYER La session débute par le positionnement de la solution System Center par rapport aux concepts d'organisation ITIL. Le portail du catalogue de se...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : PLEINIèRE SECOND JOURTECHDAYS PARIS 2012 : PLEINIèRE SECOND JOUR par ROMELARD Fabrice
Après une première journée dédiée aux développeurs, cette seconde journée est dédiée au monde des entreprises et de ses applications. Ainsi, cette pleinière est dédiée à faire un 360 de l'évolution des applications Business aux demandes ac...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|