Skip to content

Commit

Permalink
Merge pull request #7 from j-jakubowski/Color_fix
Browse files Browse the repository at this point in the history
Fixed how vehicle color vector is calculated, in src\Graphics.cpp
  • Loading branch information
SudKul authored Mar 23, 2021
2 parents 200aae4 + 0f9937e commit 2259eba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void Graphics::drawTrafficObjects()
cv::RNG rng(it->getID());
int b = rng.uniform(0, 255);
int g = rng.uniform(0, 255);
int r = sqrt(255*255 - g*g - r*r); // ensure that length of color vector is always 255
int r = sqrt(255*255 - g*g - b*b); // ensure that length of color vector is always 255
cv::Scalar vehicleColor = cv::Scalar(b,g,r);
cv::circle(_images.at(1), cv::Point2d(posx, posy), 50, vehicleColor, -1);
}
Expand Down

0 comments on commit 2259eba

Please sign in to comment.