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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:56:08+00:00 2026-06-13T14:56:08+00:00

On images below there is some specific pattern. Its best visible on first image.

  • 0

On images below there is some specific pattern. Its best visible on first image. I have points marked with small circes and connected with lines. They make some net pattern. Some points are wrong and does not fit to pattern (marked on first image).
The objective is to fill whole rectangle marked with red (rectangle is created from extremal points – points with extremal coordinates in pattern coordinate system).

The question is what approach should be taken to fill rectangle with points, and eliminate wrong points. Situation on second image is extremal but mainly cases are with more points.

Images are only for visualization. I’ve got vectors with points coordinates. There is no need to detect points.

I will add my solution as soon as I figure out one.



My current approach is to create lines parallel to longer rectangle sides with known pattern offset. Then to look for points with some delta distance near lines, and fill the rest points.

  • 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-13T14:56:10+00:00Added an answer on June 13, 2026 at 2:56 pm

    Overall, what I would do is first determine the grid, and then it’s easy to check if something is on that grid or not.

    These are the steps:

    • rotate everything so that you’ve only got horizontal and vertical lines.

    • Per x value count how many points you have.

    • Per y value count how many points you have.

    pseudo-code:

    xcount is array of int
    ycount is array of int
    
    for x=0 to width-1 do
      for y=0 to height-1 do
        foreach point do
          if point.x = x then
            xcount[x]++
          if point.y = y then
            ycount[y]++ 
    

    For your last image, the result would be something like this:

    x-count:1,0,0,0,3,0,2,0,1,0,0,0,4,0,0,0,3,0,0,0,4
    y-count:2,0,0,0,6,0,0,0,4,0,1,0,3,0,1,0,1
    
    • Now to detect the grid size:

      match = 0
      for i=1 to 10 do
      foreach xcount do
      if xcount mod i=0 then
      matches[i]++

    Now we have an array that contains the score (number of points that match) for 10 different grid sizes. It could look something like this:

    gridscores[] = 5,5,0,5,34,5,0,5
    
    XgridSize = index of greatest gridSore
    
    • 34 is clearly the best match, and it’s at index 5, so the grid size is 5.

    • Now that you know the grid size, you can easily find which points are not on that grid:

      foreach point do
      wrongpoint = (point.x mod XgridSize != 0) or
      (point.y mod YgridSize != 0)

    This works even if there are a lot wrong points. I didn’t get into the details on how to rotate and how to find the offset for the grid, but maybe this helps you into the right direction.

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

Sidebar

Related Questions

I have a div inside a webpage, below that div there are some images
I will have a screen in which there will be 11 images one below
Can anyone tell me what is causing the space below the images? There seems
In the image below there is an area, which has an unknown (custom) class.
Please refer to the image below - I'm not using NavigationViewController. Is there a
I have three tables as shown in below image. Note: Lead column of projectheader
I know there are some solutions out there for saving and loading images on
My code is something like the below. When theres 3 images everything is fine
I've found this question on StackOverflow Adding div below images in colorbox But it
I want to populate GridView below with images: <asp:GridView ID=GrdDynamic runat=server AutoGenerateColumns=False> <Columns> </Columns>

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.