maxruby / OpenCV.jl

The OpenCV (C++) interface for Julia
Other
104 stars 28 forks source link

rectifying index in img to mat conversion #38

Open tosalonijain opened 6 years ago

tosalonijain commented 6 years ago

I suppose alike what we have done for image conversion in case of grayscale and binary (cd<3), for coloured images also: "# -1 to have 0-indexing per C++"

" " "if (cd < 3) # grayscale or binary for j = 1:Base.size(img,2) # index row first (Mat is row-major order) for k =1:Base.size(img,1) # index column second

slow algorithm - will try to use pointer method (C++)!

            pixset(mat, k-1, j-1, float(img[k,j,1].i))
        end
    end
end

" " " Although I haven't run this yet since I was looking through the code from another pc. May be I am misinterpreting the situation.

Thank you.