selecting area on a image and Tracking the same area in the next subsequent images automatically

I have 12 images in the folder, i want to select area (Basically i want to mark a region and see where those pixels are going in the next subsequent images,We do call ROI) on the first image, this same area to be tracked in the nest subsquent images (These remaining images moves upwards as image number increases ).
How can i do it. Please any one guide me to do this task.
Below images are for your reference (how i wanted to).
As you can see in the image1 marked region, pixels in the image1. Now see the last image marked region is there itself (marked region fixed) but pixels in last image is moved upwards(color portion moved upwards (colour might be different )).
Any leads will be much appriciated.
Thanks in adavance

 Accepted Answer

Ok, the first part of this problem is rather simple, if I understand correctly, you want to select a region of interest in one image and then have the same region in subsequent images. Say your image is
a = randn(200,60);
imagesc(a);
Then you can select a region, say that your area of interest is (20:90,20:30)
so define these as the rows and columns
rows=20:90; columns=20:30;
ROI = a(rows,columns);
imagesc (ROI)
now you only need to do the same to all your images.
Now the second part may not be so trivial depending on what you mean by "tracking". But hope this helps you get started.

5 Comments

@Constantino Carlos Reyes-Aldasoro, Thank you so much for your initiative. I appriciate that
Yes, you are right we are on the same page. as i said in the question, the next subsequent images are moving up ( We are doing some tensile test on a material in other words i can simply say that we are strecting the material and capturing images of material, in that sence some portion of image is moving up) here we want to see to where that some is going.
Note : Please have a look at attached images in the question if possible
Hope you understand
Harish
Hello
To select a particular region of your image, you can use roipoly (https://uk.mathworks.com/help/images/ref/roipoly.html).
>>the next subsequent images are moving up
do you mean that the region of interest is moving up? Or that somehow your data is moving up within the ROI? If it is the first, you could do some correlation to detect the movement and then track the change and move the ROI upwards. If it is the first, then selecting the ROIs and comparing between them with some technique, like optical flow as suggested could be done.
Thanks for your response.
yes my data in the ROI is moving up.
OK, so select one ROI in the first frame with roipoly(), then run a cross correlation as suggested by Image Analyst, that will give you the movement of the ROI (assuming that the ROI is moving and not deforming or changing significantly) and then you can locate the new position of the ROI.

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!