how to fix particular connected component in multiple frames
Mostrar comentarios más antiguos
hi everyone.
i have binary image consisting of 8 to 10 connected components. actually i want to check weather the center of these 8 to 10 connnected component is changing postion in next frame or not but for that first i have to fix/label the connected components in all frames for making sure that the connected component in first frame was the same as in the next frame (like tracking but not propere tracking because i just want to find change in position of multiple connected compnents in multiiple frames).
How i can fix the particular connected components in multiple frames. eiather by assinging ID or label them but dont know how to code that in matlab. so because of begginer in matlab i need someone's help in codding.
thanx in advance
14 comentarios
Rik
el 22 de Ag. de 2020
Have a read here and here. It will greatly improve your chances of getting an answer. Flagging is meant to attract attention from site admins (or users with high reputation, who also have some editing privileges).
What I tend to do is label the areas on one frame (e.g. with bwlabel). For the next frame I use the component as a mask on the previous frame and extract the most common value (making sure it isn't 0) and set that as the label for the second frame.
QuestionsAccount
el 22 de Ag. de 2020
Walter Roberson
el 22 de Ag. de 2020
If you feel that your question is unclear then as the person who asked the question, you should clarify the question instead of flagging it.
Rik
el 22 de Ag. de 2020
I outlined an idea. Have you tried it? Can you share an example file and the code you tried to solve it with?
QuestionsAccount
el 23 de Ag. de 2020
jonas
el 23 de Ag. de 2020
If you are looking for actual code then you should include a second image (or more) where the blobs have changed position. They appear to be people, so I assume both shape and position are variable.
I wrote something similar for my own project last night using Rik's idea and it worked well. Loop over components from binary image t+1 and use as masks on labeled image t. The most common value (other than zero) is then assigned as label to labeled image t+1. Don't know how to deal with components merging yet..
QuestionsAccount
el 23 de Ag. de 2020
Rik
el 23 de Ag. de 2020
Is this really the time resolution? Those two frames are very far apart. It will be very difficult to match the blobs, and my idea will not work.
jonas
el 23 de Ag. de 2020
- That sounds exactly like what Rik described
- Are those two consecutive images? Because the objects have moved so far that some are not even overlapping..
- Please upload the actual files and not screenshots
Image Analyst
el 23 de Ag. de 2020
I don't know why you say "like tracking but not propere tracking". It certainly is tracking. And it is inherently an ambiguous task if the objects move very far from one frame to another, plus change shape (people turning or in different phases of stepping). Let's say you had 10 blobs at random locations in an image, like a shotgun blast. Now let's say you have 15 blobs at entirely different locations with different shapes in the next image. Can you tell which are new, and which just moved and changed shape while moving? No, or at least not reliably. I think you need to increase your frame rate so things don't move so much and don't change shape so much. Then you at least have a fighting chance.
QuestionsAccount
el 23 de Ag. de 2020
jonas
el 23 de Ag. de 2020
If you post actual images and not screenshot then people are more likely to write code for you... I dont want to crop your desktop and binarize before even getting started.
QuestionsAccount
el 25 de Ag. de 2020
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 23 de Ag. de 2020
0 votos
The Computer Vision Toolbox has lots of tracking capabilities:
It could save you a lot of time if you bought that toolbox. Do you already have it? If not, buy it.
Image Analyst
el 23 de Ag. de 2020
0 votos
See Mathworks ball tracking demo: https://www.mathworks.com/matlabcentral/fileexchange/39851-algorithm-development-with-matlab?s_tid=prof_contriblnk
6 comentarios
QuestionsAccount
el 23 de Ag. de 2020
Image Analyst
el 23 de Ag. de 2020
Sorry I can't. Because that would be tracking and you are steadfastly and adamantly against tracking. So you're stuck with whatever default ID label the connected components algorithm assigns. We can't change the ID labels to what they were on a prior frame because that's a tracking process and you won't allow tracking. Good luck though.
QuestionsAccount
el 24 de Ag. de 2020
Rik
el 24 de Ag. de 2020
No. This is tracking. You can claim it isn't, and your end goal might not be actually to track something, but that is what is required to achieve what you describe.
Why don't you try it instead of ignoring his advice? Image Analyst has probably forgotten more about image analysis with Matlab than I have learned. You're getting free help from an expert, you would do well not to ignore it.
Image Analyst
el 24 de Ag. de 2020
You'd have to make a list of features of all the blobs. Then I'd be tempted to try K-Nearest Neighbors, knnsearch() to match blobs from one feature set to the prior feature set. Sorry, I don't have a demo for this already. But it's simple so you can try it yourself easily I'd think. You need the Statistics and Machine Learning Toolbox to use that function. However it will match each blob in set 2 with a blob in set 1 regardless if it's correct or not. I mean the blob in set 1 might have left the scene and the blob in set 2 may have just entered the scene but it will say that some blob in set 1 matches the blob in set 2. In that case, perhaps (but maybe not) some blob in set 1 may have two blobs that match it in set 2. Or it may have none. So you'll need to inspect the number of matches and if there are zero, or two or more, you're going to have to make some decisions about what to do. But if all goes well and you have the same blobs in both sets (none left and none entered), and the features didn't change much from set 1 to set 2, then each blob will have exactly one matching blob in the other set.
Image Analyst
el 25 de Ag. de 2020
You may want to watch this webinar tomorrow:
Join us for the fourth of seven bi-weekly free seminars focusing on the best paper research presented at EI 2020. Talks will be followed by live discussion: seminars will be recorded.*
Best Paper Imaging and Multimedia Analytics in a Web and Mobile World 2020 Conference
Bryan Blakeslee & Andreas Savakis (Rochester Institute of Technology)
Change detection in image pairs has traditionally been a binary process, reporting either "Change" or "No Change." In this paper, we present LambdaNet, a novel deep architecture for performing pixel-level directional change detection based on a four-class classification scheme. LambdaNet successfully incorporates the notion of "directional change" and identifies differences between two images as "Additive Change" when a new object appears, "Subtractive Change" when an object is removed, "Exchange" when different objects are present in the same location, and "No Change".
About the Speaker
Bryan Blakeslee is a recent graduate of the Rochester Institute of Technology’s computer engineering program. His areas of interest are deep learning and embedded systems.
Join us on Wednesday, 26 August 2020
10:00 - 10:45 EDT / 15:00 - 15:45 BST / 16:00 - 16:45 CET
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!