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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:41:37+00:00 2026-06-07T19:41:37+00:00

I’m processing some images that my UGV (Unmanned Ground Vehichle) captures to make it

  • 0

I’m processing some images that my UGV (Unmanned Ground Vehichle) captures to make it move on a line.

I want to get the angle of that line based on the horizon. I’ll try to explain with a few examples:

90 degrees image

The image above would make my UGV to keep straight ahead, as the angle is about 90 degrees.
But the following would make it turn left, as the angle compaired to the horizon rounds about 120.

120 degrees image

I could successfully transform those images into the image below using otsu for thresholding:

thresholded image

And also used an edge detection algorithm to get this:

laplacian filter

But I’m stuck right now trying to find an algorithm that detecs those edges/lines and outputs – or helps me to output – the angle of such line..

  • 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-07T19:41:38+00:00Added an answer on June 7, 2026 at 7:41 pm

    Here’s my attempt using ImageJ:

        // Open the Image
    ImagePlus image = new ImagePlus(filename);
    
        // Make the Image 8 bit
    IJ.run(image, "8-bit", "");
    
        // Apply a Threshold (0 - 50)
    ByteProcessor tempBP = (ByteProcessor)image.getProcessor();
    tempBP.setThreshold(0, 50, 0);
    IJ.run(image, "Convert to Mask", "");
    
        // Analyze the Particles
    ParticleAnalyzer pa = new ParticleAnalyzer(
        ParticleAnalyzer.SHOW_MASKS +
        ParticleAnalyzer.IN_SITU_SHOW,
        1023 +
        ParticleAnalyzer.ELLIPSE
        , rt, 0.0, 999999999, 0, 0.5);
    
    IJ.run(image, "Set Measurements...", "bounding fit redirect=None decimal=3");
    
    pa.analyze(image);
    
    int k = 0;
    double maxSize = -1;
    for (int i = 0; i < rt.getCounter(); i ++) {
        // Determine creteria for best oval.
        // The major axis should be much longer than the minor axis.
        // let k = best oval
    }
    double bx = rt.getValue("BX", k);
    double by = rt.getValue("BY", k);
    double width = rt.getValue("Width", k);
    double height = rt.getValue("Height", k);
    
    // Your angle:
    double angle = rt.getValue("Angle", k);
    double majorAxis = rt.getValue("Major", k);
    double minorAxis = rt.getValue("Minor", k);
    

    How the code works:

    1. Make the image grayscaled.
    2. Apply a threshold on it to only get the dark areas. This assumes the lines will always be near black.
    3. Apply a Particle Analyzer to find Ellipses on the image.
    4. Loop through the “Particles” to find ones that fit our criteria.
    5. Get the angle from our Particle.

    Here’s an example of what the image looks like when I analyze it:

    Oval Image
    Oval Image 2

    NOTE: The code is untested. I just converted what I did in the Visual ImageJ into Java.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported

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.