Ask Your Question

Despair's profile - activity

2018-03-19 11:58:16 -0600 received badge  Taxonomist
2017-03-07 11:09:37 -0600 received badge  Notable Question (source)
2016-11-25 00:50:16 -0600 received badge  Famous Question (source)
2015-06-20 17:42:53 -0600 received badge  Notable Question (source)
2014-08-18 15:58:06 -0600 received badge  Popular Question (source)
2014-07-25 04:51:03 -0600 received badge  Popular Question (source)
2012-09-29 07:36:34 -0600 received badge  Self-Learner (source)
2012-09-28 10:26:17 -0600 answered a question 2 Images on the same FULLSCREEN window + their position

Okay so after a few hours of reading trying and failing, I've come to an conclusion that this can't be done.

Simple solution is : make a new bigger image and use the Region Of Interest to copy all the images you want to the bigger image and then display it.

Though I still have no idea how to move the Slidebar to a fixed position by window size :O

2012-09-26 06:46:06 -0600 asked a question 2 Images on the same FULLSCREEN window + their position

Hi, I've tried creating a window that will display 2 images in it so I opened a new window using autosize ( that from what I read keeps the images size and prevents them from being fit to the window) but still all i have is 1 big image.

Goal : Displaying the current displayed picture on the left side of screen and a secondary image on the right side of the screen. ** the window will be set to be FULLSCREEN

*could use a suggestion about the way I open the window to be full screen and images the same size they started with * this is what I have so far:

#include "highgui.h"
#include "cv.h"
#include <iostream>
#define FILENAME "picture.jpg"
#define WINDOWTITLE "Image To Ascii"
int beta=255;

IplImage* img_gray=NULL,*img_gray_smaller=NULL,*img_gray_regular_size=NULL,*img_gray_modify=NULL;

void onTrackbarSlide(int pos){
    img_gray_modify=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1);
    cvCopy( img_gray_smaller, img_gray_modify, NULL );
    int inc=(pos<255)? 255-pos: -255+(510-pos);
    cvSetImageROI(img_gray_modify,cvRect(0,0,80,60));
    cvAddS(img_gray_modify, cvScalar(inc),img_gray_modify);
    cvResetImageROI(img_gray_modify);
    img_gray_regular_size=cvCreateImage(cvSize(800, 600),IPL_DEPTH_8U,1);
    cvResize(img_gray_modify,img_gray_regular_size,CV_INTER_NN);
    cvReleaseImage(&img_gray_modify);
    cvShowImage(WINDOWTITLE, img_gray_regular_size);
}

int main(){
    char c='a';
    img_gray=cvLoadImage(FILENAME,CV_LOAD_IMAGE_GRAYSCALE),
    img_gray_smaller=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1),
    cvNamedWindow(WINDOWTITLE, CV_WINDOW_AUTOSIZE | CV_WINDOW_NORMAL);
    //cvResizeWindow(WINDOWTITLE,800,600);
    cvCreateTrackbar("brightness", WINDOWTITLE, &beta, 510, onTrackbarSlide);
    while(true){
        c=cvWaitKey(0);
        if (c==27)break;
        if (c==32){
            cvReleaseImage(&img_gray_smaller);
            cvReleaseImage(&img_gray);
            cvReleaseImage(&img_gray_regular_size);
            img_gray=cvLoadImage(FILENAME,CV_LOAD_IMAGE_GRAYSCALE);
            img_gray_smaller=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1);
            cvResize(img_gray,img_gray_smaller,CV_INTER_LINEAR);
        }
        cvShowImage(WINDOWTITLE, img_gray_regular_size);    
    }
    cvReleaseImage(&img_gray_smaller);
    cvReleaseImage(&img_gray);
    cvReleaseImage(&img_gray_regular_size);
    cvReleaseImage(&img_gray_modify);
}
  • another thing : is there an efficient way to move the Trackbar to the bottom of the screen no matter which resolution i use?
2012-09-25 07:12:32 -0600 commented answer B&W Image brightness- using a Trackbar

Thanks alot. I have the Oreilly opencv book and I went back to that chapter didnt notice the FIRST WINDOW !! part :)

thanks again!

2012-09-25 07:00:49 -0600 received badge  Scholar (source)
2012-09-25 05:31:28 -0600 asked a question B&W Image brightness- using a Trackbar

Hi, I've written the following code and I bumped into a few problems/questions.

First problem: Trackbar isnt showing. Second: is the ROI configured properly?

The thing is I want the Trackbar to start from the middle ( as 255 means no change to brightness ) and the image will change accordingly .

Anyways at the moment only the window loads and no images load since I want the image to load on screen only when the user changes the Trackbar position.

Thanks.

#include "highgui.h"
#include "cv.h"
#include <iostream>
#define FILENAME "picture.jpg"
#define WINDOWTITLE "Image To Ascii"
int beta=255;

IplImage* img_gray=NULL,*img_gray_smaller=NULL,*img_gray_regular_size=NULL,*img_gray_modify=NULL;

void onTrackbarSlide(int pos){
    *img_gray_modify=*img_gray_smaller;
    int inc=(pos<255)? 0-pos: 510-pos;
    cvSetImageROI(img_gray_modify,cvRect(0,0,80,60));
    cvAddS(img_gray_modify, cvScalar(inc),img_gray_modify);
    cvResetImageROI(img_gray_modify);
    img_gray_regular_size=cvCreateImage(cvSize(800, 600),IPL_DEPTH_8U,1);
    cvResize(img_gray_modify,img_gray_regular_size,CV_INTER_NN);
    cvReleaseImage(&img_gray_modify);
    cvShowImage(WINDOWTITLE, img_gray_regular_size);
}

int main(){
    cvCreateTrackbar("brightness", WINDOWTITLE, &beta, 510, onTrackbarSlide);
    char c='a';
    img_gray=cvLoadImage(FILENAME,CV_LOAD_IMAGE_GRAYSCALE),
    img_gray_smaller=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1),
    //img_gray_regular_size=cvCreateImage(cvSize(800, 600),IPL_DEPTH_8U,1);
    cvNamedWindow(WINDOWTITLE, CV_WINDOW_AUTOSIZE);
    cvResizeWindow(WINDOWTITLE,800,600);
    while(true){
        c=cvWaitKey(0);
        if (c==27)break;
        if (c==32){
            cvReleaseImage(&img_gray_smaller);
            cvReleaseImage(&img_gray);
            cvReleaseImage(&img_gray_regular_size);
            img_gray=cvLoadImage(FILENAME,CV_LOAD_IMAGE_GRAYSCALE);
            img_gray_smaller=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1);
            //img_gray_regular_size=cvCreateImage(cvSize(800, 600),IPL_DEPTH_8U,1);
            cvResize(img_gray,img_gray_smaller,CV_INTER_LINEAR);
            //cvResize(img_gray_smaller,img_gray_regular_size,CV_INTER_NN);
        }
        cvShowImage(WINDOWTITLE, img_gray_regular_size);    
    }
    cvReleaseImage(&img_gray_smaller);
    cvReleaseImage(&img_gray);
    cvReleaseImage(&img_gray_regular_size);
    cvReleaseImage(&img_gray_modify);
}
2012-09-18 07:41:46 -0600 commented answer Pixelization
img_gray=cvLoadImage(FILENAME,CV_LOAD_IMAGE_GRAYSCALE);
img_gray_smaller=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1);
img_gray_regular=cvCreateImage(cvSize(800, 600),IPL_DEPTH_8U,1);
cvResize(img_gray,img_gray_smaller,CV_INTER_LINEAR);
cvResize(img_gray_smaller,img_gray_regular,CV_INTER_NN);
cvShowImage(WINDOWTITLE, img_gray_regular);

the nearest is the NN part? i've just changed it to this and it does look better, can see the pixles. though still i think it can look a bit better, is it the linear part maybe?

Thanks for your help!

2012-09-18 07:38:50 -0600 received badge  Supporter (source)
2012-09-18 06:16:03 -0600 asked a question Pixelization

Hi, I've been trying to manipulate an 800x600 image to be 80x60 image ( kinda pixalated ) and grayscaled but to be seen as 800x600 size

what I do is the following:

img_gray=cvLoadImage(FILENAME,CV_LOAD_IMAGE_GRAYSCALE);
img_gray_smaller=cvCreateImage(cvSize(80, 60),IPL_DEPTH_8U,1);
img_gray_regular=cvCreateImage(cvSize(800, 600),IPL_DEPTH_8U,1);

which is loading the image as grayscale to begin with resizing it to 80x60 and then resizing it again to 800x600

but it doesnt look very well, any suggestions on

How to look at a low resolution image magnified to 800*600?

(maybe its the depth? the channels? tried mixing with those but the program fails)

awesome thanks

2012-09-08 02:51:27 -0600 commented answer Retrying to use opencv- this time 25 linker errors- win7 64bit vc10 vs2010

First, thanks for answering.

Yes, I have the library folder set in the C++ Directories menu. Also it is set in the additional libraries (inside the linker menu). And finally in the linker input menu there are all the lib files (Additional Dependencies)

any idea what i might be forgetting? :O thanks!

2012-09-07 11:39:57 -0600 commented question Retrying to use opencv- this time 25 linker errors- win7 64bit vc10 vs2010

retried again and still linker errors... could it be because i have VS2012 installed also?

2012-09-06 23:45:31 -0600 received badge  Student (source)
2012-09-06 08:11:58 -0600 asked a question Retrying to use opencv- this time 25 linker errors- win7 64bit vc10 vs2010

workspace windows 7 64bit. visual studio 2010 vc10 getting linker problems. i followed the instructions completely AGAIN but cant get it to work. just added every single folder to the properties page all include folders, to the c++ general line. all the library folders ( x64) to the linker general

and all the lib names from the folder to linker input: opencv_calib3d242d.lib opencv_contrib242d.lib opencv_core242d.lib opencv_features2d242d.lib opencv_flann242d.lib opencv_gpu242d.lib opencv_haartraining_engined.lib opencv_highgui242d.lib opencv_imgproc242d.lib opencv_legacy242d.lib opencv_ml242d.lib opencv_nonfree242d.lib opencv_objdetect242d.lib opencv_photo242d.lib opencv_stitching242d.lib opencv_ts242d.lib opencv_video242d.lib opencv_videostab242d.lib

still got 25 linker errors . no idea what i can do.

1>Main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,int)" (?namedWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) 1>Main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::absdiff(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &)" (?absdiff@cv@@YAXABV_InputArray@1@0ABV_OutputArray@1@@Z) 1>Main.obj : error LNK2001: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QAE@ABVMat@1@@Z) 1>Main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::divide(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,double,int)" (?divide@cv@@YAXABV_InputArray@1@0ABV_OutputArray@1@NH@Z) 1>Main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::GaussianBlur(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::Size_<int>,double,double,int)" (?GaussianBlur@cv@@YAXABV_InputArray@1@ABV_OutputArray@1@V?$Size_@H@1@NNH@Z) 1>Main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::fastFree(void )" (?fastFree@cv@@YAXPAX@Z) 1>Main.obj : error LNK2001: unresolved external symbol "class cv::Scalar_<double> __cdecl cv::mean(class cv::_InputArray const &,class cv::_InputArray const &)" (?mean@cv@@YA?AV?$Scalar_@N@1@ABV_InputArray@1@0@Z) 1>Main.obj : error LNK2001: unresolved external symbol "class cv::_OutputArray const & __cdecl cv::noArray(void)" (?noArray@cv@@YAABV_OutputArray@1@XZ) 1>Main.obj : error LNK2001: unresolved external symbol "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" (?copySize@Mat@cv@@QAEXABV12@@Z) 1>Main.obj : error LNK2001: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) 1>Main.obj : error LNK2001: unresolved external symbol "public: class cv::MatExpr __thiscall cv::Mat::mul(class cv::_InputArray const &,double)const " (?mul@Mat@cv@@QBE?AVMatExpr@2@ABV_InputArray@2@N@Z) 1>Main.obj : error LNK2001: unresolved external symbol "public: void __thiscall cv::Mat::convertTo(class cv::_OutputArray const &,int,double,double)const " (?convertTo@Mat@cv@@QBEXABV_OutputArray@2@HNN@Z) 1>Main.obj : error LNK2001: unresolved external symbol "class cv::MatExpr __cdecl cv::operator(double,class cv::Mat const &)" (??Dcv@@YA?AVMatExpr@0@NABVMat@0@@Z) 1>Main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::subtract(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const ... (more)

2012-09-03 06:28:49 -0600 commented question 0xc000007b error when trying the sample programs.

still fails to load, now i have linking issues also.... guess i should try the windows32bit install ? :(

2012-09-03 01:38:31 -0600 commented question 0xc000007b error when trying the sample programs.

Yes I have. All except step number 3 that says to choose a build, because I can't find where to select one. All I see in Downloads are 2.4.1 - nothing about 64/32 bit there

thanks though

2012-09-02 13:11:50 -0600 commented question 0xc000007b error when trying the sample programs.

you think if i install a second OS ( windows 7 32 bit) i wont have those troubles? is it worth trying>?

2012-09-02 06:37:59 -0600 asked a question 0xc000007b error when trying the sample programs.

using Windows 7 64bit sp1. Visual Studio 2008 vc9 (got 64bit redistribution installed)

been googling for many hours , reinstalled opencv a few times , with different versions.

so far I found out that this error is caused by 32bit - 64bit encounter.

I downloaded Dependency Walker and checked my debug exe it had a few "cannot find" messeges MSVCP80D.dll, MSVCR80D.dll , IESHIMS.dll and TBB_DEBUG.dll

so I tried to get those files into the project folder. downloaded the first 3 and got the tbb_debug from the opencv folder

now i still have the 0xc000007b messege when trying to use the executeable and the dependecny walker says the following:

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module. Error: Modules with different CPU types were found.

and in the files list nothing that i can see where the problem is at (no red lines no nothin!)