IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VHDL Discussion :

feature vector in vhdl


Sujet :

VHDL

  1. #1
    Futur Membre du Club
    Homme Profil pro
    recherche
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : recherche
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 7
    Points
    7
    Par défaut feature vector in vhdl
    Peace!
    I want ask about the number of bits shoud I use in an fixed_point number to obtein the good precision, precision of distance eclidean.
    some detail:
    I want to determine an vector of foor element VECT[MOY1,MOY2,MOY3,MOY4], each element is the moyen of one quart of matrix of (64*64), the matrix' element value varies (0-255)'''it's pixel valor'''
    --> the result of division (MOY1=SUM/Nbits) has 8 bits in the integer part;
    Question: how many bits of fractional part shout I use to get the good result (result of euclidean distance between two vector VECT1[MOY11,MOY12,MOY13,MOY14] and VECT[MOY21,MOY22,MOY23,MOY24])..
    thank you....peace:

  2. #2
    Membre expérimenté

    Homme Profil pro
    Collégien
    Inscrit en
    Juillet 2010
    Messages
    545
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Afghanistan

    Informations professionnelles :
    Activité : Collégien

    Informations forums :
    Inscription : Juillet 2010
    Messages : 545
    Points : 1 429
    Points
    1 429
    Par défaut
    I can't tell what is "the good precision"


    It really depend on your application and what you want to do...
    If the by the Euclidian distance you mean: cumsum(vect.*vect) and vect is 8 bits width and contains 64 elements
    (8+8)+6 => 24 bits , if you don't want to loose information

  3. #3
    Futur Membre du Club
    Homme Profil pro
    recherche
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : recherche
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 7
    Points
    7
    Par défaut
    Thank you mith06
    Citation Envoyé par mith06 Voir le message
    I can't tell what is "the good precision"


    It really depend on your application and what you want to do...
    If the by the Euclidian distance you mean: cumsum(vect.*vect) and vect is 8 bits width and contains 64 elements

    actualy, the vector has foor of fixed point values :
    vect1(MOY1,MOY2,MOY3,MOY4) ,of matrix1--> MOY1= ( sum(matrix1(1:16,1:64))) / (16 * 64); /*moyen of first quart*/ , MOY1= ( sum(matrix1(17:32,1:64))) / (16 * 64); /*moyen of secound quart*/and so the others of the 3 quart rest
    vect2(MOY1,MOY2,MOY3,MOY4) ,of matrix2--> MOY1= ( sum(matrix2(1:16,1:64))) / (16 * 64); /*moyen of first quart*/ ,and so the others of the 3 quart rest ,and so the others

    Euclidean distance in matlab: euc.matlab = norm(vect1 - vect2)

    Citation Envoyé par mith06 Voir le message
    (8+8)+6 => 24 bits , if you don't want to loose information
    so the integer part can wrote in 8bits:::My question is how bits shoud I use for the fractional part Knowing that I want keep a big part of the
    information.

  4. #4
    Membre expérimenté

    Homme Profil pro
    Collégien
    Inscrit en
    Juillet 2010
    Messages
    545
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Afghanistan

    Informations professionnelles :
    Activité : Collégien

    Informations forums :
    Inscription : Juillet 2010
    Messages : 545
    Points : 1 429
    Points
    1 429
    Par défaut
    norm(vect1 - vect2)
    = sqrt(sum((vect1-vect2)^2))

    Start with 8 bits
    substraction => +1 bits
    multiplcation => *2 bits
    Sum over N element => + log2(N) bits
    sqrt => +0 bits (you will loose information what ever the number of bits you use)

    ((8+1)*2)+log2(64) = 24 bits if you d'ont want to loose information

Discussions similaires

  1. [Struts] logic:iterate avec un Vector
    Par laurentb dans le forum Struts 1
    Réponses: 18
    Dernier message: 03/03/2004, 14h42
  2. vector et erase()
    Par gytr2 dans le forum SL & STL
    Réponses: 6
    Dernier message: 02/03/2004, 12h45
  3. equivalent Vector du jsp
    Par Djib dans le forum ASP
    Réponses: 4
    Dernier message: 05/12/2003, 08h07
  4. "vector" provoque "syntax error", malgré
    Par seenkay dans le forum Autres éditeurs
    Réponses: 5
    Dernier message: 24/08/2003, 03h21
  5. Réponses: 2
    Dernier message: 11/07/2003, 18h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo