changing the colour of the bounding boxes in darknet - bounding-box

I want to change the colour of the bounding boxes in darknet in such a way that it should be red if the accuracy of the detected image is more than 80 otherwise red. I'm using darknet in googlecolab.is it possible? If so please provide me the code for it

Related

how to segment a binary image to get bounding boxes

my input image:
I want get bounding box for each object:
the input image is a binary image which segmented with cnn(salient object detection,but the black areas sticked to each other,I want to seperate them to get the bounding box for each box。
the original image:
with salient object detection and post-processing we get:
but I want this:
ps:I don't want approaches like yolo/SSD which need to train with custom dataset

How to filter image to throw away stray pixels?

I have image data that comprises mostly roundish images surrounded by boring black background. I am handling this by grabbing the bounding box using PIL's getbbox(), and then cropping. This gives me some satisfaction, but tiny specks of grey within the sea of boring black cause getbbox() to return bounding boxes that are too large.
A deliberately generated problematic image is attached; note the single dark-grey pixel in the lower right. I have also included a more typical "real world" image.
Generated problematic image
Real-world image
I have done some faffing around with UnsharpMask and SHARP and BLUR filters in the PIL ImageFilter module with no success.
I want to throw out those stray gray pixels and get a nice bounding box, but without hosing my image data.
You want to run a median filter on a copy of your image to get the bounding box, then apply that bounding box to your original, unblurred image. So:
copy your original image
apply a median blur filter to the copy - probably 5x5 depending on the size of the speck
get bounding box
apply bounding box to your original image.
Here is some code to get you started:
#!/usr/local/bin/python3
import numpy as np
from PIL import Image, ImageFilter
# Load image
im = Image.open('eye.png').convert('L')
orig = im.copy() # Save original
# Threshold to make black and white
thr = im.point(lambda p: p > 128 and 255)
# Following line is just for debug
thr.save('result-1.png')
# Median filter to remove noise
fil = thr.filter(ImageFilter.MedianFilter(3))
# Following line is just for debug
fil.save('result-2.png')
# Get bounding box from filtered image
bbox = fil.getbbox()
# Apply bounding box to original image and save
result = orig.crop(bbox)
result.save('result.png')

What color feature is important for white-like tones?

I am building an image segmentation model using SVM as a pixel-wise classifier. I am segmentating pressure ulcers. They have different kind of tissues inside. I want to get the region of the ulcer. I have features like RGB intensities, red, green and blue chromatocities. A type of tissue inside the ulcer has white like colors, but most of the ulcer is reddish. I am getting correct results for the reddish colors but not the whites.
Can anyone point me a feature or set of features that can captures white textures or white color information to include in the feature vector?
Thanks in advance...

Chromatic filter openCV

I'm looking for a filter in openCV library that change the image chromatically. For example, the blur does not change the colors of the image, I need one that do it.
I got a colored image, I need to apply a filter that distorts the color. For example, if I have an image with a lot of blue, with this filter this blue will be less or more intensity.
My images are in L* a* b* colour space and I need to work in it.

Calculate area of a shape in ImageJ when there's a bounding box

I want to calculate the blue area in the below image. It's not clear here but there's a white bounding box surrounding the image so I'd like to be able to remove the white area or take it into account somehow.
Maybe I didn't unsderstand your "white bounding box problem", but if you want to compute the blue area, it's fairly easy. Convert the image to grayscale, blue has a distinctive gray value than black or white (obviously) then just run "Measure" on the thresholded area.
run("8-bit");
// or Auto threshold or....
setThreshold(97, 172);
run("Measure");
area=getResult("Area")
print(area)

Resources