How to Extract Horizontal and Vertical pixels from color images?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Selva Karna
le 27 Déc 2017
Commenté : Selva Karna
le 30 Déc 2017
How to Extract Horizontal and Vertical pixels from color images?
Réponse acceptée
Sammit Jain
le 27 Déc 2017
I agree with Rik, the question is kind of unclear, but let's assume the following scenario.
yourImage = imread('yourfilepath.jpg');
%Assuming it's imported as an x by y by z matrix.
yourRegion = yourImage(a:b,c:d,:);
Now these a:b define the rows of your interest, and c:d define the columns, the numbering starts from 1 and goes to x and y respectively for rows and columns. From your question it seems you want a single line of pixels (either vertical or horizontal). So try this:
1. For vertical line:
yourRegion = yourImage(:,columnNo,:);
2. For horizontal line:
yourRegion = yourImage(rowNo,:,:);
Hope this helps.
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!