Got OpenCV3 working
This commit is contained in:
parent
a54193cd90
commit
eeb1cd6647
@ -35,14 +35,14 @@
|
|||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
cmake
|
cmake
|
||||||
opencv2
|
opencv3
|
||||||
liblbfgs
|
liblbfgs
|
||||||
qt5.full
|
qt5.full
|
||||||
libsForQt5.qt5.wrapQtAppsHook
|
libsForQt5.qt5.wrapQtAppsHook
|
||||||
];
|
];
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
cmake scannerExtract -DCMAKE_BUILD_TYPE=release -DOPENCV2=1
|
cmake scannerExtract -DCMAKE_BUILD_TYPE=release
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@ -90,7 +90,7 @@
|
|||||||
default = pkgs.mkShellNoCC {
|
default = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
cmake
|
cmake
|
||||||
opencv2
|
opencv3
|
||||||
liblbfgs
|
liblbfgs
|
||||||
gt5.full
|
gt5.full
|
||||||
|
|
||||||
|
@ -194,14 +194,20 @@ void PreloadSource::getSumOfRectangleSampling(const QVector<cv::Point2f> pts,
|
|||||||
sumValues = 0;
|
sumValues = 0;
|
||||||
numPixels = 0;
|
numPixels = 0;
|
||||||
|
|
||||||
IplImage tmp = image;
|
IplImage tmp = cvIplImage(image);
|
||||||
assert(image.type() == CV_8U);
|
assert(image.type() == CV_8U);
|
||||||
|
|
||||||
for (int i=0; i<4; i++)
|
for (int i=0; i<4; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
CvLineIterator iterator;
|
CvLineIterator iterator;
|
||||||
const int count = cvInitLineIterator( &tmp, pts[i], pts[(i+1)%4], &iterator, 4);
|
const int count = cvInitLineIterator(
|
||||||
|
&tmp,
|
||||||
|
cvPoint(cvRound(pts[i].x), cvRound(pts[i].y)),
|
||||||
|
cvPoint(cvRound(pts[(i + 1) % 4].x), cvRound(pts[(i + 1) % 4].y)),
|
||||||
|
&iterator,
|
||||||
|
4
|
||||||
|
);
|
||||||
|
|
||||||
for( int j = 0; j < count; j++ ){
|
for( int j = 0; j < count; j++ ){
|
||||||
sumValues += iterator.ptr[0];
|
sumValues += iterator.ptr[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user