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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:30:45+00:00 2026-06-12T09:30:45+00:00

I implemented an image processing algorithm what needs to sweep the image with a

  • 0

I implemented an image processing algorithm what needs to sweep the image with a line. I generate the valid points of the line into two vectors: lx_valid, and ly_valid. Then I generate the linear indices with sub2ind, and plot the results. As you can see, my line clearly intersects the object, but locmax == 0 after running the code. The coordinates are all valid (inside the image); but I’ve got one even stranger result: if I generate the coordinates as ind2sub(size(Im), c) I don’t even get back my coordinates. I’m sure it’s something small, but I can’t get it.

valid = lx >= 1 & size(Im, 2) >= lx & ly >= 1 & size(Im, 1) >= ly;
lx_valid = lx(valid);
ly_valid = ly(valid);
c = sub2ind(size(Im), ly_valid, lx_valid);
locmax = max(Im(c));
imshow(Im);plot(lx_valid,ly_valid,'go');

imshow(Im);plot(lx_valid,ly_valid,'go'); works as expected

  • 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-12T09:30:46+00:00Added an answer on June 12, 2026 at 9:30 am

    I solved the problem: the indices that were generated by sub2ind were staturated, and were returned as uint16 silently. If I convert the parameters to double, sub2ind returns a double value which is big enough for the indices.

    valid = lx >= 1 & size(Im, 2) >= lx & ly >= 1 & size(Im, 1) >= ly; 
    lx_valid = double(lx(valid)); 
    ly_valid = double(ly(valid)); 
    c = sub2ind(size(Im), ly_valid, lx_valid); 
    locmax = max(Im(c)); 
    imshow(Im);plot(lx_valid,ly_valid,'go');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Python and Numpy/Scipy to implement an image processing algorithm. The
Intro: I'm working on an image processing task trying to find two borders of
I have implemented the image upload code using jquery php in my php web
i have two int array of images , i have implemented it in grid
I've been playing around with image processing lately, and I'd like to know how
I am very new in image processing and pattern recognition. I am trying to
My application is using an image processing library to handle a long running task.
I tried this experiment with Digital Image Processing - 2D DCT/IDCT ( image compression
For my project i am writing an image pre processing library for scanned documents.
i have implemented a code that fetch single image from 1000+ images. The image

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.