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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:46:27+00:00 2026-05-26T08:46:27+00:00

Im extracting frames from video and plotting the slope value for the coordinates obtained

  • 0

Im extracting frames from video and plotting the slope value for the coordinates obtained in each line detected in each frame like below

Am plotting the “slope” value against “frames”.

Extracting frames from video

for k = 1 :240 %no.of frames
%Here in loop am extracting the line from each frame then 
[ycoord,xcoord]=find(line);%finding the coordinates of line
Ymax(k)=max(ycoord); 
Ymin(k)=min(ycoord); 
Xmax(k)=max(xcoord); 
Xmin(k)=min(xcoord); 
slope(k)=(Ymax(k)-Ymin(k)/Xmax(k)-Xmin(k));
end; 
plot(slope,'-ro');%plotting slope values of frames 

But when there is no line found in a frame then find(line) is giving empty arrays and there is no slope calculated showing error .
My requirement is when there is no line in the next frame then the slope value should be zero else it should calculate the slope value.
can some one please help on this

  • 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-26T08:46:28+00:00Added an answer on May 26, 2026 at 8:46 am

    I don’t really understand your code, but in general, when find can’t find something, it returns an empty matrix. You can use the isempty function to test if this is the case and manually set ycoord and xcoord to values that won’t cause an error on.

    isempty() MATLAB Documentation

    Hope this helps!

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

Sidebar

Related Questions

I have a binary file, inside of which has multiple frames. Each frame starts
I'm extracting XML node from an XElement. When I use XElement.Value it strips any
The two posts below are great examples of different approaches of extracting data from
I'm having difficulty extracting a single node value from a nodelist. My code takes
My application is extracting the data from excel sheet. I am storing the value
I need help extracting the value of a wildcard from a Regular Expressions match.
Sorry for my english) Looking for information about read frames from a video with
When extracting data from a list this way line[0:3], line[3][:2], line[3][2:] I receive an
I'm extracting frames of video to a Surface array to be rearranged into a
Extracting the href value from the following sample HTML code is straight forward if

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.