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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:20:35+00:00 2026-05-12T06:20:35+00:00

I am using XNA to build a project where I can draw graffiti on

  • 0

I am using XNA to build a project where I can draw “graffiti” on my wall using an LCD projector and a monochrome camera that is filtered to see only hand held laser dot pointers. I want to use any number of laser pointers — don’t really care about differentiating them at this point.

The wall is 10′ x 10′, and the camera is only 640×480 so I’m attempting to use sub-pixel measurement using a spline curve as outlined here: tpub.com

The camera runs at 120fps (8-bit), so my question to you all is the fastest way to to find that subpixel laser dot center. Currently I’m using a brute force 2D search to find the brightest pixel on the image (0 – 254) before doing the spline interpolation. That method is not very fast and each frame takes longer to computer than they are coming in.

Edit: To clarify, in the end my camera data is represented by a 2D array of bytes indicating pixel brightness.

What I’d like to do is use an XNA shader to crunch the image for me. Is that practical? From what I understand, there really isn’t a way to keep persistent variables in a Pixel Shader such as running totals, averages, etc.

But for arguments sake, let’s say I found the brightest pixels using brute force, then stored them and their neighboring pixels for the spline curve into X number of vertices using texcoords. Is is practical then to use HLSL to compute a spline curve using texcoords?

I am also open to suggestions outside of my XNA box, be it DX10/DX11, maybe some sort of FPGA, etc. I just don’t really have much experience with ways of crunching data in this way. I figure if they can do something like this on a Wii-Mote using 2 AA batteries than I’m probably going about this the wrong way.

Any ideas?

  • 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-12T06:20:35+00:00Added an answer on May 12, 2026 at 6:20 am

    You’re dealing with some pretty complex maths if you want sub-pixel accuracy. I think this paper is something to consider. Unfortunately, you’ll have to pay to see it using that site. If you’ve got access to a suitable library, they may be able to get hold of it for you.

    The link in the original post suggested doing 1000 spline calculations for each axis – it treated x and y independantly, which is OK for circular images but is a bit off if the image is a skewed ellipse. You could use the following to get a reasonable estimate:

    xc = sum (xn.f(xn)) / sum (f(xn))

    where xc is the mean, xn is the a point along the x-axis and f(xn) is the value at the point xn. So for this:

              *
           *  *
           *  *
           *  *
           *  *
           *  *
           *  *  *
        *  *  *  *
        *  *  *  *
     *  *  *  *  *  *
    ------------------
     2  3  4  5  6  7 
    

    gives:

    sum (xn.f(xn)) = 1 * 2 + 3 * 3 + 4 * 9 + 5 * 10 + 6 * 4 + 7 * 1

    sum (f(xn)) = 1 + 3 + 9 + 10 + 4 + 1

    xc = 128 / 28 = 4.57

    and repeat for the y-axis.

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

Sidebar

Related Questions

In XNA I'm using MediaPlayer to play my music. I found that when playing
As a school project we've created a C# XNA 4.0 Game that runs perfectly
I essentially have a blank XNA project built using the XNA 3.1 wizard, i'm
I'm using a Keyboard hook in my XNA project (anyone who uses XNA knows
I'm using this example project's XNA 4.0 form control in an application I'm writing:
Using XNA, I'm trying to make an adventure game engine that lets you make
I'm using XNA and creating a bunch of forms that roll their own 'game
I'm making a game using XNA framework, so I use a lot functions that
I'm working on an XNA game and I am using ViewPort.Project and ViewPort.Unproject to
Using XNA 4.0, I am currently playing songs from the user's PC/XBox360 using the

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.