Extract the value of interest rows and copy that to new Mat

Simple example code.

using push_back

#end code

using concate
#start code

#end code

Check the rect contains point, opencv tip


Use this function "Rect.contains(Point)".

Rect roi(10,10,20,20);
Point pt(14,14);

if (roi.contains(pt))
  cout << "The pt inside in the rect" << endl;

Thank you.


simple tip: int to string in stl

memo for me.. ^^

for(int i=0; i<10; ++i)
     std::string index1("string_" + std::to_string(i) + ".jpg");


Tensorflow RNN LSTM weight save and restore example code

I have been struggled for long time for save and restore the result of LSTM params.
Today, I have succeeded, I hope anyone helping this my example code.

Below code is example to learning for
input: hihell -> output: ihello

gist code start
This code is referenced by this(https://github.com/MareArts/DeepLearningZeroToAll/blob/master/lab-12-1-hello-rnn.py)

gist code end

There are 4 variable for trainable
name rnn/basic_lstm_cell/weights:0, shape (10, 20)
name rnn/basic_lstm_cell/biases:0, shape (20,1)
name fully_connected/weights:0, shape (5, 5)
name fully_connected/biases:0, shape (5,1)

And I have checked the values which are same after "global_variables_initializer"
The result is same and prediction result is also same.

OK, then let's move more complicated RNN design.
This example code for 2 layer LSTM and 2 batch condition.
gist code start

gist code end