ajouts des masques IDCARD, NumberIDCARD, NAMESMASK
This commit is contained in:
34
Objects.cpp
Normal file
34
Objects.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Created by yann on 05/10/2025.
|
||||
//
|
||||
|
||||
#include "Objects.h"
|
||||
|
||||
// Constructeur avec trois paramètres (2 Points et une couleur)
|
||||
|
||||
Objects::Objects(cv::Point top_left, cv::Point bottom_right, cv::Scalar color)
|
||||
: top_left(top_left), bottom_right(bottom_right), color(color) {}
|
||||
|
||||
// Méthode pour dessiner un carré noir sur l'image
|
||||
void Objects::draw(cv::Mat &image) {
|
||||
// Dessiner un rectangle noir (avec -1 pour remplir le carré)
|
||||
cv::rectangle(image, top_left, bottom_right, cv::Scalar(0), -1); // -1 signifie remplir le rectangle
|
||||
}
|
||||
|
||||
// Getters pour les coordonnées du carré
|
||||
cv::Point Objects::getTopLeft() const {
|
||||
return top_left;
|
||||
}
|
||||
|
||||
cv::Point Objects::getBottomRight() const {
|
||||
return bottom_right;
|
||||
}
|
||||
|
||||
// Setters pour les coordonnées du carré
|
||||
void Objects::setTopLeft(cv::Point p) {
|
||||
top_left = p;
|
||||
}
|
||||
|
||||
void Objects::setBottomRight(cv::Point p) {
|
||||
bottom_right = p;
|
||||
}
|
||||
Reference in New Issue
Block a user