Translate C++ program to Javascript $30-250 USD Publicado há aproximadamente 10 anos
$30-250 USD Pago na entrega
I need this translated to Javascript from C++:
#include <opencv2\highgui\highgui_c.h>
#include <opencv2\imgproc\imgproc_c.h>
#include <cstdio>
#include <map>
int main(int argc, char *argv[])
{
if (argc < 2) {
printf("Usage: %s image_file\n", argv[0]);
return 0;
}
const char* inFilename = argv[1];
uint64 id = 0;
IplImage* inImg = cvLoadImage(inFilename);
if (inImg == NULL) {
printf("Error opening %s\n",inFilename);
return -1;
}
IplImage* hsv = cvCreateImage(cvGetSize(inImg), IPL_DEPTH_8U, 3);
cvCvtColor(inImg, hsv, CV_RGB2HSV);
IplImage* v = cvCreateImage(cvGetSize(inImg), IPL_DEPTH_8U, 1);
cvSplit(hsv, NULL, NULL, v, NULL);
CvSize size = cvGetSize(inImg);
[login to view URL] -= [login to view URL] % 8;
[login to view URL] -= [login to view URL] % 8;
IplImage* resv = cvCreateImage(size, IPL_DEPTH_8U, 1);
cvResize(v,resv);
CvSize boxSize = cvSize([login to view URL],[login to view URL]);
IplImage* mask = cvCreateImage(size, IPL_DEPTH_8U, 1);
unsigned char mean[8*8];
for (int ii = 0; ii < 8; ++ii) {
for (int jj = 0; jj < 8; ++jj) {
cvSet(mask,cvScalar(0));
cvDrawRect(mask,cvPoint(jj*[login to view URL],ii*[login to view URL]),cvPoint((jj+1)*[login to view URL], (ii+1)*[login to view URL]),cvScalar(255),-1);
// fprintf(log,"%3u ",(unsigned)cvAvg(resv,mask).val[0]);
mean[ii*8+jj] = (unsigned char)cvAvg(resv,mask).val[0];
}
//fprintf(log,"\n");
}
//FILE* log = fopen("[login to view URL]","w");
unsigned jj = 0;
for (int ii = 0; ii < 8*8 - 1; ++ii) {
int dif = (int) mean[ii] - (int) mean[ii+1];
if (dif >= 0) {
id |= 1LL << jj++;
} else
jj++;
//fprintf(log,"%d\n",dif);
}
printf("%llu\n", id);
//fclose(log);
}
Max 24 hours. Milestone will be set.
ID do Projeto: 5445178
Sobre o projeto 5 propostas
Projeto remoto
Ativo há 10 anos
Quer ganhar algum dinheiro? Endereço de e-mail Candidate-se a trabalhos semelhantes Benefícios de ofertar no Freelancer Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
É grátis para se inscrever e fazer ofertas em trabalhos
5 freelancers estão ofertando em média $242 USD for esse trabalho
Hello,
expert in C++ and JavaScript programing. I can translate your OpenCV code to JavaScript.
Thanks,
Paul
$500 USD em 7 dias
5,0 (46 avaliações) i can build this using canvas and file api html5 to perform the same action on upload or drop, please contact me if interedted
$250 USD em 0 dia
5,0 (16 avaliações) Hey Hi, I am pretty good in both the programming languages - C++ and Javascript. Recently, in my office project, I've successfully done the similar task. I can do this for you in the given timelines. Please assign this project to me. Thanks... Saurabh
$230 USD em 3 dias
0,0 (0 avaliações) From the code you sent I see that it is an opencv program, I have a lot experience programming in opencv in c++ and have done a couple of projects in motion detection with javascript. I will be able to translate this code fairly quickly.
$166 USD em 3 dias
0,0 (0 avaliações)