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 8375151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:05:59+00:00 2026-06-09T15:05:59+00:00

Instead of scanning the pixels row by row , I am trying to scan

  • 0

Instead of scanning the pixels row by row ,
I am trying to scan the pixels from the origin or any arbitrary point in the image at an angle say 10′ ,then incrementing angle in steps of 10′ upto 360′ ,i want to access the pixels falling in the line at each angle and do some processing..

pls help me out with how to access pixel values lying at a particular angle from the origin or any point in the image.

  • 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-06-09T15:06:01+00:00Added an answer on June 9, 2026 at 3:06 pm

    You can do something like this (you didn’t specify language, this is in java):

    bool[][] processedPixels = new bool[width][height]; // To avoid processing the same pixel twice
    
    for(int deg = 0; deg < 360; deg+=10)
    {
        double angle = Math.toRadians(deg);
        for(int r = 0; r < maxRadius; r++)
        {
            int x = originX + (int) Math.round(r * Math.cos(angle));
                int y = originY + (int) Math.round(r * Math.sin(angle));
    
            if(!processedPixels[x][y])
            {       
                processPixel(x,y);
                processedPixels[x][y] = true;
            }
        }
    }
    

    In C, it would be almost the same, use math.h for the trigonometry and rounding:

    include <math.h>
    #define PI 3.14159 // use the accuracy you need
    #define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * PI)
    
    
    int deg;
    double rad;
    int processedPixels[width][height] = {0};
    
    for(deg = 0; deg < 360; deg+=10)
    {
        int r;
        rad = DEGREES_TO_RADIANS(deg);
        for(r = 0; r < maxRadius; r++)
        {
            int x,y;
            x = originX + (int) round(r * cos(rad));
            y = originY + (int) round(r * sin(rad);
    
            if(processedPixels[x][y] == 0)
            {       
                processPixel(x,y);
                processedPixels[x][y] = 1;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update for the impatient: it's simple, use package.- for sub-package scanning instead of package.*
Instead of just 1, how can I pick the 4 highest values from an
I am trying to use jibx-maven plugin 1.2.3 for generating Java Source Code from
I'm trying to setup Ninject on my new project and I want to scan
Instead of absolutely positioning (I have to do that, don't ask why) elements over
Instead of prefixing id's in xml, is it possible to specify the particular layout
Instead of stepping when the user clicks somewhere on the qslider I want to
Instead of having to type tmux every time, how could I have tmux always
Instead of having nested callbacks in JS, I would like to fire and listen
Instead of scaling, which I think pinch gesture is usually used for, I am

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.