HELP - Bloodstain Pattern Analysis - Removing denim background in order to analyze bloodstains

I’m a graduate student analyzing a couple of types of blood spatter on clothing. I’m having no issues with analyzing stains with a white background; however, one of my fabrics is dark blue denim jeans, which doesn’t contrast near as well with the blood spatter. Can someone assist me in trying to remove the busy background of the denim?

I just started using ImageJ, so I’m not very experienced. I’ve tried playing around with it for hours, and I can’t seem to get it just right. Converting to binary still includes too much of the background. Again, I just want to analyze the bloodstains, nothing else. I figured there is a way to do this, I’m just not aware of it. I’ll attach some sample pictures to show what I’m talking about.

Any help would be awesome.

So… to get you at least started - I would start with Color Threshold (check out this forum thread). You can also have a look at the Trainable Weka Segmentation plugin - it’s very user-friendly and effective for segmentation. That is what I’m assuming you want to do… segment the blood spots - counting, measuring area, etc. ??

Another helpful forum thread might be this one.

Just depends on what you need exactly.

1 Like

Yes I’m wanting to segment the blood spots so I can analyze their area, perimeter, etc.

I’ll be completely honest, I have no idea what the “Trainable Weka Segmentation” plugin is or how to get it. The color threshold I’ve messed with so much and I’m not sure what my goal is?? No matter what I do, I can’t just make the blood spatter only visible.

I’m trying not to go crazy lol

for the Trainable Weka Segmentation - it is a plugin available in the Fiji distribution of ImageJ. If you have Fiji installed - you’ll have this plugin (Plugins -> Segmentation). You can read about how to use it at the link I sent you previously. Basically - it’s a machine-learning tool - so you train it to segment your spots of interest - you can use two classifiers - one to train for your spots and one to train for the background. Then it will do the segmenting for you…

It would be helpful if you could post some raw images on here - so then some of us can actually have a try with your datasets.


Well I don’t have Segmentation under my Plugins tab. I’ve downloaded the Fiji file but it’s zipped and I don’t know which file I’m supposed to install onto ImageJ?

Nevermind, I have figured out. I guess I just had the original ImageJ program

Unzip Fiji into a folder you like and run the executable that you will find inside.

1 Like

Here are the pictures of some of the samples that I have. I just got them today.

If anyone has some free time and wants to toy around to separate the bloodstains from the denim background and is successful, will you please tell me how you did it?

First of all, your image is very big with lots of “emty” space. So first crop your image to the piece of cloth.

If you do a Image-> colour->Split channels, you’ll see that the blood spatters are really contrasty in the blue channel, and almost absent in the red channel. Subtracting red from blue channel improves the contrast further. You can then soften the lines using a FFT bandpass filter (good for reducing regular patterns). A nor mal threshold on the result works reasonably well, however, doing a double (hysteresis) threshold works better. In the analyze->Analyze particles you can filter out small particles and any very elongated shapes.
This is the result I get (cropped).

I’ve done a macro to illustrate things. Ther’s one manual step at the moment to adjust the contrast after the FFT. Adjust the “Minimum” to about “0”, and press OK. This is just a start, but should give you some ideas of the general principles.

selectWindow("blood spatter.JPG");
run("Duplicate...", "title=input");
run("Split Channels");
selectWindow("input (blue)");
selectWindow("input (green)");
selectWindow("input (blue)");
imageCalculator("Subtract create 32-bit", "input (blue)","input (red)");
selectWindow("Result of input (blue)");

run("Bandpass Filter...", "filter_large=150 filter_small=10 suppress=Horizontal tolerance=10 autoscale saturate");
waitForUser("adjust contrast");

run("Duplicate...", "title=seed");
run("Duplicate...", "title=mask");

setThreshold(0, 60);
run("Convert to Mask");

setThreshold(0, 25);
run("Convert to Mask");

run("BinaryReconstruct ", "mask=mask seed=seed create white");
run("Analyze Particles...", "size=50-Infinity circularity=0.20-1.00 display clear add");
selectWindow("blood spatter.JPG");
run("From ROI Manager");

Hope this helps,

Forgot one thing: The hysteresis threshold uses Gabriel Landini’s “Binary Reconstruct” plugin. This can be installed if you enable his update site “Morphology”) in Fiji.


Thank you so much. That works really well! The only issue I’m running into is during the analysis of particles. I set the scale to the millimeter scale within the whole picture before I begin cropping it out, and when I go to Analyze Particles, I’m having a hard time determining what my minimum mm^2 area should be. If I set it too low, it analyzes some of the weaves in the fabric that don’t have bloodstains. If I set it too high, I fear that it is not analyzing all of my bloodstains. Any suggestions?

1 Like

that’ll always be an issue. Pretty much the only way to get a measurement of what you think are blood spots in an image like this is to manually outline them…
Of course if this was me, I’d work on the imaging side of things, there are stains for making blood fluorescent, and those would give a much clearer picture. With what’s basically just a photograph, this is probably the best you can do.

1 Like

I understand. But thank you so much. This really does help a lot.

1 Like