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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:02:54+00:00 2026-06-13T23:02:54+00:00

I need to find pixel values that are between the intersection of 2 lines.

  • 0

I need to find pixel values that are between the intersection of 2 lines. The following image shows the points that I want namely the brown region.

These 4 co-ordinates can change and are not necessarily the corner points.

enter image description here

What is the fastest way to get the pixel values ? Is there any function that can give me the necessary mask.

  • 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-13T23:02:55+00:00Added an answer on June 13, 2026 at 11:02 pm

    You should calculate for each point, whether it is above the line or below. If the line is given in its equation form Ax+By+C, then it is as simple as calculating the sign of this expression, per your point (x,y). If your lines are given in any other form, you should first calculate the form above. (See here and here)

    Let L1 be the set of all points below the first line, and L2 the set of all points below the second line. Then, your set is X = Xor(L1,L2)

    [ enter image description here ] Xor [enter image description here]

    Equals:

    enter image description here

    Here is a Matlab code that solves you problem for the corner points, based on the solution that I’ve described. You can adjust the line equations in your code.

    function CreateMask()
        rows = 100;
        cols = 200;
        [X,Y] = ndgrid(1:cols,1:rows);
    
        belowFirstLine  = X*(1/cols)  + Y*(-1/rows) + 0 < 0;
        belowSecondLine = X*(-1/cols) + Y*(-1/rows) + 1 < 0;
    
        figure;imshow( transpose(xor(belowSecondLine,belowFirstLine)));
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find a particular pixel of an image. Let's say 89 21
I need to find out the pixel position of one element in a list
i need to find out automationid for key board values? how to send keystrokes
I need to find a silence in a mp3 file. Simple as that. For
I need to find the longest sequence in a string with the caveat that
I need some sort of an algorithm, that would try to find free space
I need to compare 2 pictures and find pixels that are different with specified
I need to find the pixel-frame for different ranges in a textview. I'm using
Ttl;dr: I need to move an image VERY slowly in canvas without obvious pixel
The following image shows what the algorithm has to do. In the case of

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.