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

Thread Subject:
integrat image slices

Subject: integrat image slices

From: Anders

Date: 25 May, 2009 13:34:22

Message: 1 of 1

I have an image which i want to cut in n slices and integrate them. I've done it like this, but can someone help me create a vectorized solution without looping through every pixel one by one?

sum = zeros(64,1);

for x=1:size(image,1)
  for y=1:size(image,2)
      [theta,rho] = cart2pol(x-center(1),y-center(2));
      slice = ceil(theta * slices / (2*pi)+slices/2)
      sum(slice) = sum(slice) + image(x,y);
  end
end

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us