ermig1979 / Simd

C++ image processing and machine learning library with using of SIMD: SSE, AVX, AVX-512, AMX for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC, NEON for ARM.
http://ermig1979.github.io/Simd
MIT License
2.04k stars 407 forks source link

Simd Face Detect #128

Closed syberarall closed 4 years ago

syberarall commented 4 years ago

I wrote following code to do face detection:

PGVSP_IMAGE_DATA_LEADER pLeader = (PGVSP_IMAGE_DATA_LEADER)pBuffer;
PUCHAR pData = (PUCHAR)&pBuffer[sizeof(GVSP_IMAGE_DATA_LEADER)];
ULONG SizeX = 0;
ULONG SizeY = 0;
ULONG PixelFormat = 0;

//Get image leader elements
ETH_GET_BIGENDIAN_ULONG(pLeader->size_x, &SizeX);
ETH_GET_BIGENDIAN_ULONG(pLeader->size_y, &SizeY);
ETH_GET_BIGENDIAN_ULONG(pLeader->pixel_format, &PixelFormat);

//Process image
if ((SizeX) && (SizeY))
{
    ULONG StrideGray8 = SizeX;
    ULONG StrideInt16 = SizeX * 2;

    {
        typedef Simd::Detection<Simd::Allocator> DetectionType;
        DetectionType MyDetection;
        DetectionType::Objects MyObjects;
        DetectionType::View image; //image(SizeX, SizeY, StrideGray8, DetectionType::View::Gray8, pData);

MyDetection.Load("D:\Sybera\Sha64\Cores\GevCore64\Utilities\Simd4381\data\cascade\haar_face_0.xml");

        if (__bDetectInitDone == FALSE)
        {
            MyDetection.Init(image.Size(), 1.2, image.Size() / 20);
            __bDetectInitDone = TRUE;
        }

        MyDetection.Detect(image, MyObjects);
    }
}

At compilation I Get an error on MyDetection.Detect(image, MyObjects) out of the library SIMDDETECTION.HPP at line 687:

'(': illegal token on right side of '::'

Any idea ?

ermig1979 commented 4 years ago

Hello! There are no '(' or '::' at line 687 in the file SimdDetection.hpp ! And there are no changes in code of this file this year.

syberarall commented 4 years ago

Dear Ihar,

here is what I mean when I try to compile my code:

Simd Error

ermig1979 commented 4 years ago

Perhaps you forget define macro NOMINMAX befor including windows.h :

#define NOMINMAX
#include <windows.h>
syberarall commented 4 years ago

Great help - thanks a lot !!!