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

  • Home
  • SEARCH
  • 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 7025607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:59:48+00:00 2026-05-27T23:59:48+00:00

I have a binary image as in figure below, the x-y co-ordinate system is

  • 0

I have a binary image as in figure below,

enter image description here

the x-y co-ordinate system is the default co-ordinate system that comes with MATLAB. I am able to get the sum of pixels across each row and column in x-y co-ordinate system.

But I want the sum of pixels by stepping through u-v co-ordinate system. How can i get it?

My idea is to

1) Convert the x-y co-ordinate system to a continuous (real valued) co-ordinate system
2) Find the points in x-y coordinates corresponding to each point in u-v co-ordinate system. like (1,1) in u-v corresponds to (1.26,1.45) in x-y.
3) Get sum of rows and columns in u-v co-ordinate.

In this regard,
1) what are the methods to create a spatial co-ordinate system and convert pixel coordinate system to spatial coordinate system?
2) how to get the values of fractional pixels in the spatial co-ordinate system?

Thanks.

  • 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-27T23:59:48+00:00Added an answer on May 27, 2026 at 11:59 pm

    If you really only want the diagonals at exactly 45 degrees, and your pixels are square (safe assumption with most standard cameras), then you don’t really need to do any coordinate transformation I don’t think. You can use the fact that all of the points along the diagonals have the form e.g. I(ix, ix), I(1 + ix, ix). Working out the limits is a bit tricky. Try this for the “column” (diagonal from the top left to the bottom right) sums, starting at the bottom left, moving up the left edge, then across the top:

    I = eye(5, 4);
    I(4, 1) = 1;
    
    [nrows, ncols] = size(I);
    colsums = zeros(nrows + ncols - 1, 1);
    
    % first loop over each row in the original image except the first one
    for ix = nrows : -1 : 2,
        JX = [0 : min(nrows - ix, min(nrows-1, ncols-1))];
        for jx = JX,
            colsums(nrows - ix + 1) = colsums(nrows - ix + 1) + I(ix + jx, jx + 1);
        end
    end
    
    % then loop over each column in the original image 
    for ix = 1 : ncols,
        JX = [0 : min(nrows - ix - 1, min(nrows-1, ncols-1))];
        for jx = JX,
            colsums(nrows + ix - 1) = colsums(nrows + ix - 1) + I(1 + jx, ix + jx);
        end
    end
    

    Note that if the distance matters to you (kind of sounds like it doesn’t), then the distances along these diagonals are sqrt(2)/2 longer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object that has a property: [Column] public Binary Image { get;
I have a binary image in Matlab, and I need the binary array(0 and
I have a binary image in matlab and i have a centroid of an
I have a binary image and need to convert all of the black pixels
I have a binary image (a dll) which I wish to view the assembly
I have binary data in a file that I can read into a byte
If you have binary strings (literally String objects that contain only 1's and 0's),
I have a binary file that I have to parse and I'm using Python.
I have a binary field in my database that is hard to describe in
One can mark the boundary of a binary image by bwboundaries function of MATLAB.

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.