Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How can i do the sampling of a binary image?

Asked by Sbh

Sbh

on 31 Jan 2013

How can i do the sampling of a binary image?

2 Comments

BHAVIN kakani

BHAVIN kakani

on 5 Feb 2013

function sampling(x,step)

plot(x(1:step:end),'-o')

plot(abs(fft(x(1:step:end))))

Image Analyst

Image Analyst

on 5 Feb 2013

Who asked anything about the Fourier transform? Also, an image is usually 2D or 3D, not 1D, though it can be.

Sbh

Sbh

3 Answers

Answer by Jan Simon

Jan Simon

on 31 Jan 2013

It depends on what "sampling" exactly means. Also "binary image" is not defined, so please post the inputs, the definition of the calculations and an example for the wanted outputs.

0 Comments

Jan Simon

Jan Simon

Answer by Image Analyst

Image Analyst

on 31 Jan 2013

Here's a way:

subsampledImage = binaryImage(1:2:end, 1:8:end);

How's that? It does exactly what you asked. It you want something more specific, you should explain further.

0 Comments

Image Analyst

Image Analyst

Answer by BHAVIN kakani

BHAVIN kakani

on 5 Feb 2013

function sampling(x,step)

plot(x(1:step:end),'-o')

plot(abs(fft(x(1:step:end))))

It may help you out......If don't then do contact me with further details.

0 Comments

BHAVIN kakani

BHAVIN kakani

Contact us