forked from hybridgroup/gocv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can load a file into a Mat, and display it in the Window
Signed-off-by: deadprogram <[email protected]>
- Loading branch information
1 parent
18c6263
commit ea376b3
Showing
10 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "imgcodecs.h" | ||
|
||
// Image | ||
Mat Image_IMRead(const char* filename, int flags) { | ||
cv::Mat img = cv::imread(filename, flags); | ||
return new cv::Mat(img); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package opencv3 | ||
|
||
/* | ||
#include <stdlib.h> | ||
#include "imgcodecs.h" | ||
*/ | ||
import "C" | ||
import ( | ||
"unsafe" | ||
) | ||
|
||
// IMRead reads an image file into a Mat | ||
func IMRead(name string, flags int) Mat { | ||
cName := C.CString(name) | ||
defer C.free(unsafe.Pointer(cName)) | ||
|
||
return Mat{p: C.Image_IMRead(cName, C.int(flags))} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef _OPENCV3_IMGCODECS_H_ | ||
#define _OPENCV3_IMGCODECS_H_ | ||
|
||
#ifdef __cplusplus | ||
#include <opencv2/opencv.hpp> | ||
extern "C" { | ||
#endif | ||
|
||
#include "core.h" | ||
|
||
Mat Image_IMRead(const char* filename, int flags); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif //_OPENCV3_IMGCODECS_H_ |