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

OpenCV Discussion :

Suivre une nuance de couleur ET un mouvement


Sujet :

OpenCV

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2015
    Messages : 5
    Par défaut Suivre une nuance de couleur ET un mouvement
    Bonjour,

    Je cherche à faire de la détection de fumée avec OpenCV, je développe;
    Il faudrait que le tracking se fasse en fonction d'une nuance de couleur (nuance de gris pour la fumée) et un mouvement (puisque la fumée n'est pas immobile).

    J'ai déjà trouvé, en fouillant sur le net, des codes sources pour tracker un mouvement (fonctionne très bien) et pour tracker une couleur (fonctionne également très bien), l'idée serait d'assembler les deux afin d'avoir le résultat voulu.

    Auriez-vous une idée de comment assembler correctement ces codes afin d'avoir ce résultat ou alors une autre idée pour détecter de la fumée ?

    Merci à vous,
    Baptiste

  2. #2
    Membre actif
    Inscrit en
    Juin 2007
    Messages
    50
    Détails du profil
    Informations forums :
    Inscription : Juin 2007
    Messages : 50
    Par défaut
    Excellent !!!!

    Tu as donc :
    a) un détecteur de mouvement - qui fonctionne !!! -
    b) un "trackeur" de couleur - qui fonctionne !!! -

    et

    l'idée serait d'assembler les deux afin d'avoir le résultat voulu.

    Auriez-vous une idée de comment assembler correctement ces codes afin d'avoir ce résultat ou alors une autre idée pour détecter de la fumée ?
    ?!!!. Bin je dirais :
    a) "Filtrer" la couleur.
    b) Passer le résultat au détecteur de mouvement.
    Non?

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2015
    Messages : 5
    Par défaut
    Bonjour,

    Merci pour la réponse, pourquoi pas faire comme cela , je vais essayer d'assembler ces 2 solutions comme tu me l'a dis.
    En fouillant un peu plus j'ai trouvé une autre solution, le haartraining, celle-ci serait-elle peut-être plus approprié pour de la détection de fumée ?

    Merci

  4. #4
    Membre actif
    Inscrit en
    Juin 2007
    Messages
    50
    Détails du profil
    Informations forums :
    Inscription : Juin 2007
    Messages : 50
    Par défaut
    Citation Envoyé par BaptisteExcellium Voir le message
    En fouillant un peu plus j'ai trouvé une autre solution, le haartraining, celle-ci serait-elle peut-être plus approprié pour de la détection de fumée ?
    Non, car il faut passer par une phase "d’entrainement" (beaucoup) plus longue.

  5. #5
    Membre éclairé
    Homme Profil pro
    Computer Vision engineer
    Inscrit en
    Mars 2012
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Computer Vision engineer
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Mars 2012
    Messages : 65
    Par défaut
    Citation Envoyé par ZJP972 Voir le message
    Non, car il faut passer par une phase "d’entrainement" (beaucoup) plus longue.
    Et surtout pas adapté à un objet de type "fumée".. !

  6. #6
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2015
    Messages : 5
    Par défaut
    Merci, je vais donc garder cette solution d'haartraining pour d'autres projet, et pour celui ci me concentrer sur la détection de couleur et de mouvement

  7. #7
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2015
    Messages : 5
    Par défaut
    Si je peux encore vous demander conseil;
    J'ai donc 2 bouts de code (tous 2 trouvés sur le web); l'un pour la détection de mouvements
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    #include <stdio.h>
    #include <opencv/cv.h>
    #include <opencv/highgui.h>
    #include "opencv2/highgui/highgui.hpp"
    #include "opencv2/imgproc/imgproc.hpp"
    #include <iostream>
    #include <stdio.h>
    #include <stdlib.h>
    #include "opencv2/video/tracking.hpp"
    #include <math.h>
    #include <time.h>
     
    using namespace cv;
    using namespace std;
     
    float MHI_DURATION = 0.05;
    int DEFAULT_THRESHOLD = 32;
    float MAX_TIME_DELTA = 12500.0;
    float MIN_TIME_DELTA = 5;
    int visual_trackbar = 2;
     
    void draw_motion_comp(Mat& img, int x_coordinate, int y_coordinate, int width, int height, double angle, Mat& result);
     
    Mat frame;
     
    int main(int argc, char** argv)
    {
     
    	namedWindow("Motion_tracking", CV_WINDOW_AUTOSIZE);
    	string values[4] = { "input", "frame_diff", "motion_hist", "grad_orient" };
    	createTrackbar("visual", "Motion_tracking", &visual_trackbar, 3, NULL);
    	createTrackbar("threshold", "Motion_tracking", &DEFAULT_THRESHOLD, 255, NULL);
     
    	VideoCapture cap;
    	cap.open(0);
     
    	if (!cap.isOpened())  // if not success, exit program
    	{
    		cout << "Cannot open the video file" << endl;
    		return -1;
    	}
    	Mat frame, ret, frame_diff, gray_diff, motion_mask;
    	for (int i = 0; i<10; i++)
    	{
    		cap.read(frame);
    		Size frame_size = frame.size();
    		int h = frame_size.height;
    		int w = frame_size.width;
    		if (i == 5)
    			break;
    	}
     
     
    	//cap.open(0);
     
    	if (!cap.isOpened())  // if not success, exit program
    	{
    		cout << "Cannot open the video cam" << endl;
    		return -1;
    	}
     
    	ret = frame.clone();
    	Size frame_size = frame.size();
    	int h = frame_size.height;
    	int w = frame_size.width;
    	double timestamp = 1000.0*clock() / CLOCKS_PER_SEC;
    	Mat prev_frame = frame.clone();
    	Mat motion_history(h, w, CV_32FC1, Scalar(0, 0, 0));
    	Mat hsv(h, w, CV_8UC3, Scalar(0, 255, 0));
    	Mat mg_mask(h, w, CV_8UC1, Scalar(0, 0, 0));
    	Mat mg_orient(h, w, CV_32FC1, Scalar(0, 0, 0));
    	Mat seg_mask(h, w, CV_32FC1, Scalar(0, 0, 0));
    	vector<Rect> seg_bounds;
    	String visual_name;
    	Mat vis(h, w, CV_32FC3);
    	Mat vis1(h, w, CV_8UC1);
    	Mat silh_roi, orient_roi, mask_roi, mhi_roi;
    	VideoWriter output;
    	output.open("outputVideo.avi", CV_FOURCC('D', 'I', 'V', 'X'), 80, cv::Size(640, 480), true);
    	while (1)
    	{
    		cap.retrieve(frame);
    		cap.read(frame);
    		ret = frame.clone();
    		if (!ret.data) //if not success, break loop
    		{
    			cout << "video ended" << endl;
    			break;
    		}
    		absdiff(frame, prev_frame, frame_diff);
    		cvtColor(frame_diff, gray_diff, CV_BGR2GRAY);
    		threshold(gray_diff, ret, DEFAULT_THRESHOLD, 255, 0);
    		motion_mask = ret.clone();
    		double timestamp = 1000.0*clock() / CLOCKS_PER_SEC;
    		updateMotionHistory(motion_mask, motion_history, timestamp, MHI_DURATION);
    		calcMotionGradient(motion_history, mg_mask, mg_orient, MIN_TIME_DELTA, MAX_TIME_DELTA, 3);
    		segmentMotion(motion_history, seg_mask, seg_bounds, timestamp, 32);
     
    		visual_name = values[visual_trackbar];
     
    		if (visual_name == "input")
    			vis = frame.clone();
    		else if (visual_name == "frame_diff")
    			vis = frame_diff.clone();
    		else if (visual_name == "motion_hist")
    		{
     
    			for (int i = 0; i< motion_history.cols; i++)
    			{
    				for (int j = 0; j< motion_history.rows; j++)
    				{
    					float a = motion_history.at<float>(j, i);
    					//					cout << (a-timestamp-MHI_DURATION)/MHI_DURATION << endl;				
    					if ((a - timestamp - MHI_DURATION) / MHI_DURATION <= -5)
    						vis1.at<uchar>(j, i) = 0;
    					else
    						vis1.at<uchar>(j, i) = (a - timestamp - MHI_DURATION) / MHI_DURATION;
    				}
    			}
     
    			cvtColor(vis1, vis, COLOR_GRAY2BGR);
    		}
    		else if (visual_name == "grad_orient")
    		{
    			for (int i = 0; i< hsv.cols; i++)
    			{
    				for (int j = 0; j< hsv.rows; j++)
    				{
    					float a = (mg_orient.at<float>(j, i)) / 2;
     
    					hsv.at<Vec3b>(j, i)[0] = a;
    					float b = (mg_mask.at<uchar>(j, i)) * 255;
    					hsv.at<Vec3b>(j, i)[2] = b;
    				}
    			}
    			cvtColor(hsv, vis, COLOR_HSV2BGR);
    		}
     
    		for (unsigned int h = 0; h < seg_bounds.size(); h++)
    		{
    			Rect rec = seg_bounds[h];
    			if (rec.area() > 5000 && rec.area() < 70000)
    			{
    				rectangle(vis, rec, Scalar(0, 0, 255), 3);
    				silh_roi = motion_mask(rec);
    				orient_roi = mg_orient(rec);
    				mask_roi = mg_mask(rec);
    				mhi_roi = motion_history(rec);
    				if (norm(silh_roi, NORM_L2, noArray()) > rec.area()*0.5)
    				{
    					double angle = calcGlobalOrientation(orient_roi, mask_roi, mhi_roi, timestamp, MHI_DURATION);
    					//					cout << rec.width << endl;
    					draw_motion_comp(vis, rec.x, rec.y, rec.width, rec.height, angle, vis);
    				}
    			}
    		}
    		imshow("Motion_tracking", vis);
    		prev_frame = frame.clone();
    		//		waitKey(30);
    		output.write(vis);
    		if (waitKey(30) >= 0) //wait for 'esc' key press for 30ms. If 'esc' key is pressed, break loop
    		{
    			cout << "esc key is pressed by user" << endl;
    			break;
    		}
    		//		MHI_DURATION = 1000.0*clock()/CLOCKS_PER_SEC- timestamp;
    	}
     
    	//	waitKey(30);
    	return 0;
     
    }
     
     
    void draw_motion_comp(Mat& img, int x_coordinate, int y_coordinate, int width, int height, double angle, Mat& result)
    {
    	//	rectangle(img,Point(x_coordinate,y_coordinate), Point(x_coordinate+width,y_coordinate+width), Scalar(255,0,0), 1, 8, 0);
    	int r, cx, cy;
    	if (height / 2 <= width / 2)
    		r = height / 2;
    	else
    		r = width / 2;
    	cx = x_coordinate + width / 2;
    	cy = y_coordinate + height / 2;
    	angle = angle/* *M_PI *// 180;
    	circle(img, Point(cx, cy), r, Scalar(255, 0, 0), 1, 8, 0);
    	line(img, Point(cx, cy), Point(int(cx + cos(angle)*r), int(cy + sin(angle)*r)), Scalar(255, 0, 0), 1, 8, 0);
    	result = img.clone();
    }
    et l'autre pour le tracking de couleur (choix de la couleur en cliquant dessus)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    #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 = 1;  //TOLERANCE A REGLER ICI
     
    /*
    * 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("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(STEP_MAX, abs(objectPos.y - objectNextPos.y) / 2));
    			objectPos.y += (-1) * sign(objectPos.y - objectNextPos.y) * objectNextStepY;
    		}
     
    		// -1 = object isn't within the camera range
    	}
    	else {
     
    		objectPos.x = -1;
    		objectPos.y = -1;
     
    	}
     
    	// Draw an object (circle) centered on the calculated center of gravity
    	if (nbPixels > 10)
    		cvDrawCircle(image, objectPos, 15, CV_RGB(255, 0, 0), -1);
     
    	// We show the image on the window
    	cvShowImage("Color Tracking", image);
     
    }
     
    /*
    * Get the color of the pixel where the mouse has clicked
    * We put this color as model color (the color we want to tracked)
    */
    void getObjectColor(int event, int x, int y, int flags, void *param = NULL) {
     
    	// Vars
    	CvScalar pixel;
    	IplImage *hsv;
     
    	// valeur des couleurs en TSL (HSV)
    	/*h = 99;
    	s = 68;
    	v = 58; */
     
    	if (event == CV_EVENT_LBUTTONUP) {
     
    		// Get the hsv image
    		hsv = cvCloneImage(image);
    		cvCvtColor(image, hsv, CV_BGR2HSV);
     
    		// Get the selected pixel
    		pixel = cvGet2D(hsv, y, x);
     
    		// Change the value of the tracked color with the color of the selected pixel
    		h = (int)pixel.val[0];
    		s = (int)pixel.val[1];
    		v = (int)pixel.val[2];
     
    		// Release the memory of the hsv image
    		cvReleaseImage(&hsv);
     
    	} 
     
    }
     
    int main() {
     
    	// Image & hsvImage
    	IplImage *hsv;
    	// Video Capture
    	CvCapture *capture;
    	// Key for keyboard event
    	char key;
     
    	// Number of tracked pixels
    	int nbPixels;
    	// Next position of the object we overlay
    	CvPoint objectNextPos;
     
    	// Initialize the video Capture (200 => CV_CAP_V4L2)
    	capture = cvCreateCameraCapture(200);
     
    	// Check if the capture is ok
    	if (!capture) {
    		printf("Can't initialize the video capture.\n");
    		return -1;
    	}
     
    	// Create the windows
    	cvNamedWindow("Color Tracking", CV_WINDOW_AUTOSIZE);
    	cvNamedWindow("Mask", CV_WINDOW_AUTOSIZE);
    	cvMoveWindow("Color Tracking", 0, 100);
    	cvMoveWindow("Mask", 650, 100);
     
    	// Mouse event to select the tracked color on the original image
    	cvSetMouseCallback("Color Tracking", getObjectColor);
     
    	// While we don't want to quit
    	key = 'a';
    	while (key != 'Q' && key != 'q') {
     
    		// We get the current image
    		image = cvQueryFrame(capture);
     
    		// If there is no image, we exit the loop
    		if (!image)
    			continue;
     
    		objectNextPos = binarisation(image, &nbPixels);
    		addObjectToVideo(image, objectNextPos, nbPixels);
     
    		// We wait 10 ms
    		key = cvWaitKey(10);
     
    		printf("\r \n Tracking Color");
    	}
     
    	// Destroy the windows we have created
    	cvDestroyWindow("Color Tracking");
    	cvDestroyWindow("Mask");
     
    	// Destroy the capture
    	cvReleaseCapture(&capture);
     
    	return 0;
     
    }
    Comment joindre les 2 dans un mêmes code pour avoir l'effet voulu (détection de la couleur, puis détection de mouvement uniquement pour cette couleur) ?

    Merci beaucoup !!

  8. #8
    Membre éclairé
    Homme Profil pro
    Computer Vision engineer
    Inscrit en
    Mars 2012
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Computer Vision engineer
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Mars 2012
    Messages : 65
    Par défaut
    Le tracking color à lui seul ne suffit pas?
    Essaie de faire un premier test uniquement avec le deuxième code sur un scénario simpliste,puis sur des scénarios réels et regarde la qualité du tracking .

  9. #9
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2015
    Messages : 5
    Par défaut
    Non, car il peut y avoir des objets dans la même nuance de gris que la fumée qui sont immobiles.
    Il faudrait aussi que une fois la détection d'une nuance de gris en mouvement faite, le programme génère un cadre et une notification (sous forme de mail c'est surement le plus simple, non ? ).

    Merci

  10. #10
    Membre éclairé
    Homme Profil pro
    Computer Vision engineer
    Inscrit en
    Mars 2012
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Computer Vision engineer
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Mars 2012
    Messages : 65
    Par défaut
    Bon, okay ! pour continuer dans l'optique de simplicité, pourquoi pas un process du genre:
    1- Motion tracking -> roi_1
    2- Color tracking -> roi_2
    3- Score(roi_1,roi_2)
    Je m'explique, le tracking de mouvement te renvoie une zone spatiale (roi_1) ainsi que le tracking couleur (roi_2), Tu définies une fonction de score basée sur une corrélation spatiale ( genre si les deux zones roi_1 et roi_2 sont relativement proches) qui validera la présence de la fumée..!

Discussions similaires

  1. Nuances de couleurs des points d'une courbe matplotlib
    Par zeddiccus dans le forum Programmation multimédia/Jeux
    Réponses: 5
    Dernier message: 16/07/2015, 13h38
  2. Réponses: 1
    Dernier message: 30/12/2005, 17h14
  3. [MFC] Utilisation d'une palette de couleur
    Par Kevgeii dans le forum MFC
    Réponses: 2
    Dernier message: 01/06/2005, 17h35
  4. [C#] Comment mettre une ligne en couleur dans mon DataGrid ?
    Par vandeyy dans le forum Windows Forms
    Réponses: 7
    Dernier message: 19/07/2004, 10h03
  5. Suivre une redirection
    Par severine dans le forum Modules
    Réponses: 2
    Dernier message: 07/04/2004, 11h10

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