reading and Image and classifying This using KNN stages

4 ビュー (過去 30 日間)
Matpar
Matpar 2019 年 9 月 26 日
コメント済み: Matpar 2019 年 10 月 2 日
Hi Professionals,
I would love it very much if someone can guide me on the processes of reading a single image and classifying objects on it
using KNN in matlab!
I am not sure of the processes or the where to start hence I am requesting assistance kindly!
Please note I have no code nor the understanding of the stages or the steps that is required to use KNN.
My first step
step 1 read the image into matlab
Step 2 "I am not sure what to do next (Googling the life out of Google! Still Confused)"
please guide me!
Let me thank you in advance for acknowledging me and my request, I appreacite this loads on my quest to learn!
Thank you loads!
  3 件のコメント
Matpar
Matpar 2019 年 9 月 26 日
Hi KA! Thanks for responding! So i went over to the e.g. but it's in python! Is there a method available in matlab!
I really got the gist of the variations between K means and knn
Thanks
Matpar
Matpar 2019 年 9 月 27 日
Can KNN be done for a single image? if yes, what is the steps to do this in MATLAB?
Thank you for acknowledging me and responding in advance!!

サインインしてコメントする。

採用された回答

Dheeraj Singh
Dheeraj Singh 2019 年 9 月 30 日
編集済み: Dheeraj Singh 2019 年 9 月 30 日
To answer your question first we need to understand what KNN is and how it works.
KNN stands for K-nearest neighbors, which is a classification technique.
  • Given a sample of images and their classes already known,
  • We can take an image as input and find the k-nearest neighbors to the input image
  • The k-nearest neighbors are found out based on a ‘distance’ metric which can be changed depending upon the data.
  • k can also be changed
  • Now depending upon the k-nearest neighbors, we classify the input image.
Now to answer your question: Can KNN be done for a single image
Yes, we can use KNN for a single image if we already have the dataset of sample images for different classes.
If we only have one image and nothing else, then we cannot use KNN.
Please go through the documentation of knn to know more.
  6 件のコメント
Dheeraj Singh
Dheeraj Singh 2019 年 10 月 1 日
Ok...so you want to classify pixels into Background and Foreground.
In this case you can apply KNN on a single image...
Here individual pixels are your data or sample points.
So, when i said you cannot apply knn just on a single image i meant if you are taking an image as one data sample.
But here image is not a data point, the pixels are the data points.
You are selecting an a region of interest for Background and Foreground.
The pixels in the respective regions are your sample points for their respective classes.
Hope this clears your doubt.
Matpar
Matpar 2019 年 10 月 2 日
yes DS,
that's what my goal is, do you know of an easier way to get this done?
if so please enlighten me for the knowledge!!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by