Remove background after getting bounding boxes - computer-vision

I am using YOLOv7 for object detection. After passing a video through the object detector I want a new video which only contains the bounding boxes (no background).
For example, if the video contains a cat the output video should have a white background and a moving box where the cat was detected.
Is there a way to achieve this?

Related

How to track the disappearance of an object (TV logo) from the ROI (logo rect on a frame)?

I have a TV logo image and a rect where the logo is placed on almost all video frames. But there are also frames where the logo completely disappears (at least 10 consecutive seconds of running frames). TV logo is placed only in only one place (ROI = full logo rect) throughout the video, so I don't need to analyze full frame. I tried matchTemplate in ROI using OpenCV, it works, but I don't think this way is good enough. How can I track when there is no logo in this area (ROI) with OpenCV with the exception of template matching?

Paint application Qt

I am trying to create a simple paint application using Qt Creator. I want to have a rectangular area on QDialog in which I can draw an image using mouse. The image format will be QImage::Format_Mono (Black and white, pixel indexes are either 0 or 1). I will use pixel indexes for simple image processing purpose, which operates on simple 1 and 0 pixel values, so Format_Mono is essential.
Now the application does its job, but the image (painting area) is stuck at left top part (positioned at x=0 and y=0). I want to have rectangular image editor part at any x and y coordinates I want.
To create the image editor I defined a QImage in dialog.h
QImage image;
In constructor of the Dialog I have:
image = QImage(ui->label->size(), QImage::Format_Mono);
image.fill(Qt::black);
As you can see in above code, I have a QLabel named label in my user interface. I want to put the image editor part in that label (or do something similar).
I checked the QImage documentation, but could not find a function to change the position of the image. Or, it would also be good if I could find any other way to put the image (image editor) in QLabel.
What can I do to have that feature in my application?
EDIT: The created image editor part has the same size as the label (as it should be the case), but image editor (QImage) starts at x=0 and y=0 only.

MITK Segmentation draw Rectangle

I have to segment a few things in a dataset I have (.nrrd-file) by drawing a rectangle around the area of interest and saving the segments (also as .nrrd-files).
I tried everything in the Segmentation-Tool that comes with MITK but I cannot seem to find a way to draw rectangles. I also tried to do some key combos (like holding shift, ctrl or alt) while drawing but in vain.
I know I can use the Measurement-Tool to select rectangles and save them (as .pf-files), but using that I'd have to write a some code to convert those selected rectangles into rectangle segmentations later on.
Does anyone know whether there's a possibility (that I didnt find yet) to draw rectangles in the Segmentation tool, or some other way so there's no need to write a workaround?
You can use the Image Cropper plugin in MITK 2016.11 for rectangular image masking and cropping (scissors icon).
Open the plugin, select your image in the Data Manager and click on the New button in the plugin to create a bounding object. You can modify the rectangular bounding shape in the render windows by dragging its red handles. You can move the whole shape by hovering over the bounding shape (it will turn green), click, and than drag.
Click on the Mask button if you want to get an image with the same dimensions in which all pixels outside the bounding shape are set to a user defined value (see the Advanced settings in the plugin). Click on the Crop button otherwise.
Note that you can always press F1 in any active MITK plugin to open a help page with detailed instructions.

Is it possible to use OpenCV TemplateMatching with a patch images dimensions or background color only?

I am using OpenCV on iOS to detect a rectangular label to assist users in snapping a photo of that label. I have an overlay that presents once the matches threshold is met.
My question is, does that patch image used have to be exact? The labels I am detecting have text on them that vary from label to label. All the same font but different characters. Is it possible to train OpenCV with a patch images color and/or size/dimensions? Or is there perhaps another way around this issue?
Here is a close example to the labels Im scanning, EXCEPT THERE ARE NO ICONS AND ALL ONE FONT TYPE.
Here is the tutorial I am following, which is achieved with an image of a target. http://www.raywenderlich.com/59999/make-augmented-reality-target-shooter-game-opencv-part-3

How to Place the image at specific location of the Picture Conrol in VC++

I m trying to overlay an image on a live video.The IDE used is Visual Studio Professional 2010. The code is developed in C++.When I try to overlay image on the live video, I m loading the image using a handle i.e.
HANDLE hBitmap;
hBitmap = LoadImage(NULL, L"C:\\Users\\User\\Documents\\Visual Studio 2010\\Projects\\BMP_Image.bmp",IMAGE_BITMAP, 0,0, LR_LOADFROMFILE );
I am using the mechanism of Alpha Blending to overlay the image on to the video. Problem I have encountered is, The image is overlayed five consecutive times on to the video .
I m passing the ID of a picture control, placed on the dialog box in the rc file, to load the live video and display it. I m not using any MFCs in the code. The video is rendered by using Direct 2D mechanism
The video resolution is 640*480 and bitmap image resolution is 128*128. If I take this bitmap , the video will produce five times of overlayed image on to the video..
I got the coordinates of dialog box using GetWindowRect() and ScreentoClient(). But I want the coordinates of the Picture control.
I have following doubts:
How to get the coordinates of the picture control???
How to place the image at specific location in a picture control???
Looking forward for ur positive response as earliest...
Regards,
Vivek
You can use the following function for retreiving the handle of your picture control:
::GetDlgItem( hWnd of your dialog, Id of your picture control)
By retreiving its handle, you can get to other info like its position, size and
::GetWindowRect(hWnd, &rc)
If you overlay the image through some API calls such as StretchBlt, you can place it anywhere you want.