opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.39k stars 5.76k forks source link

Is it possible to get the coordinates of color checkers detected by the mcc module? #3234

Open SiciliaLeco opened 2 years ago

SiciliaLeco commented 2 years ago
System information (version)
Detailed description
Steps to reproduce
Issue submission checklist

Hi, I'm currently working on a color checker detection project and I've built & run this git repo to detect color checkers in images. my code:

im_path = r"my_path"
im = cv2.imread(im_path)
detector = cv2.mcc_CCheckerDetector()
cchecker_detector = detector.create()
val = cchecker_detector.process(im, 0, nc=24)
if(val):
  vec = cchecker_detector.getListColorChecker()
  rbg = vec.getChartsRGB()

I know the format of variable rbg and I could retrieve RGB information of each color chart from it. But now I need to find the coordinates of these color charts (i.e, the x and y value of each color box) Are there any possible solutions or methods in opencv to handle this? Thank you much in advance!

EaaloZ commented 7 months ago

you can use vec.getBox() to aquire the coordinates of the entire color card