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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:11:45+00:00 2026-05-15T21:11:45+00:00

I have image which size was 600 * 600 and it was displayed on

  • 0

I have image which size was 600 * 600 and it was displayed on 800 * 800 pixel screen.
The x,y coordinate in which the user look on screen was recorded in an array:

x =[250,300,390,750,760];
y =[120,550,250,130,420]; 

In other program, I want to plot the x,y coordinate on the 600 * 600 image. The problem is that some of the x,y plot were out of the image (as shown on the picture below) since the coordinate was more that the maximum size of the image (600 * 600).

EDITED:
How to transform/adjust the coordinate of the bigger image (800*800) into the smaller image (600*600) so all x,y coordinate are inside the smaller image (600*600)?

Lets say for example, the coordinate of top left image of the 600*600 inside the image of the 800*800 image is e.g. x = -10, y = 3.

Thanks.


alt text http://img9.imageshack.us/img9/8836/e47184420f.jpg

  • 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-15T21:11:45+00:00Added an answer on May 15, 2026 at 9:11 pm

    To get the pixels in image coordinates, you need to know where the bottom left and top right corners of your image were placed on the screen. From that you can both calculate offset and zoom of the image.

    %# define some parameters
    imageSize = [600 600];
    topLeftPixScreen = [200,100]; %# position of the top left image corner in screen pixels
    bottomRightPixScreen = [800,750]; %# position of the bottom right image corner in screen pixels
    
    %# transform coordinates
    oldX =[250,300,390,750];
    oldY =[120,550,250,130,420];
    
    newX = (oldX - topLeftPixScreen(1))/(bottomRightPixScreen(1) - topLeftPixScreen(1) + 1);
    newY = (oldY - topLeftPixScreen(2))/(bottomRightPixScreen(2) - topLeftPixScreen(2) + 1);
    

    Having said that, I’d suggest using ginput to select the points with Matlab, since this function directly returns image pixels.


    EDIT

    If you only have the top left corner, you have to hope that there has not been any scaling – otherwise, there is no way you can transform the points.

    With offset only, the above simplifies to

    %# define some parameters
    imageSize = [600 600];
    topLeftPixScreen = [200,100]; %# position of the top left image corner in screen pixels

    %# transform coordinates
    oldX =[250,300,390,750];
    oldY =[120,550,250,130,420];
    
    newX = oldX - topLeftPixScreen(1);
    newY = oldY - topLeftPixScreen(2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which takes both the user details and an image uploaded
I have a JPEG image (actually a BLOB in a database) which I want
I have a Serializable object which is supposed to hold a java.awt.Image as its
I have the following XAML code, which displays a picture (image inside borders) and
i have an image where i am resizing the image into thumbnail size it
I keep running across this loading image http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif which seems to have entered into
I'm tinkering with Silverlight 2.0. I have some images, which I currently have a
I have a c# site which makes use of a lot of images with
I have written a CSS sprite auto-generator which takes selected images out of the
I have a JPanel to which I'd like to add JPEG and PNG images

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.