Find Jobs
Hire Freelancers

Debug simple OpenCV issue in Managed C++

$10-30 USD

Abgeschlossen
Veröffentlicht vor etwa 8 Jahren

$10-30 USD

Bezahlt bei Lieferung
Hi there, I am opening a bmp image and converting it into CV::MAT format (opencv) . And then write that image into disk. Following is the code I am using. If I am using grayscale image, the writing to disk is working fine. If I am using a color image I am getting a memory access violation. Can you please let me know how to fix this? Bitmap^ sourceBMP; sourceBMP = gcnew Bitmap("C:/opencv/[login to view URL]", true); //sourceBMP = gcnew Bitmap("C:/opencv/[login to view URL]", true); cv::Mat cvImg, cvImg_out; System::Drawing::Rectangle rect = System::Drawing::Rectangle(0, 0, sourceBMP->Width, sourceBMP->Height); bmp_Depth = System::Drawing::Bitmap::GetPixelFormatSize(sourceBMP->PixelFormat); bmp_BitsPerPixel = bmp_Depth / 8; bitmapData = sourceBMP->LockBits(rect, System::Drawing::Imaging::ImageLockMode::ReadWrite, sourceBMP->PixelFormat); stride = Math::Abs(bitmapData->Stride); if (bmp_Depth == 8) cvImg = cv::Mat(sourceBMP->Height, stride, CV_8UC1, (char*)bitmapData->[login to view URL]()); if (bmp_Depth == 24) cvImg = cv::Mat(sourceBMP->Height, stride, CV_8UC3, (char*)bitmapData->[login to view URL]()); cv::imwrite("C:/opencv/[login to view URL]", cvImg); if (bmp_Depth == 24) { cv::cvtColor(cvImg, cvImg_out, CV_BGR2XYZ); cv::imwrite("C:/opencv/[login to view URL]", cvImg_out); }
Projekt-ID: 9774891

Über das Projekt

8 Vorschläge
Remote Projekt
Aktiv vor 8 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
Hello. I am a senior level developer and Visual C++ expert. Can you please provide both a grayscale and color image that induces the memory access violation you're seeing? If so, I'm confident I can identify your problem. Please feel free to send me a private message to discuss any details. You do not need to pay me anything until the solution is provided, no milestone payments necessary. Thanks and I look forward to working with you.
$30 USD in 1 Tag
5,0 (3 Bewertungen)
1,9
1,9
8 Freelancer bieten im Durchschnitt $27 USD für diesen Auftrag
Avatar des Nutzers
Hello. I have quite large experience with C++/CLI. I would prefer to use drawing instead copying of bits
$26 USD in 2 Tagen
4,9 (952 Bewertungen)
7,3
7,3
Avatar des Nutzers
Hi! I am professional C/C++/C#/Java/Python programmer! I can do this project with highest quality! Best regards, Szymszteinsl
$50 USD in 1 Tag
4,9 (63 Bewertungen)
6,6
6,6
Avatar des Nutzers
Hello there, Open CV is only meant (or built ) for native C++ on Windows platforms; not managed C++. Given the sheer amount of pointers and low-lelve C and C+= features used by OpenCV, I'm not at all surprised that you are having problems accessing OpenCV functions - correctly- using Managed C++. Do you mind me asking : 1) What version of Open CV libraries are you linking against? 2) What version of Visual Studio are you using? 3)What kind of greater context is this application running in? I can help you - possibly, once I know some answers to the above questions. Cheers
$25 USD in 1 Tag
5,0 (32 Bewertungen)
6,3
6,3
Avatar des Nutzers
Hi, i also work with OpenCV. I'll fix it for you immediately, chat for more information.
$25 USD in 1 Tag
5,0 (10 Bewertungen)
4,0
4,0
Avatar des Nutzers
Hello, sir, I am image processing expert, i have full experience in opencv. I can solve this problem in 1 hours. Thank you
$25 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
A proposal has not yet been provided
$27 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
I guess (without even installing opencv because compiling it is such a pain) that your colour bitmaps are in RGBA (this is semi standard for .bmp) which means you have 3 colour channels plus an alpha channel. Which means your colour depth is greater than 24. Which in turn means that your 'cvImg' is empty when you try to write it. I apologise in advance if this is wrong.
$10 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von KOREA, REPUBLIC OF
SK, Korea, Republic of
5,0
220
Zahlungsmethode verifiziert
Mitglied seit Sept. 3, 2010

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.