Comments (4)
The interface was coded a bit too hastily :-). In C, there's an API function called THTensor_getContiguous(), which creates a contiguous tensor from any tensor. In Lua, that function is just called :contiguous(). These should always be used/called when creating interfaces to other libs.
from lua---opencv.
I'm not sure how they would help in this case. For example, in the function
static IplImage * libopencv_(Main_torchimg2opencv_8U)(THTensor *source) {
the copy is done like this
TH_TENSOR_APPLY(real, tslice,
*destp = (uchar)(*tslice_data * 255.0);
// step through ipl
destp = destp + dest->nChannels;
);
Whether tslice is contiguous or not isn't the problem. It's that we're treating the raw data from IplImage as if widthStep == width.
I think this could be solved by dropping the macro and writing the inner loops, by padding tslice, or if you're feeling particularly evil by referencing the macro's loop variable inside the code we send it.
from lua---opencv.
I believe this was from a while ago, but fixed the bug in my branch and issued a pull request. Issue can be closed after pulled.
#3
from lua---opencv.
Hi,
I want to convert a real * variable to an IplImage *variable. Can you tell me how to do it?
thanks
from lua---opencv.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua---opencv.