Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Fully check out this repository with submodule ```darknet```. Compile the ```dar

```
cd darknet;mkdir build;cd build
cmake -DCMAKE_INSTALL_PREFIX=<full path to dn_object_detect> ..
cmake -DOPENCV=OFF -DCMAKE_INSTALL_PREFIX=<full path to dn_object_detect> ..
make install
```

Expand Down
24 changes: 20 additions & 4 deletions src/MultiClassObjectDetector.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// Copyright (c) 2016 Xun Wang. All rights reserved.
//

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include <boost/bind.hpp>
#include <boost/timer.hpp>
#include <boost/format.hpp>
Expand All @@ -30,6 +27,25 @@

#include "dn_object_detect/DetectedObjects.h"

image ipl_to_image(IplImage* src)
{
unsigned char *data = (unsigned char *)src->imageData;
int h = src->height;
int w = src->width;
int c = src->nChannels;
int step = src->widthStep;
image out = make_image(w, h, c);
int i, j, k, count=0;;

for(k= 0; k < c; ++k){
for(i = 0; i < h; ++i){
for(j = 0; j < w; ++j){
out.data[count++] = data[i*step + j*c + k]/255.;
}
}
}
return out;
}
namespace uts_perp {

using namespace std;
Expand Down Expand Up @@ -275,7 +291,7 @@ void MultiClassObjectDetector::startDetection()
cv_ptr_.reset();
imgMsgPtr_.reset();

image_transport::TransportHints hints( "compressed" );
image_transport::TransportHints hints( "raw" );
imgSub_ = imgTrans_.subscribe( cameraDevice_, 1,
&MultiClassObjectDetector::processingRawImages, this, hints );

Expand Down