video processing( find white pixel in binary image)

currently my project is video processing and my problem is im trying to find white pixel of every row[[5X5] in the region of interest(ROI) that i assigned in my binary images.so that i can know if there is a pixel detected in that row. if it detected = 1, if not = 0.
can anyone help me please :(

 Respuesta aceptada

Thorsten
Thorsten el 23 de Nov. de 2015
Sample data:
X = rand(5)>0.8;
Check if any pixel is 1
if any(X(:))
% do something
end

6 comentarios

Ariff pasha
Ariff pasha el 23 de Nov. de 2015
thanks thorsten.no 5 represent of 5 row isn't it?but can i know why the value is 0.8?
Thorsten
Thorsten el 23 de Nov. de 2015
This is just sample data. 5 creates a 5x5 matrix, as you mentioned. I used 0.8 to have some rows in X contaning only zeros, before I realized that probably when you talk about "row" in your question, you refer to the full 5x5 matrix. Or not?
Ariff pasha
Ariff pasha el 23 de Nov. de 2015
ROI_2=imcrop(SKELETON1,[411.5 68.5 27 111]);
sorry my bad. my problem is from the ROI i want to detect if there is a pixel exist in each columns(5columns in ROI). if each column detct the white pixel is = 1 even there is 1 white pixel as long as white pixel exist in that column. so i assume if all the column detect all white pixel[1 1 1 1 1] in it i will consider it as 100%.
Use
all(any(ROI))
Ariff pasha
Ariff pasha el 24 de Nov. de 2015
tq :))
Ariff pasha
Ariff pasha el 27 de Nov. de 2015
hi thorsten. now i want to find accuracy(100%).for example my roi size is 241x77.if all columns(77) detect 1 instead of 0 then i say its 100%. so i use yy= find(ROI_2(:,end)==1) to know which column has 1.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 23 de Nov. de 2015

Comentada:

el 27 de Nov. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by