how can i detect object using knn ?
Show older comments
i'm new to the maching learning..now i am working on my project which is building detection using image processing. i should apply knn and divide it in training and testing data set.. but in practically how to procced that's what i am not getting .please help me through this... please send steps.
Answers (1)
Image Analyst
on 2 Jan 2020
Edited: Image Analyst
on 2 Jan 2020
0 votes
For what it's worth, attached is a KNN demo, though for (x,y) points, not for an image.
For image processing, you need to decide upon what features you're going to use. What are you going to cluster on? What values are your reference set?
10 Comments
lok blb
on 2 Jan 2020
Image Analyst
on 2 Jan 2020
“If I had an hour to solve a problem I’d spend 55 minutes thinking about the problem and five minutes thinking about solutions.”
If you don't know what you want to do with, or to, the image, then I certainly don't. Your question is far too vague for anyone to answer. See this link.
lok blb
on 2 Jan 2020
Image Analyst
on 2 Jan 2020
Do you mean how to segment buildings from aerial or satellite photos? If so, see Vision Bibliography
22 Remote Sensing, Cartography, Aerial Images, Buildings, Roads, Terrain, ATR
- 22.4.1 Buildings from Depth Data, LiDAR Data
- 22.4.1.1 Buildings DSM, DEM, Elevation, Surface Models
- 22.4.1.2 Buildings from SAR, InSAR, ISAR Data
- 22.4.2 Roof Structure, 3-D
- 22.4.2.1 Solar Energy Analysis, Buildings, Roofs
- 22.4.2.2 Energy Usage, Energy Efficiency, Buildings, Roofs
- 22.4.3 Buildings from Oblique Images
- 22.4.4 Buildings from Single Image, Shape Analysis, Color, Shadows
- 22.4.5 Building Facades, Ground Level Images
- 22.4.5.1 Building Windows, Facade Window Models
- 22.4.5.2 Building Interiors, Walls, Indoor Models
- 22.4.6 Interactive Building Extraction and Modelling Systems
lok blb
on 3 Jan 2020
Walter Roberson
on 3 Jan 2020
Okay, so which particular mathematical way are you using?
Image Analyst
on 3 Jan 2020
Yes, exactly what mathematical way. You said you know it, so what is it? And don't just say it's KNN because that's not sufficient. That's almost worthless. You might just as well say that you know how to do it because your know the method is "image segmentation", but that's so vague that it's totally worthless.
You DO know that KNN requires a list of features or attributes for each class don't you? So what are your features? What did you measure?
We don't have building segmentation function in MATLAB so you're going to have to write some code which means you'll probably have to read several of those papers (none of which we have code for) and see which seems promising for images like yours, and then code it up. If you don't know how, the Mathworks would be very happy to write it for you.
As for Walter and me, we can't develop the code for you. We'll help with small parts of your own code, or maybe contribute something original if it takes us just 5 or 10 minutes, but a project like you want would take many days, weeks or even longer. I'm sure Ph.D. dissertations have been written on the subject. Good luck though. It is possible since we see so many people have already done it and published it.
Walter Roberson
on 3 Jan 2020
Edited: Walter Roberson
on 3 Jan 2020
Well, you can do k-means clustering based upon RGB values, but techniques like that get thrown off by trivial detdetailsdetails like advertisement signs.
lok blb
on 3 Jan 2020
Image Analyst
on 10 Feb 2020
For what it's worth (very little since kmeans is usually lousy, or at least not the best method, for intensity segmentation), I'm attaching my demo on using kmeans to do color segmentation.
Categories
Find more on Nearest Neighbors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!