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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:56:44+00:00 2026-06-01T01:56:44+00:00

I am working with images and computing radon transform for an object. The function

  • 0

I am working with images and computing radon transform for an object. The function that computes the transform accepts vector as input:

pixel p;
vector<pixel> segObj  //segObj is the object segmneted from the image

pixel is a user-defined struct defined as:

struct pixel
{
float x, y;  //x,y coordinates of the pixel
};

Currently, I am doing an element wise assignment to the vector:

for(int ix=0; ix < element_count; ix++)
{
f.x = xCoordArray[ix];
f.y = yCoordArray[ix];
segObj.push_back(f);
//xCoordArray and yCoordArray are computed separately
}

The for loop makes it slow when dealing with large images. Is there a way to assign xCoordArray and yCoordArray directly to vector<pixel>segObj

I am not expereinced with the use of vectors so any help would be appreciated.
Also,
If xCoordArray, yCoordArray can be computed as vectors, is there a way to join them so that each vector index as two values.

  • 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-01T01:56:46+00:00Added an answer on June 1, 2026 at 1:56 am

    You can create an input iterator producing pixel objects and assign those directly. You could initialize the objects directly using something along the lines of this:

    pixel iterator::operator*() const {
        pixel rc = {
            xCoordArray[index],
            tCoordArray[index]
        };
        return rc;
    }
    

    That said, I somewhat doubt that this is indeed the bottleneck: did you profile your code or are you suspecting that this is the problem?

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

Sidebar

Related Questions

I have a PHP function that I use regularly for working with images (resizing,
I'm working on a home project that involves comparing images to a database of
I am working on an iPhone Application that stores images in the Applications 'Document'
I'm currently working on a page that loads several images sequentially using setTimeout and
There are some very useful classes for working with images. I am stuck with
Working with a latex document with eps images as in the example below... \documentclass[11pt]{paper}
I am working on a program which manipulates images of different sizes. Many of
I am working on a project to capture images via webcam in a predefined
I am working on a web-application in which dynamically-created images are used to display
I am working on an application where I have an images folder relative to

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.