changing bounding box color in object detection - computer-vision

Is there a way to make the bounding box color matches the detected object color.
Say I'm doing car detection using YOLO, and we want for the bounding box color to match the detected car, per say.
Thanks in advance.
I'm using YOLOv4.

Related

How can I ignore small imperfections in, mostly rectangular, contour when creating it's bounding rectangle?

I am using this image as an example:
What I want, is to identify a bounding rectangle that's close to the original rectangle part, ignoring most of the imperfections outside of it.
What I get right now is this (contour and bounding rectangle created from that contour):
How can I, more or less, ignore that small area when creating my bounding rectangle, so that it's not included in it?
In other words: what I need is a bounding rectangle that's as close as possible to the original "rectangle part".

How to draw an AABB bounding box in simple c++/opengl?

I don't know how to draw a bounding box around my 3D object using visual C++/Opengl!
I have calculated min and max value of my obj, but now what do I do!?
Update to my above post:
Have figured out how to draw the Bounding box! How can I align it to the axes?
You have to generate a line-mesh (or whatever you want to display) for the bounding box. The vertices should be easy to find when you already have min and max value.

OpenCV: How to detect thick red lines and their contours from the picture provided

What solution you could suggest to detect thick red lines and their contours from the pictures attached? I use OpenCV.
Thank you in advance!
You could threshold the image to remove all the bright white/yellow pixels.
If the position is always approximately the same then the large remaning blob (in the red channel) on the right side of the image is your line.
Use adaptive threshold in red channel to binary the image
then use cvFindContours to fine each Couture.
To be sure that each contour is belong to one on thick lines you want you can use Bounding boxes. use cvMinAreaRect2 to find each contour Bounding box and check there width and height to near to size on red lines if there match there are lines if else there are noise.

Extracting an object from a low contrast background

I need to extract an object from an image where the background is almost flat...
Consider for example a book over a big white desktop.. I need to get the coordinates of the 4 corners of the book to extract a ROI.
Which technique using OpenCV would you suggest? I was thinking to use k Means but I can't know the color of the background a priori (also the colors inside the object can be vary)
If your background is really low contrast, why not try a flood fill from the image borders, then you can obtain bounding box or bounding rect afterwards.
Another option is to apply Hough transform and take intersection of most outer lines as corners. This is, if your object is rectangular.

OpenCV bounding box and scale

I must to put a bounding box on an object in a jpg file and scale it to a given width and length.
Is this possible?
How can I do it?