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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:34:09+00:00 2026-06-19T00:34:09+00:00

I have a frame in opencv wich I don’t want to save using imwrite(),

  • 0

I have a frame in opencv wich I don’t want to save using imwrite(), that I use this code to extract each channel and save it and than open the three files and combining a new frame first here is the c++ code :

  .........
  mean_fb.open("d:\\mean_blue",ios::out);
ostream osb(&mean_fb);
mean_fg.open("d:\\mean_green",ios::out);
ostream osg(&mean_fg);
mean_fr.open("d:\\mean_red",ios::out);
ostream  osr(&mean_fr);
resultframe *= 1.0/255.0; // adjusting the colors of the mean value 
for(int row = 0; row < resultframe.rows; row++) {
    for (int col = 0; col < resultframe.cols; col++) {
    //  std::cout << resultframe.at<cv::Vec3f>(row, col)[1] <<std::endl;
        std::cout << resultframe.at<cv::Vec3f>(row, col)[2] <<std::endl;

        //fwrite(&resultframe.at<cv::Vec3f>(row,col )[0],sizeof(float),1,inpR);
        osr<< resultframe.at<cv::Vec3f>(row, col)[0]<<"\n";
        osg<< resultframe.at<cv::Vec3f>(row, col)[1]<<"\n";
        osb<< resultframe.at<cv::Vec3f>(row, col)[2]<<"\n";
    }
}
 .......

the saved files are correct so I open them using SCILAB by the way the frame is 1920*1080 , here is the SCILAB code :

  clear 
  clc
  stacksize('max');
  cd 'd:\'
  width = 1080;
  height =1920 ;
  im = zeros(width, height);
     // read the  values of the red channel  

   red  = mgetl('mean_red'); // read the file as  
   red  = matrix(red,[width, height]);
   red  = strtod(red);
   im(:,:,3) = red;//  because opencv defaullt color Model is BGR 
   clear red;  // clear red to get enough stack 



  // read the  values of the green channel  

 green  = mgetl('mean_green'); // read the file as 
 green  = matrix(green,[width,height]);
 green  = strtod(green);
 im(:,:,2) = green;
  clear green;


   // read the  values of the blue channel  

  blue  = mgetl(mean_blue'); // read the file as 
  blue  = matrix(blue,[width, height]);
  blue  = strtod(blue);
  im(:,:,1) =blue ; 
  clear blue;


 imshow(im);/////////////////////////////////////////

this a part of the striped image I get enter image description here :
thanks for your help

  • 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-19T00:34:10+00:00Added an answer on June 19, 2026 at 12:34 am

    It seems you got the width and height parameter reversed. The image might be transposed.

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

Sidebar

Related Questions

I have implemented contour detection code using opencv 2.3 in real time. I have
I have been porting some video processing code to C++ using OpenCV 2.4.3. The
I have a c++-cli code that is capturing videos from a folder in opencv
ok I have this code IplImage *frame; CvCapture *capture = cvCaptureFromCAM(0); frame = cvQueryFrame(capture);
I'm using this opencv code on Android for an intensity equalization. The time of
I have several videos that I am trying to process using OpenCV and Qt
I have a video engine2.avi that I want to read and show with openCV.
I have a frame extends from JWindow (because I want to handle my X
Do older iPods and iPhones have a frame rate of 60fps? I'm finding that
I was just wondering about something. I have a frame that loads pages and

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.