Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 373303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:17:42+00:00 2026-05-12T14:17:42+00:00

I have an intensity/greyscale image, and I have chosen a pixel inside this image.

  • 0

I have an intensity/greyscale image, and I have chosen a pixel inside this image. I want to send vectors starting from this pixel in all directions/angles, and I want to sum all the intensities of the pixels touching one vector, for all vectors.

After this step I would like to plot a histogram with the intensities on one axis and the angle on the other axis. I think I can do this last step on my own, but I don’t know how to create these vectors inside my greyscale image and how to get the coordinates of the pixels a vector touches.

I previously did this in C++, which required a lot of code. I am sure this can be done with less effort in MATLAB, but I am quite new to MATLAB, so any help would be appreciated, since I haven’t found anything helpful in the documentation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:17:42+00:00Added an answer on May 12, 2026 at 2:17 pm

    It might not be the best way to solve it, but you can do it using a bit of algebra, heres how…
    We know the Point-Slope formula of a line passing through point (a,b) with angle theta is:

    y = tan(theta) * (x-a) + b
    

    Therefore a simple idea is to compute the intersection of this line with y=const for all const, and read the intensity values at the intersection. You would repeat this for all angles…
    A sample code to illustrate the concept:

    %% input
    point = [128 128];               % pixel location
    I = imread('cameraman.tif');     % sample grayscale image
    
    %% calculations
    [r c] = size(I);
    angles = linspace(0, 2*pi, 4) + rand;
    angles(end) = [];
    clr = lines( length(angles) );   % get some colors
    
    figure(1), imshow(I), hold on
    figure(2), hold on
    
    for i=1:length(angles)
        % line equation
        f = @(x) tan(angles(i))*(x-point(1)) + point(2);
    
        % get intensities along line
        x = 1:c;
        y = round(f(x));
        idx = ( y<1 | y>r );        % indices of outside intersections
        vals = diag(I(x(~idx), y(~idx)));
    
        figure(1), plot(x, y, 'Color', clr(i,:))    % plot line
        figure(2), plot(vals, 'Color', clr(i,:))    % plot profile
    end
    hold off
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this matrix A, representing similarities of pixel intensities of an image. For
I have an UInt16[1000,1000] array of 10-bit intensity values which I want shifted from
i have found this formula and its description on a site l(x,y)=(l(x,y)-min)(no of intensity
I have a grayscale image from a photograph. I've determined that certain parts of
I have an image with uniform intensity everywhere with gray value = 100 then
How do I convert image to grayscale? I have the following quote from the
I have some code from the net reading hyperspectral data (image, so lots of
This is the information i have for computing light intensity (color) phong shading: Have
I have created a BYTE array containing a image pixel data. Image is grayscale
I have made an Intensity meter in a pictureBox. For making this intensity meter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.