Custom Search

Friday, December 26, 2008

OpenCV read coordinates from cvFindContours

CvSeq* contour1 = 0;
cvThreshold( src, src, threshold, 255, CV_THRESH_BINARY );//convert to black and white
cvFindContours( src, storage, &contour, sizeof(CvContour), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE );
cvZero( dst );
contour1 = contour;
for( ; contour != 0; contour = contour->h_next )
{
cvDrawContours( dst, contour, CV_RGB(0,255,0), CV_RGB(255,255,0), -1, 1, 8 );
}

int maxLevel = 3;
CvTreeNodeIterator iterator;
CvPoint pt,pt1,pt2;
if(contour1 != 0)
cvInitTreeNodeIterator( &iterator, contour1, maxLevel );
int i = 0;
while( (contour1 = (CvSeq*)cvNextTreeNode( &iterator )) != 0 )
{
CvSeqReader reader;
int count = contour1->total;
cvStartReadSeq( contour1, &reader, 0 );
count -= !CV_IS_SEQ_CLOSED ( contour1 );
CV_READ_SEQ_ELEM ( pt, reader );
i++;
ptArray[i] = pt;
printf("coordinates%d: %d %d \n",i ,pt.x, pt.y);
cvRectangle( dst, pt, cvPoint(pt.x+2,pt.y+2) , CV_RGB(0,0,255), 1, 8, 0 );
}
// replace CV_FILLED with 1 to see the outlines

Taken from http://cv-kolaric.blogspot.com/ thanks SINISA KOLARIC :)

Monday, December 22, 2008

Borderline personality disorder

Borderline personality disorder (BPD) is a psychiatric diagnosis in the Diagnostic and Statistical Manual of Mental Disorders (DSM-IV Personality Disorders 301.83) that describes a prolonged disturbance of personality function characterized by depth and variability of moods. The disorder typically involves unusual levels of instability in mood; "black and white" thinking, or "splitting"; chaotic and unstable interpersonal relationships, self-image, identity, and behavior; as well as a disturbance in the individual's sense of self. In extreme cases, this disturbance in the sense of self can lead to periods of dissociation. These disturbances can have a pervasive negative impact on many or all of the psychosocial facets of life. This includes difficulties maintaining relationships in work, home, and social settings. Attempted suicide and completed suicide are possible outcomes, especially without proper care and effective therapy. Onset of symptoms typically occurs during adolescence or young adulthood. Symptoms may persist for several years, but the majority of symptoms lessen in severity over time,with some individuals fully recovering. The mainstay of treatment is various forms of psychotherapy, although medication and other approaches may also improve symptoms.

Friday, December 5, 2008

Self Handicapping

Self-handicapping occurs when individuals anticipate failure on a self-relevant task and create impediments to success. Thus doing things that would increase the self-handicapper's risk of failure.
Why do people, given the availability of alternative self-protective strategies such as self-affirmation and self-evaluation maintenance that do not entail self-sabotage?
A hypothesis is that self-handicapping might serve a secondary purpose: to preserve a pleasant affective state.
1) Self-handicappers re protected from failure by ascribing poor performance to factors other than lack of ability.
2) People who succeed despite their handicaps earn extra credit for their success.
Therefore, self-handicappers discount ability attributions for failure but augment ability attributions following success.
Self-handicapping may lead to more positive mood.
Is mood an antecedent influence on self-handicapping?
Mood states play an important role in how people attribute success and failure.
Happy persons tend to take credit when doing well, but avoid self-blame when experiencing failure.
Sad persons took little credit for success, but blamed themselves when they did poorly.
Real-life relationships showed similar mood-induced bias.
Happy people rely on positive moods as a resource to help them deal with aversive but potentially useful negative feedback. However, when negative feedback is uninformative or unreliable, happy mood produces the opposite reaction, as people become protective of their positive moods.
Self-handicapping occurs when people doubt their ability and value of receiving further feedback is low.
Results show that non-contingent feedback induces greater self-handicapping than contingent positive feedback, as people who receive non-contingent feedback doubt that they can perform well again.

Happy participants did not self-handicap merely because they wanted to avoid effrt to maintain good mood, or experienced elevated tates of imulsiveness, situational self-esteem, or arousal. Therefore mood should directly influence the motivation to self-handicap.

Most people self-handicap defensively, to discount distressing self-attributions of failure, but not to improve existing aversive states.

Lifted from www.sciencedirect.com On being happy but fearing failure: The effects of mood on self-handicapping strategies