15,666,902 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Python questions
View Javascript questions
View C++ questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by BupeChombaDerrick (Top 75 by date)
BupeChombaDerrick
13-Apr-15 18:51pm
View
Thanks :)
BupeChombaDerrick
13-Apr-15 17:22pm
View
You are welcome. You can accept the answer if it worked, others might find it useful:)
BupeChombaDerrick
13-Apr-15 17:10pm
View
I have added guard just before setPixel check code above.
BupeChombaDerrick
13-Apr-15 16:28pm
View
I have change the code please try copying the code above.
BupeChombaDerrick
13-Apr-15 16:12pm
View
My bad, it's supposed to be lbest[0] not min_lbest[0]. I have modified the code again, check.
BupeChombaDerrick
13-Apr-15 15:31pm
View
Your initialization for some variables might be causing the problem. Check my modified code.
BupeChombaDerrick
13-Apr-15 14:46pm
View
Check my modified code. Added this line if (newsx == gx && newsy == gy){
found = true;
}
BupeChombaDerrick
13-Apr-15 13:04pm
View
Check my modified code. But insure that each method is doing what it is supposed to be doing. I have added a "found" flag to terminate the loop when the go state is reached. Also set max_itr = bitmap.Height*bitmap.Width, so that the algorithm can go through every pixel if possible.
BupeChombaDerrick
13-Apr-15 9:53am
View
Can you provide the implementations of vs?
BupeChombaDerrick
12-Apr-15 17:43pm
View
Looks like "vs(si, sj, newsx, newsy);" should find the eight neighbors but it is being invoked 8 times in the loop, put it outside before the loop.
BupeChombaDerrick
12-Apr-15 17:39pm
View
According to your provided pseudocode, you need to find the eight neighbors of a given point, where,in your actual code, is this happening?
BupeChombaDerrick
12-Apr-15 17:22pm
View
Is the "bitmap" object properly allocated? it's dimensions should much "state" array.
BupeChombaDerrick
12-Apr-15 17:18pm
View
Maybe you should take a look at this http://www.codeproject.com/Articles/42258/Particle-swarm-optimization-for-function-optimizat . Your algorithm must have some errors.
BupeChombaDerrick
12-Apr-15 15:41pm
View
Your code risks going in an infinite loop because of this, if (state[newsx, newsy] == state[gx, gy])
iter_no = iter_no + 1;
You should increment the loop counter outside the if statement. For speed use ++i in your for loop increments
BupeChombaDerrick
12-Apr-15 15:31pm
View
You know I'am developing a robotic navigation system and a general problem solver for intelligent machines in cases involve sensory processing, the approach I want to use is now based on perception rather than optimization. By perception, I mean, the system must base it's action on matching an observed scene to thousands of models in a database, these models will have metadata about the best navigation route and anticipate object and scene dynamics such as moving objects e.t.c. This is a general thinking process I'am developing for machine learning. I know this has nothing to do with your question, just wanted to share this.
BupeChombaDerrick
12-Apr-15 14:57pm
View
An android app that has an online panorama album. I have already created the app but I want to update it so that users can upload there panoramas to a public online album. Only the album should be online, the app is usable with an offline panorama album. Like this one for photaf http://www.photaf.com/
BupeChombaDerrick
31-Mar-15 11:40am
View
My gcc version code is 4.5.3, I just installed the latest ndk version and still the file is missing. So I guess it's just patching then. Thanks again.
BupeChombaDerrick
31-Mar-15 9:36am
View
Thanks, are there any other libraries for Android for multiprocessor programming? I know of renderscript, but I can't use a c++ library with it, I'am trying to run image processing algorithms on multicore processors since there are so many devices with such types of processors.
BupeChombaDerrick
24-Dec-14 15:36pm
View
Okay, then whether to use synchronization techniques or not depends on the complexity of the response function. I have given your answer +5, but if you want me to accept it then change it so that it includes some of the discussion here. The "chunked" approach may work but for a simple kernel implementation it maybe an overkill. Thanks for the taking the time to help out.
BupeChombaDerrick
23-Dec-14 16:45pm
View
Okay so I shouldn't worry about race conditions or false sharing? I just have to choose to share the source(src) and destination(dst) bitmaps among the threads and openMP will handle the synchronizations?
BupeChombaDerrick
22-Dec-14 16:26pm
View
I'am currently looking at http://staff.city.ac.uk/~sbbh653/publications/OpenMP_SPM.pdf they seem to be using the full image without a "chunked" approach. Only adding a "#pragma omp parallel for" should have been sufficient. After adding "shared(src,dst)" it seems to work but don't know why.
BupeChombaDerrick
19-Dec-14 16:55pm
View
Typical values are width = 640, height = 480, thus about 300K pixels, the Kernel interface has two bitmaps as arguments the one designated as "dst" is mostly writeonly and "src" is readonly. Thus bitmap pixels for "dst" are expected to be modified by the threads, so one thing is that shared arrays of data like this are hard to parallelize but yet they are inherently parallel.
BupeChombaDerrick
19-Dec-14 14:40pm
View
Actually the bitmap data is just a 1D array of pixels, so the data is just one big strip.How about the race conditions with the bitmaps? Especially the "dst" bitmap needs to be synchronized. I tried using critical within the implementations of "Kernel" when writing to the bitmap but yielded no benefits. For example
// Kernel for changing bitmap to gray scale
class GrayScale: public Kernel {
public: void response(Bitmap &src, int x, int y, Bitmap &dst)
{
Pixel &sp = src.pData[x + y*src.width];
Pixel &dp = dst.pData[x + y*dst.width];
unsigned char gray = static_cast<unsigned char="">(0.3*sp.red + 0.5*sp.green + 0.2*sp.blue);
#pragma omp critical
{
dp.red = dp.green = dp.blue = gray;
}
}
};
where
// Pixel data for ARGB_8888 bitmap format
struct Pixel {
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;
};
BupeChombaDerrick
16-Jun-14 9:07am
View
Well the question is not about the way variables are declared, but how the processing is done, Code 1 is accessing a pointer variable every time in the loop, while Code 2 is only doing it once. It turns out that both codes will run equally fast when compiled in release mode since the compiler will optimize it for me, thus to further speed things up, parallel processing is the only answer :)
BupeChombaDerrick
14-Jun-14 14:58pm
View
Thank you. I guess I have to focus more on hardware acceleration.
BupeChombaDerrick
14-Jun-14 14:56pm
View
Just thought I had to tune things up myself, maybe some compilers ain't that intelligent :)
BupeChombaDerrick
14-Jun-14 14:52pm
View
I have already created my own computer vision algorithms for mobile and I have this app using my vision algorithms https://play.google.com/store/apps/details?id=com.facebook.rethinkvision.Bimostitch, I want to optimize the code on low and high level. You are right I guess I need to do parallel processing, I'am currently doing some research on that topic, any links to good literature on parallel processing can be helpful.
BupeChombaDerrick
14-Jun-14 8:42am
View
Does accessing the member variable within a loop affect the code performance? I'am writing computer vision code and I want to fully optimize it.
BupeChombaDerrick
25-Apr-14 13:03pm
View
You can try heapsort, check my updated solution :)
BupeChombaDerrick
25-Apr-14 12:56pm
View
Yes I have "import android.support.v8.renderscrpt.*" line instead of "import android.renderscript.*" but APK installation fails on android 2.2.
BupeChombaDerrick
24-Apr-14 17:22pm
View
In String[] names = (String[]) members.toArray();
What is members? Maybe it is the cast that is the problem.
BupeChombaDerrick
21-Mar-14 7:31am
View
I think the improvement to the solution can now handle the case of 2 items having the same value.
BupeChombaDerrick
21-Mar-14 7:18am
View
You are welcome :) I have slightly improved the solution.
BupeChombaDerrick
16-Mar-14 11:40am
View
Still I see AlarmManager and Service in your answer :).
BupeChombaDerrick
12-Mar-14 15:12pm
View
Use a cursorAdapter for that.
BupeChombaDerrick
12-Mar-14 7:02am
View
You are welcome :).
BupeChombaDerrick
11-Mar-14 13:05pm
View
No, the emulator is exactly like a real device, so if it does not work on the emulator then it won't work on the real device. So it will return null even on the real device. Your emulator and real device might be running different versions of android OS, check the versions.
BupeChombaDerrick
11-Mar-14 12:05pm
View
Caused by: java.lang.NullPointerException
com.example.temp.MainActivity$Asynctask.doInBackground(MainActivity.java:114) check whats on line 114 in your code, that's where the problem is.
BupeChombaDerrick
11-Mar-14 11:54am
View
You are welcome, your link looks like a better solution :).
BupeChombaDerrick
11-Mar-14 11:49am
View
It seems you have to insert the image using "Images.Media.insertImage()" for it to be saved to SD card and so that the MediaStore can create a path for it. The intent seems only to return the raw image data. But I'am not very sure.
BupeChombaDerrick
9-Mar-14 15:49pm
View
You are welcome.
BupeChombaDerrick
9-Mar-14 11:23am
View
If you want very fast blurring implement box filters using integral images (summed area table) http://computersciencesource.wordpress.com/2010/09/03/computer-vision-the-integral-image/.
BupeChombaDerrick
19-Feb-13 1:10am
View
I must say I have learnt a lot about threads just from this answer, thanks Sergey for the inform, it might come in handy. A vote +5.
BupeChombaDerrick
18-Feb-13 3:56am
View
Don't know much about threading, but I think I get Sergey's point, threads just run independent of one another, so even if one thread crushed, it wouldn't affect the other running threads. And if a processor is multicore, then seperate threads can run on separate cores, but if the number of threads exceeds the number of cores then the threads become overheads rather than improving performance of the program, so in some cases threading can improve performance while in others it can hurt performance, especially if more than the necessary number of threads are running. I'am right? :-)
BupeChombaDerrick
12-Jan-13 4:10am
View
Deleted
You are welcome:-)
BupeChombaDerrick
12-Jan-13 4:09am
View
Deleted
You are welcome :-)
BupeChombaDerrick
12-Jan-13 4:08am
View
You are welcome. :-)
BupeChombaDerrick
10-Jan-13 15:04pm
View
You can use openCV to access kinetic RGB-D image,where D = depth, so I was assuming that using the depth map or channel can help in segmenting out the human from the background and then you can train neural networks on specific spatial and temporal signals from the segmented training examples. I have not done much of neural networks with temporal pattern recognition but maybe these two links below can help you with the kinetic sensor and openCv and spatial and temporal pattern recognition respectively.
http://opencv.willowgarage.com/wiki/Kinect
http://www.bu.edu/asllrp/stp.pdf
BupeChombaDerrick
10-Jan-13 4:25am
View
Check the other link in the answer for Emgu Csharp pedestrian detection code, you still need that pdf book though :-)
BupeChombaDerrick
2-Jun-12 14:03pm
View
The only problem is that Hough Transform might not work on distorted circles or not perfectly circular object.
BupeChombaDerrick
1-Jun-12 18:48pm
View
You are welcome.
BupeChombaDerrick
31-May-12 10:23am
View
For starters use noiseless images so that the contours are connected per single digit and then you can group those pixels. For some details in grouping see http://stackoverflow.com/questions/2378579/opencv-grouping-white-pixels
But if you want your app to deal with images directly from a web cam then your app needs to do a lot of pre processing to identify possible locations of individual characters.
For now I recommend you start with a sliding window technique, first train a classifier and apply the classifier at all possible locations and scales using an image pyramid.
BupeChombaDerrick
31-May-12 9:22am
View
What exactly are you not getting?
BupeChombaDerrick
27-May-12 11:01am
View
C++ is better with openCV, an app developed using C++ will definitely run faster than one developed using C#, but it depends on the computational demands of your app. If you think that your app will need optimized code i suggest you use C++ but if not then you can use C# because it is simpler to develop an app with C# than C++.
BupeChombaDerrick
26-May-12 17:46pm
View
Thanks :)
BupeChombaDerrick
30-Apr-12 8:31am
View
thumbs up
BupeChombaDerrick
30-Apr-12 8:22am
View
you are welcome.
BupeChombaDerrick
29-Apr-12 18:49pm
View
ROI is Region Of Interest. Anyways who knows exactly what it means here in the question :-)
BupeChombaDerrick
26-Apr-12 12:07pm
View
The nose,mouth and eyes are all internal features so they are easier to detect even when the face is in a complex background, the ear on the other hand is external so ear detection can be erroneous when the head is in a complex background.
BupeChombaDerrick
21-Apr-12 13:13pm
View
Thanks RaisKazi
BupeChombaDerrick
20-Apr-12 13:52pm
View
Maybe try to enlarge the image to a reasonable size then use the same SURF code.
BupeChombaDerrick
20-Apr-12 13:28pm
View
I think the 10x11 is too small for an algorithm like SURF, for such small images. you can just use normalized template matching.
BupeChombaDerrick
11-Apr-12 12:34pm
View
check out http://www.cplusplus.com/forum/lounge/17053/
BupeChombaDerrick
11-Apr-12 7:39am
View
wow i'am impressed. I think on the part of clicks you need to simulate mouse events. check http://msdn.microsoft.com/en-us/library/ms171548.aspx
BupeChombaDerrick
5-Apr-12 18:36pm
View
Hey i wish i could help ... but i did look at the code. I couldn't find a reason why the program was not working. Try downloading and modifying this code http://www.codeproject.com/Articles/26897/TrackEye-Real-Time-Tracking-Of-Human-Eyes-Using-a
Just use template matching for closed eyes and set a detection threshold.
BupeChombaDerrick
2-Apr-12 14:42pm
View
For example, you want to run a Haar Face detector but with a .NET C++/CLI GUI , create a class called FaceDetector in a File FaceDetector.h and implementation file FaceDetector.cpp.
class FaceDetector
{
public: FaceDetector();
public: ~FaceDetector();
public: void readFromBitmap(Bitmap ^bmp); //convert to cv::Mat frame
public: void copyToBitmap(Bitmap ^bmp); //copy from cv::Mat frame to bitmap
public: void detectAndDraw();
// TO-DO: write methods that use openCV haar classifier for Face detection
// get data from a .NET Bitmap using readFromBitmap() and run face
// detection using detectAndDraw() then copy results to Bitmap using
// copyToBitmap() and you can then show the results on a Picture Box
public: Mat frame;
};
then you can include a header FaceDetector.h in your .NET C++/CLI project
then just before the form class code declare a FaceDetector object.
#include "FaceDetector.h"
FaceDetector faceDetector; //global declaration
// C++/CLI code here
then whithin the Form class you can easily call reference the faceDetector object.
or you can use Emgu CV .NET wrapper for openCV see http://sourceforge.net/projects/emgucv/
BupeChombaDerrick
24-Mar-12 10:52am
View
You have to train your own haar classifier for that, but you can use template matching... or train an SVM (Support Vector Machine) classifier on open and closed eyes for both right and left eye ... detect faces using haar classifier and then run the SVM open and closed eye detector on those regions with faces. There is no easy way around this and so you need to put in the effort to train your own classifier.
BupeChombaDerrick
22-Mar-12 12:00pm
View
i think "haarcascade_eye.xml" is corrupted try "haarcascade_eye_tree_eyeglasses.xml" for eyes and "haarcascade_frontalface_alt.xml" for faces. see the code below for face detection,its a modification of your code. I ran it using OpenCV 2.3.1,though i did not include mouse(int delta_x,int delta_y) function here,i believe that's for you to do. But i see you want to detect eyes right away... though that will be error prone... do face detection using fast haar detector and then eye detection probably using template matching because haar classifiers don't seem to perform better than template matching on eyes. And use cvSize(20,20) for better results but you can always check the size in the xml file itself so don't use any size.
#include "opencv2/opencv.hpp"
using namespace cv;
CvHaarClassifierCascade *cascade;
CvMemStorage *storage;
void detectFaces( IplImage *img );
int main( )
{
CvCapture *capture; IplImage *frame = 0;
int key;
char *filename = "haarcascade_frontalface_alt.xml";
capture = cvCreateCameraCapture(0);
storage = cvCreateMemStorage(0);
cascade = (CvHaarClassifierCascade*)cvLoad( filename,storage, 0, 0 );
assert( cascade && storage && capture );
cvNamedWindow( "video", 1 );
while( capture )
{
frame = cvQueryFrame( capture );
if( !frame )
{
fprintf( stderr, "Cannot query frame!\n" );
break;
}
detectFaces( frame ); key = cvWaitKey( 25 );
}
cvReleaseCapture( &capture );
cvDestroyWindow( "video" );
cvReleaseHaarClassifierCascade( &cascade );
cvReleaseMemStorage( &storage );
return 0;
}
void detectFaces( IplImage *img )
{
int i;
CvSeq *faces = cvHaarDetectObjects(img,cascade,storage,1.15,3,0,cvSize( 20, 20 ) );
for( i = 0 ; i < ( faces ? faces->total : 0 ) ; i++ )
{
CvRect *r = ( CvRect* )cvGetSeqElem( faces, i );
cvRectangle( img,cvPoint( r->x, r->y ),cvPoint( r->x + r->width, r->y + r->height ),CV_RGB( 255, 0, 0 ), 1, 8, 0 );
}
cvClearMemStorage( storage );
cvShowImage( "video", img );
}
BupeChombaDerrick
18-Mar-12 8:44am
View
please state clearly what you mean by "not working properly" ... because if the code is error free then the algorithm must not be okay. I'am taking a look at the code will get back to you after i do some analysis!
BupeChombaDerrick
25-Feb-12 18:13pm
View
Totally agree with Philippe, eye blinks are too fast, besides what use can you make of such a system (enlighten me), try using haarcascade_eye.xml file that comes with openCV to detect eye positions as a pre-processing stage and then see if you can invent a classifier to tell whether a person blinked. You can only capture such high speed events (blinks) using expensive high speed cameras which makes your project unfeasible and i doubt if the system you which to design can process frames at such high frame rates to be applicable.
BupeChombaDerrick
14-Feb-12 9:29am
View
Thanks for the time you've taken to help.I really appreciate it.
BupeChombaDerrick
14-Feb-12 9:09am
View
Similar to Google Goggles get a snap shot or any digital image and upload the image and press enter sit back wait for the results. Has of now the system is using a web-cam in real-time to recognize images or objects presented to it, i want it to be hosted on a server so that i can use it as a visual search engine. I want to develop a Visual encyclopedia so that users can get info about visual objects directly using this system.
BupeChombaDerrick
13-Feb-12 18:27pm
View
A vision system is an image processing software, in this case i have developed an image indexing program that can help index internet images and make them searchable. The system uses high-level features for this purpose unlike the existing ones which use intermediate or low-level features. I have tried the system on a small database but now i want to see how it can perform indexing a few thousands or millions of images existing on the internet by letting users interact with the system via a web browser.
BupeChombaDerrick
11-Feb-12 6:03am
View
Thanks.
BupeChombaDerrick
10-Feb-12 13:27pm
View
Anyway of communicating the finds of the research but protecting the technology from being used commercially by someone without permission would suffice.
Show More