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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:14:07+00:00 2026-05-22T18:14:07+00:00

I am working on image processing with C# and implementing integral histogram. I am

  • 0

I am working on image processing with C# and implementing integral histogram. I am not getting into the details, but assume that I have MxN matrix and each cell value is the sum of itself and its left and upper neighbor, minus left upper corner neighbor. This works fast but I want to make it faster for large images or for real time image processing performance.

matrix[i,j] += matrix[i-1,j] + matrix[i,j-1] - matrix[i-1,j-1];

The actual implementation is:

for (int i = 0; i < width; i++)
            for (int j = 0; j < height; j++)
            {
                int left = 0, upper = 0, u_l_corner = 0;
                if (j - 1 >= 0)
                {
                    left = matrix[i, j - 1];
                }
                if (i - 1 >= 0)
                {
                    upper = matrix[i - 1, j];
                }
                if (j - 1 >= 0 && i - 1 >= 0)
                    u_l_corner = matrix[i - 1, j - 1];

                matrix[i, j] += left + upper - u_l_corner;
            }

So the calculation is dependent on the previous values of cells. Therefore, it does not look like it can be implemented in parallel(at least to me). But still, just want to make sure before go any further..

Can this algorithm be implemented in parallel using Parallel.For or any other method in C#? If so a simple example is highly appreciated, but if not, I better work on to find a “parallel image histogram algorithm”, if any exists.

Thanks in advance.

  • 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-22T18:14:08+00:00Added an answer on May 22, 2026 at 6:14 pm

    As far as I’m concerned it is possible to make this algorithm parallel but i find no use of doing so if your matrix is relatively small ( time to process is less than few miliseconds ).

    If you are very interested in making this algorithm parallel you could make this task splitted to exactly “j” tasks ( number of items in “y” axis ).

    Key to doing so is starting first thread to calculate points in first row of this matrice ( [i, 0] ) then starting second thread delayed – second thread should chase first thread – must never overtake preceding thread.

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

Sidebar

Related Questions

I'm working on an image processing application where I have two threads on top
I'm currently working on a project for medical image processing, that needs a huge
I am working on a project that requires some image processing. The front end
I am working on image processing . I have a buffered image of fixed
I'm working on a task that includes image processing. I've found out, that I'm
i'm working on image processing, and i'm writing a parallel algorithm that iterates over
I'm working in image processing project, and I have this problem: If I made
I am new in c#. I am working on image processing. I am creating
I am working on an image generation script in PHP and have gotten it
Okay so im working on this php image upload system but for some reason

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.