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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:51:31+00:00 2026-06-08T20:51:31+00:00

I am using OpenCV for image manipulation in C. Please forgive me if this

  • 0

I am using OpenCV for image manipulation in C. Please forgive me if this question is answered in the documentation, but I have found the OpenCV docs to be pretty badly formed and difficult to read.

I have an CvMat* that i have extracted from an image file as below:

CvMat* mat = cvLoadImageM((char*) filename, CV_LOAD_IMAGE_COLOR);

What I need to do is get a subimage of that by cropping out a certain bounded region. A logical command for this might be:

CvMat* subMat = cvGetSubImage(mat, minx, maxx, miny, maxy);

where minx, maxx, miny, and maxy define the boundaries of the cropped region. Is there a built in way to do this easily?

  • 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-08T20:51:32+00:00Added an answer on June 8, 2026 at 8:51 pm

    Take a look at http://nashruddin.com/OpenCV_Region_of_Interest_(ROI)/

    In which the tutorial does the following on a Region of Interest:

    cvSetImageROI(img1, cvRect(10, 15, 150, 250));
    IplImage *img2 = cvCreateImage(cvGetSize(img1),
                               img1->depth,
                               img1->nChannels);
    cvCopy(img1, img2, NULL);
    cvResetImageROI(img1);
    

    OpenCV has built in capabilities for setting the region which you care about and copying that region out of an image, just as you want to achieve.

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

Sidebar

Related Questions

I'm trying to create an image using opencv v 2.1, but I get this
I am implementing an image analysis algorithm using openCV and c++, but I found
I'm trying to display an image using OpenCV. I have the following very basic
I have a question about the Convolve function in OpenCV using GPU acceleration. The
This is how we display and process an Image using Opencv: int _tmain(int argc,
I have an image and I am using OpenCV to find the contours within
I am using OpenCV with Python. I have an image, and what I want
So we have this Image processing course at the university and we'll be using
I'm currently working on Image stitching using OpenCV 2.3.1 on Visual Studio 2010, but
I am using OpenCV for some of my image processing related codes. I am

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.