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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:54:44+00:00 2026-05-23T13:54:44+00:00

iam dealing with multiscale images , 3 sizes : original , half & double

  • 0

iam dealing with multiscale images , 3 sizes : original , half & double
i extract the connected components from each of them separately then do some computations

finally i want to map the bounding rectangles of the half & double scale connected components to their original location and size in the original image

here’s my code of resizing and relocating the bounding rectangle

        Matrix<int> src = new Matrix<int>(3, 2,3);
        Matrix<int> dst = new Matrix<int>(3, 2,2);

        IntPtr mat = CvInvoke.cvCreateMat(2, 3, MAT_DEPTH.CV_32F);

        src[0,0]=componentBRect.X;
        src[0,1]=componentBRect.Y ;
        src[1,0]=componentBRect.Right;
        src[1,1]=componentBRect.Y;
        src[2,0]=componentBRect.X;
        src[2,1]=componentBRect.Bottom;





        CvInvoke.cvGetAffineTransform(img2, img, mat); //img is the original image & img2 has been resized to 1/2 imgWidth and 1/2 imgHeight

        CvInvoke.cvTransform(src.Ptr, dst.Ptr, mat, IntPtr.Zero);

it’s supposed to get dst points reszied and relocated
but unfortunately the same points are returned again , i think there’s a problem with getAffineTransform as it returns an identity matrix

 mat= 
 |1 0 0 |
 |0 1 0 | !!

Any Suggestions ?? or is there another way to do what i want without using Affine transformation

Thanks in advance

  • 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-23T13:54:45+00:00Added an answer on May 23, 2026 at 1:54 pm

    I have solved it,

    I simply found another function – it’s cvConvertScale

           for (int i = 0; i < Brectangles.Count; i++) {
    
                src[0, 0] = Brectangles[i].X;    //top left
                src[0, 1] = Brectangles[i].Y;
                src[1, 0] = Brectangles[i].Right;  //top right
                src[1, 1] = Brectangles[i].Y;
                src[2, 0] = Brectangles[i].X;    //bottom left
                src[2, 1] = Brectangles[i].Bottom;
    
    
                CvInvoke.cvConvertScale(src, dst, rescaleFactor, 0); // rescaleFactor variable is 2 for half size & 0.5 for double size
    
                temp.X = dst[0, 0];
                temp.Y = dst[0, 1];
                temp.Width = dst[1, 0] - dst[0, 0];
                temp.Height = dst[2, 1] - dst[0, 1];
    
                Brectangles[i] = temp;
    
    
             }
    

    It resizes the rectangle and relocates it in its proper position is the new size

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

Sidebar

Related Questions

I am dealing with a set of message objects, each of which has a
I am dealing with Facebook profile images, and their height can vary a lot
I am dealing with polishing up an email list cull thing from a sign-up/enroll
I am dealing with lot of double values in my application, is there is
I am dealing with this problem. I need to attach files from my desktop
I am dealing with huge data (downloading from webserver to client/phone). Currently I am
I am dealing with a tree structure in a Python program. Each node in
I am dealing with MySQL tables that are essentially results of raytracing simulations on
I am dealing with a large codebase that has a lot of classes and
I am dealing with a race condition, I believe, in my JAVA GUI. I

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.