Azzera filtri
Azzera filtri

How to convert the digit image into (3*2) blocks where I can check vertical and horizontal edges ? Actually, I need to check if vertical or horizontal edges exists in each block? If exists I need to return binary value 1.

1 visualizzazione (ultimi 30 giorni)
The sample digit image is attached.

Risposta accettata

KSSV
KSSV il 8 Ott 2018
A = imread('image 2.png') ;
m = 3 ; n = 2 ;
[nx,ny] = size(A) ;
if mod(nx,3)
nx = nx+(3-mod(nx,3)) ;
end
if mod(ny,2)
ny = ny+(2-mod(ny,2)) ;
end
A = imresize(A,[nx ny]) ;
l = size (A) ./ [m n];
T = mat2cell (A, repmat (m, l(1), 1), repmat (n, l (2), 1))
  1 Commento
Sudipto Chaki
Sudipto Chaki il 8 Ott 2018
Modificato: Sudipto Chaki il 8 Ott 2018
Suppose, I resized the digit image into (64*64). Then I need to convert it into (3*2), total 6 blocks. Then I need to check whether there is a horizontal or vertical edge in each block?

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by