Ask Your Question

opencv1234's profile - activity

2015-12-27 03:39:57 -0600 received badge  Student (source)
2013-09-13 00:40:09 -0600 commented question opencv doesnt work

how is that?

2013-09-12 09:54:26 -0600 asked a question opencv doesnt work

hello I have the latest version of opencv installed but he does not. every time I open an example I see this: https://sites.google.com/site/mywebcamtim/home/naamloos.bmp

can anyone help me?

2013-09-10 05:36:56 -0600 answered a question opencv starting error

can any help my

2013-09-08 12:42:28 -0600 commented question webcam color detection

wear can i find it?

2013-09-08 01:59:39 -0600 commented question webcam color detection

hello I meant: anyone have a webcam color detection for me?

thanks

2013-09-07 10:52:29 -0600 asked a question webcam color detection

hello

someone has a webcam color detection code for me? I have windows xp

thanks

edit:

I meant: anyone have a webcam color detection for me?

thanks

2013-09-07 10:38:54 -0600 answered a question opencv starting error

anyone please

2013-09-05 09:42:13 -0600 asked a question opencv starting error

hello I get the error: the application failed to initialize properly (0xc0000005). Click on OK to terminate the application. when I start my program. my code:

#include "opencv/highgui.h"
#include "opencv/cv.h"

#include <iostream>
#include <stdlib.h>
#include <stdio.h>

// Maths methods
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define sign(x) ((x) > 0 ? 1 : -1)

// Step mooving for object min & max
#define STEP_MIN 5
#define STEP_MAX 100

IplImage *image;

// Position of the object we overlay
CvPoint objectPos = cvPoint(-1, -1);
// Color tracked and our tolerance towards it
int h = 0, s = 0, v = 0, tolerance = 10;

/*
 * Transform the image into a two colored image, one color for the color we want to track, another color for the others colors
 * From this image, we get two datas : the number of pixel detected, and the center of gravity of these pixel
 */
CvPoint binarisation(IplImage* image, int *nbPixels) {

    int x, y;
    CvScalar pixel;
    IplImage *hsv, *mask;
    IplConvKernel *kernel;
    int sommeX = 0, sommeY = 0;
    *nbPixels = 0;

    // Create the mask &initialize it to white (no color detected)
    mask = cvCreateImage(cvGetSize(image), image->depth, 1);

    // Create the hsv image
    hsv = cvCloneImage(image);
    cvCvtColor(image, hsv, CV_BGR2HSV);

    // We create the mask
    cvInRangeS(hsv, cvScalar(h - tolerance -1, s - tolerance, 0), cvScalar(h + tolerance -1, s + tolerance, 255), mask);

    // Create kernels for the morphological operation
    kernel = cvCreateStructuringElementEx(5, 5, 2, 2, CV_SHAPE_ELLIPSE);

    // Morphological opening (inverse because we have white pixels on black background)
    cvDilate(mask, mask, kernel, 1);
    cvErode(mask, mask, kernel, 1);

    // We go through the mask to look for the tracked object and get its gravity center
    for(x = 0; x < mask->width; x++) {
        for(y = 0; y < mask->height; y++) {

            // If its a tracked pixel, count it to the center of gravity's calcul
            if(((uchar *)(mask->imageData + y*mask->widthStep))[x] == 255) {
                sommeX += x;
                sommeY += y;
                (*nbPixels)++;
            }
        }
    }

    // Show the result of the mask image
    cvShowImage("GeckoGeek Mask", mask);

    // We release the memory of kernels
    cvReleaseStructuringElement(&kernel);

    // We release the memory of the mask
    cvReleaseImage(&mask);
    // We release the memory of the hsv image
        cvReleaseImage(&hsv);

    // If there is no pixel, we return a center outside the image, else we return the center of gravity
    if(*nbPixels > 0)
        return cvPoint((int)(sommeX / (*nbPixels)), (int)(sommeY / (*nbPixels)));
    else
        return cvPoint(-1, -1);
}

/*
 * Add a circle on the video that fellow your colored object
 */
void addObjectToVideo(IplImage* image, CvPoint objectNextPos, int nbPixels) {

    int objectNextStepX, objectNextStepY;

    // Calculate circle next position (if there is enough pixels)
    if (nbPixels > 10) {

        // Reset position if no pixel were found
        if (objectPos.x == -1 || objectPos.y == -1) {
            objectPos.x = objectNextPos.x;
            objectPos.y = objectNextPos.y;
        }

        // Move step by step the object position to the desired position
        if (abs(objectPos.x - objectNextPos.x) > STEP_MIN) {
            objectNextStepX = max(STEP_MIN, min(STEP_MAX, abs(objectPos.x - objectNextPos.x) / 2));
            objectPos.x += (-1) * sign(objectPos.x - objectNextPos.x) * objectNextStepX;
        }
        if (abs(objectPos.y - objectNextPos.y) > STEP_MIN) {
            objectNextStepY = max(STEP_MIN, min ...
(more)
2013-09-04 11:43:11 -0600 commented question how to install opencv on code::blocks

i can't find : opencv/lib/mingw

2013-09-04 11:25:06 -0600 commented question how to install opencv on code::blocks

how to install on code::blocks

2013-09-04 09:59:30 -0600 commented question how to install opencv on code::blocks

how to install?

2013-09-04 07:05:42 -0600 received badge  Editor (source)
2013-09-04 07:04:12 -0600 asked a question how to install opencv on code::blocks

hello can someone tell me how to install opencv the latest version? because I have opencv 2.0 but I want the release. and opencv release version I only see the include directory. can anyone help me?

2013-08-28 02:18:04 -0600 asked a question Opencv cvcircle x and y

Where should I enter the x and y in cvcircle?

Thanks