cv2 output different in c# and python
See original GitHub issueSummary of your issue
Environment
.NET OPENCVSHARP4.WINDOWS
What did you do when you faced the problem?
In Python cv2.imread() got a output : [[42. 49. 58.] [40. 47. 56.] [36. 43. 52.] but in c# I got a output :
63.00,82.00,95.00 61.00,83.00,95.00 77.00,97.00,114.00 first 3 row output (and other output also different)
I don’t know why this happend …
When I tried to other project it was same but now it’s different
Example code:
python : def read_image_bgr(path):
image = cv2.imread(path) #수
print(image[0,:])
return image
c#: Mat img1 = Cv2.ImRead(path); img1.ConvertTo(img1, MatType.CV_32FC3); PrintDataMat(img1);
Output:
n Python cv2.imread() got a output : [[42. 49. 58.] [40. 47. 56.] [36. 43. 52.] but in c# I got a output :
63.00,82.00,95.00 61.00,83.00,95.00 77.00,97.00,114.00
What did you intend to be?
I wanted to get same output but it’s different I guess to try to change x axis and y axis but it’s not same … why it is happend …
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Different results in c++ and python openCV code
It seems like i wrote the same things in pyhton and c++, but it produces completely different result. c++ code
Read more >Different output from Python and C++ in CalibrateHandEye()
Hi, We have tried to translate a C++ project into Python. The problem is that we get different outputs from the calibrateHandEye() function...
Read more >Different behavior of resize function with python and C++ ...
I am using both opencv 3.4 for python and C platforms. And the behavior of python cv2.resize function does not change between different...
Read more >Read, Display and Write an Image using OpenCV
Reading, displaying, and writing images are basic to image processing and computer vision. Even when cropping, resizing, rotating, or applying different ...
Read more >Reading an image in OpenCV using Python
Let's start reading an image. using cv2. To read the images cv2.imread() method is used. This method loads an image from the specified...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is PrintDataMat first 3 col and last 4col(i mean 0 1 2 423 424 425 426
bgr bgr bgr bgr bgr bgr bgr)
becasue python print(image) shows only first 3col and last 3col so I make if like that and I tried to use mat.At too … but got a same output
jpeg file size is 426x426 and I think python’s output is correct because when I using jpeg color viewer in online got a same output with python
python version
ah sorry was my mistake my source was corrupted thanks I close my issue