How to find row and column of a pixel in an Image?

39 views (last 30 days)
Guys I want to find the rows and columns of pixels of image so that i can put that in if condition inside for loop. Bt i am unable to write that code. plz help me.
  3 Comments
Image Analyst
Image Analyst on 23 Apr 2016
Radha r, Start your own question and post your image and explain what "good" and "bad" means to you.

Sign in to comment.

Accepted Answer

Wolfgang Schwanghart
Wolfgang Schwanghart on 21 Mar 2011
Hi, what about this:
[ROWS,COLUMNS] = ndgrid(1:size(I,1),1:size(I,2));
ROWS = ROWS(:);
COLUMNS = COLUMNS(:);
where I is your image.
Best regards, Wolfgang
  1 Comment
Radha r
Radha r on 23 Apr 2016
but how do find good and bad pixel in image

Sign in to comment.

More Answers (3)

Karan Ratnaparkhi
Karan Ratnaparkhi on 21 Mar 2011
Hi wolfgang I have an algorithm in which i am given a range of rows n columns lets say a to b (for rows) and c to d (for columns). now I hav to do operation only on those pixels which lie (whose rows n cols lie) in between a to b and c to d. Thats y i want to know how to get the row and column of given pixel (not the value of pixel.) Plz help me with this code.
  2 Comments

Sign in to comment.


Syed Ali Hassan
Syed Ali Hassan on 22 Feb 2014
Check this [row_limit,col_limit]=size(img);
  3 Comments

Sign in to comment.


Radha r
Radha r on 23 Apr 2016
it is not find the t my answer and what are you telling me i ont now please tell me example
  1 Comment
Image Analyst
Image Analyst on 23 Apr 2016
Radha r, Start your own question and post your image and explain what "good" and "bad" means to you.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by