Automatically Cropping Particle Images in a Video File

Hello,
I am new to ImageJ. I have a video file consisting of images of particles and what I would like to do is:

  1. Identify the edges at the bottom (assuming a very clear boundary) - boundary present only at the bottom
  2. Crop the area 100 pixels (in vertical) from above identified boundary coordinates;
  3. Save the cropped part as image sequences;
  4. Save the remaining part of the images as separate image sequences, but by defining the cropped area in (4) as a mask.
    Would it be possible to write such a macro in ImageJ?
    Thank you very much!

Check out the Macro Recorder to easily create macros along those lines.

If you post a sample image here, we can offer more specific suggestions.

Follow the general Segmentation guidelines for how to automate this.

Use the Image :arrow_forward: Crop command (press L for the Command Finder to launch it easily—get the corresponding macro code using the Macro Recorder).

File :arrow_forward: Save As :arrow_forward: Image Sequence…

Not sure I understand this part. It would help if you post an image.

Thank you very much for your quick response. I have uploaded an example image from a video. I would like to identify the edge (solid white lines), get the coordinates of it, crop the area 100 pixels above each position on the edge lines, and save this region of the images as sequences. Then, save the upper part of the images (starting from edge + 100 px) as a separate sequences, but making the region below this completely black (0). Then, I will have image sequences of the same video, each focusing on different ROI.

Since I would like to do this automatically for different videos, I thought that direct usage of crop function can be inaccurate because I need to precisely extract 100 px above the boundary in each video file, whose position/dimensions may vary.