2020-09-09 10:34:31 -0600 | received badge | ● Popular Question (source) |
2018-06-10 06:20:30 -0600 | received badge | ● Popular Question (source) |
2017-04-27 04:41:58 -0600 | received badge | ● Notable Question (source) |
2016-03-18 08:45:29 -0600 | received badge | ● Popular Question (source) |
2014-12-06 05:07:42 -0600 | asked a question | what is the error in my code i have code for reading data from text file to put them into array of double element the code has no error in compiling but when executing and print the element of array i found they have no data, where is the error the text file has the data and loaded correctly this is my code: thanks |
2014-12-06 04:25:18 -0600 | asked a question | where is the error in my code i have code for reading data from text file to put them into array of double element the code has no error in compiling but when executing and print the element of array i found they have no data, where is the error the text file has the data and loaded correctly this is my code: thanks |
2014-11-06 04:08:53 -0600 | commented question | copyTo error i can't change croped_ image size as it is detected area from another image and i want to put it in center of black image in order to make it with another size without using resizing as resize function make my data low accuracy |
2014-11-05 13:39:08 -0600 | asked a question | copyTo error i need to copy a cropped image with different size to the center of another black image with fixed size , when i use copyTo function i have an error the function as: the error as: opencv error:assertion failed obj->size size<cols,rows> core\src\matrix line 1392 |
2014-09-28 14:48:38 -0600 | asked a question | k-nearest neighborhood interruption i downloaded knn c++ code this code takes two text files train file and test file each has vectors and its labels the vector in text file is look like: 1.2,2.2,5.6,....,1 2.1,1,5,5.5,....,1 1.2,2.5,3.6,....,2 the last index in vector is the label for this vector the code read the data from these files with this function then the code send the list of vectors in order to classify test vectors i have 1405 train vector and 810 test vector, when running the code read the number of vectors as 1405 and 810 but the list of training and text vectors has 2810 and 1620 index what is the content of these lists and why they have the double number of train and test vectors! my result is 183% for accuracy as the code send the list not the examples why! |
2014-09-15 17:14:39 -0600 | commented question | self organizing map accuracy i'm not totally sure about this code but i need from my code to obtain accuracy by comparing the result of test images classes with the true classes for these images |
2014-09-15 16:27:19 -0600 | commented question | self organizing map accuracy Ok, do you have a better code for this function |
2014-09-15 15:49:34 -0600 | asked a question | self organizing map accuracy i have a self organizing map c++ code which give me an accuracy for recognition system but when using this code i have a wrong accuracy by classification function anyone here can tell me where is the error with this code or give me better code for accuracy |
2014-06-12 14:51:48 -0600 | asked a question | knn c++ code changing i have c++ code for knn classifier i can use this code after self organizing map, it give me accuracy for classification but now i have group of vectors each has mean in my knn code: it take No of train image, No of test image, and som map dimension but with these vector: i have No of train vectors, No of test vectors, and its mean what about map dimension now how can i change this code in order to take these vectors and make classification with only its mean without self organizing map this is my code which work with som code and i need to work it without som: (more) |
2014-06-09 05:32:31 -0600 | asked a question | problem with lbp result i have a number of images these images are prepossessed using uniform local binary pattern and spatial histogram then i take the result to self organizing code aimed to enhance the result of SOM when i run lbp code i have a black images with a few data and the accuracy is worse any one here has this combined code or an idea of how i enhance the result this is the code of uniform int LBPFeatures::countSetBits(int code)
{
int count=0;
int v=code;
for(count=0;v;count++)
{
v&=v-1; //clears the LSB
}
return count;
}
int LBPFeatures::rightshift(int num, int shift)
{
return (num >> shift) | ((num << (8 - shift)&0xFF));
}
bool LBPFeatures::checkUniform(int code)
{
int b = rightshift(code,1);
///int d = code << 1;
int c = code ^ b;
//d= code ^d;
int count=countSetBits(c);
//int count1=countSetBits(d);
if (count <=2 )
return true;
else
return false;
}
void LBPFeatures::initUniform( int check)
{
lookup.resize(256);
int index=0;
for(int i=0;i<=255;i++)
{
bool status=checkUniform(check);
if(status==true)
{
lookup[i]=index;
index++;
}
else
{
lookup[i]=59;
}
}
spatialhist Hist;
Hist.initHistogram();
}
void LBPFeatures::computeuniformlbp(Mat image,Mat &dst)
{
uchar *ptr=image.data;
image.copyTo(dst);
uchar *optr=dst.data;
int width=image.cols;
int height=image.rows;
for(int i=1;i<height-1;i++)
{
for(int j=1;j<width-1;j++)
{
int center=(uchar)ptr[j+i*width];
unsigned char code=0;
//for(int k=7;k>=0;k++)
code|=((uchar)ptr[(j-1)+(i-1)*width] >=center)<<7;
code|=((uchar)ptr[j+(i-1)*width] >=center)<<6 ;
code|=((uchar)ptr[(j+1)+(i-1)*width] >=center)<<5 ;
code|=((uchar)ptr[(j+1)+(i)*width] >=center)<<4 ;
code|=((uchar)ptr[(j+1)+(i+1)*width] >=center)<<3 ;
code|=((uchar)ptr[j+(i+1)*width] >=center)<<2 ;
code|=((uchar)ptr[j-1+(i+1)*width] >=center)<<1 ;
code|=((uchar)ptr[j-1+(i)*width] >=center)<<0 ;
//heck if the code is uniform code
//encode only if it is a uniform code else
//assign it a number 255
initUniform(code);
//lookup.push_back(code);
optr[j+i*width]=lookup[code];
}
}
} spatialhist code spatialhist::spatialhist(){
sizeb=59;
}
Mat spatialhist::computeHistogram(Mat& cell)
{
Mat histogram;
histogram= hist.BuildHistogram(cell);
return histogram;
}
void spatialhist::initHistogram()
{
vector<int> channel;
channel.push_back(0);
hist.setChannel(channel);
vector<int> size;
size.push_back(sizeb);
hist.setHistSize(size);
vector<float> range;
range.push_back(0);
range.push_back(59);
hist.setRange(range);
}
vector<float> spatialhist::spatialHistogram( const Mat& lbpImage, const Size& grid)
{
vector<float> histograms;
histograms.resize(grid.width*grid.height*sizeb);
int width=lbpImage.cols/grid.width;
int height=lbpImage.rows/grid.height;
int cnt=0;
//#pragma omp parallel for
for(int i=0;i<grid.height;i++)
{
for(int j=0;j<grid.width;j++)
{
Mat cell=lbpImage(Rect(j*width,i*height,width,height));
Mat cell_hist=computeHistogram(cell);
histogramsimage.push_back(cell_hist);
//imshow("FFF",cell_hist);
Mat tmp_feature;
Mat feature =cell_hist.reshape(1,1);
feature.convertTo(tmp_feature,CV_32FC1);
float * ptr=tmp_feature.ptr<float>(0);
for(int k=0;k<tmp_feature.cols-1;k++)
{
if ... (more) |
2014-05-31 11:34:11 -0600 | asked a question | what is the difference between calchist parameter using lbp and using uniformlbp i need to calculate histogram for uniform lbp image. parameters in calchist with lbp is image= source lbpimage (which i need it's histogram) nimage= number of source image channel= index of channel (for gray image is 0) mask= Mat() (for full image) output= the histogram image (which result) dims= Histogram dimensionality (1) histsize= number of bins (256 for gray level bin for each pixel) ranges= 0,256 (for gray level) uniform= true (ranges= { , } accumulate= false (for one histogram from one image) this is for normal lbp what about uniform lbp (dims, histsize, ranges, ) is there any difference thanks |
2014-05-30 03:19:06 -0600 | commented question | how can i deal with these outputs ok i will take the short answer and ignore them |
2014-05-29 12:35:40 -0600 | asked a question | how can i deal with these outputs when i run my code i have these outputs |
2014-05-29 06:17:24 -0600 | asked a question | i want to obtain the histogram of an image i have an image and i want to compute and draw its histogram i use the calchist function but i'm confused about its previous calculations now i'm a new a bout the c function which deal with memory so i need an explain to this code or anew easiest code for calchist function this is my code: |
2014-05-29 05:16:12 -0600 | commented answer | how can i convert a vector of float into mat image ok i do it but when i reach the imwrite function i have this error Unhandled exception at 0x7592812f in mycode.exe: Microsoft C++ exception: cv::Exception at memory location 0x001aefe4.. opencv error: unspecified error<could not find a writer for the specified extension> in cv:: imwrite_, file......\ opencv\modules\highui\src\loadsave.cpp,line275 |
2014-05-28 16:10:43 -0600 | commented question | how can i convert a vector of float into mat image or can i convert it from vector of mat into just one mat image |
2014-05-28 16:02:12 -0600 | commented question | how can i convert a vector of float into mat image i re-edit the question pls see it and tell me can i use the histogramsimg mat vector for my need instead of converting the histogrames vector or can i convert it from vector of mat into just one mat image |
2014-05-28 15:56:20 -0600 | received badge | ● Editor (source) |
2014-05-28 15:27:02 -0600 | commented question | how can i convert a vector of float into mat image i run the code with this new resize function but i have the same error |
2014-05-28 15:18:39 -0600 | commented question | how can i convert a vector of float into mat image how can i do this sorry i don't understand i need the image to be 50*50 |
2014-05-28 15:04:58 -0600 | asked a question | how can i convert a vector of float into mat image i i need to convert vector of float to mat image then use this image in imgshow and resize function i have this function but it doesn't work i have this error the vector i want to convert is the histograms vector i obtained from this function |
2014-05-28 14:43:00 -0600 | commented question | vector subscript out of range thanks that's right it work now |
2014-05-28 14:13:05 -0600 | asked a question | vector subscript out of range i have acode for check the lbp code for pgm image if it is uniform code or not but when i run the code i have this vector out of range error: debug assertion failed vector out of range this is my code: |
2014-05-23 23:07:41 -0600 | asked a question | does any one has a uniform lbp c++ code with it's spatial histogram i have a code but with error can you find my error |